using BLL.DAL;
|
using Common;
|
using Json;
|
using Lib;
|
using Model;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web.Mvc;
|
using System.Web.Script.Serialization;
|
|
namespace wms.Areas.Data.Controllers
|
{
|
public class StorePalnoController : MasterPage
|
{
|
// GET: Data/StorePalno
|
[LoginFilter]
|
public ActionResult Index()
|
{
|
ViewBag.MatType = LocalHelper.GetDictionaryHtml("MatType");
|
ViewBag.Certificate = LocalHelper.GetCertificateHtml();
|
return View();
|
}
|
}
|
|
public class StorePalnoAjaxController : AjaxPage
|
{
|
public ActionResult GetList()
|
{
|
try
|
{
|
var dd = Request["aaa"];
|
var modelItems = new JavaScriptSerializer().Deserialize<StroeItems>(dd);
|
if (modelItems != null)
|
{
|
// 实例化分页信息
|
PageInfo pageInfo = new PageInfo()
|
{
|
PageIndex = modelItems.pageIndex,
|
PageSize = modelItems.pageSize
|
};
|
modelItems.DepartGuid = this.LoginDepartNum;
|
// 数据库交互,获取库区集合and分页信息。
|
DALStroeMat provider = new DALStroeMat();
|
List<StroeItems> entity = provider.GetStroeItems(modelItems, ref pageInfo).ToList();
|
|
// Data =》json
|
string json = JsonHelper.IListToJson<StroeItems>(entity, "List");
|
string pjson = ConvertJson.Serializer(pageInfo);
|
|
// controller => view
|
ReturnJson.AddProperty("Result", new JsonObject(json));
|
ReturnJson.AddProperty("PageInfo", new JsonObject(pjson));
|
ReturnJson.AddProperty("Code", 1);
|
ReturnJson.AddProperty("Message", "加载库位明细成功!");
|
|
return Content(this.ReturnJson.ToString());
|
}
|
|
return Content(null);
|
}
|
catch (System.Exception)
|
{
|
return Content(null);
|
}
|
}
|
|
|
public ActionResult SetSeesion()
|
{
|
Session["Stitems"] = null;
|
var dd = Request["ajaxdata"];
|
Session["Stitems"] = new JavaScriptSerializer().Deserialize<StroeItems>(dd);
|
|
ReturnJson.AddProperty("Code", 1);
|
return Content(this.ReturnJson.ToString());
|
}
|
}
|
}
|