using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Estsh.Web.Service;
using System.Collections;
using System.Data;
using Estsh.Web.Util;
using Estsh.Web.Models;
namespace Estsh.Core.Web.Controllers
{
public class SwapSNInfoController : Controller
{
private SwapSNInfoService service = new SwapSNInfoService();
///
/// 判断库存合格证条码是否存在
///
/// 库存合格证条码
///
public ActionResult ExistSn(string serial_number)
{
bool resultbool = false;
try
{
resultbool = service.ExistSn(serial_number);
}
catch
{
}
Hashtable result = new Hashtable();
result.Add("status", resultbool);
return Json(result, JsonRequestBehavior.AllowGet);
}
public string GetAuditSwapFlag()
{
string result = service.GetAuditSwapFlag();
return result;
}
public ActionResult UpdateTable(string oldSN, string newSN)
{
UserInfo loginUser = (UserInfo)Session["loginedUser"];
string flag = GetAuditSwapFlag();
string result = service.UpdateTable(oldSN, newSN, flag, loginUser.empId);
return Json(result, JsonRequestBehavior.AllowGet);
}
public ActionResult GetSwapDataList(string sn, string remarkFlag, bool fuzzyQuery, Pager pager, String direction, String sort)
{
Hashtable para = new Hashtable(3);
para.Add("@newSN", sn);
para.Add("@oldSN", sn);
para.Add("@remarkFlag", remarkFlag);
Hashtable result = new Hashtable();
result.Add("pager.pageNo", pager.pageNo);
ArrayList list = service.GetSwapDataList(para, fuzzyQuery);
result.Add("sort", sort);
result.Add("direction", direction);
return Json(result);
}
}
}