using MESClassLibrary.BLL.BasicInfo; using MESClassLibrary.EFModel; using MESWebSite.CommonClass; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MESWebSite.HttpHandlers { /// /// CarTypeHandler 的摘要说明 /// public class XDStockAreaHandler : BaseHandler { public XDStockAreaHandler() : base() { } protected override void QueryList() { string page = GetParam("page").DefaultValue("0"); string rows = GetParam("rows").DefaultValue("15"); string code = GetParam("Code"); string name = GetParam("Name"); XDStockAreaBLL bll = new XDStockAreaBLL(); Response.Write(bll.SearchInfoAll(page, rows, code, code)); Response.End(); } protected override void SaveInfo() { string ID = GetParam("ID"); int id = 0; int.TryParse(ID, out id); string Name = GetParam("Name"); string Code = GetParam("Code"); string U8Code = GetParam("U8Code"); XDStockAreaBLL bll = new XDStockAreaBLL(); t_XD_StockArea md = new t_XD_StockArea { ID = id, Name = Name, Code = Code, U8Code = U8Code }; //var info = Request.Cookies.Get("LoginUserInfo"); //if (info != null) //{ // md.UserID = info["UserID"].ToUpper(); //} if (ID == "0") { //md.ID = Guid.NewGuid().ToString(); Response.Write(bll.AddInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("保存失败")); } else { md.ID = id; Response.Write(bll.UpdateInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("更新失败")); } Response.End(); } protected override void DelInfo() { string ID = GetParam("ID"); int id = 0; int.TryParse(ID, out id); if (id == 0) return; XDStockAreaBLL bll = new XDStockAreaBLL(); t_XD_StockArea md = new t_XD_StockArea { ID = id }; var info = Request.Cookies.Get("LoginUserInfo"); //if (info != null) //{ // md.UserID = info["UserID"].ToUpper(); //} Response.Write(bll.DeleteInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("删除失败")); Response.End(); } } }