using MESWebSite.CommonClass; using System; using System.Collections.Generic; using System.Linq; using System.Web; using MESClassLibrary.BLL.BasicInfo; using MESClassLibrary.EFModel; using MESClassLibrary; namespace MESWebSite.HttpHandlers { /// /// ManufacturerHandler 的摘要说明 /// public class ManufacturerHandler : BaseHandler { public ManufacturerHandler() : base() { RegisterAction(MenufacturerCombo); } private void MenufacturerCombo() { ManufactureBLL bll = new ManufactureBLL(); Response.Write(bll.SearchAll().ToSerializer()); Response.End(); } protected override void DelInfo() { string ID = GetParam("ID"); ManufactureBLL bll = new ManufactureBLL(); tb_Manufacturer md = new tb_Manufacturer { ID = ID }; var info = Request.Cookies.Get("LoginUserInfo"); if (info != null) { md.UserID = info["UserID"].ToUpper(); } Response.Write(bll.DeleteInfo(md) ? "true" : "false"); Response.End(); } protected override void SaveInfo() { string ID = GetParam("ID"); string ManufacturerName = GetParam("ManufacturerName"); string Des = GetParam("Des"); tb_Manufacturer md = new tb_Manufacturer { ManufacturerName = ManufacturerName, Des = Des }; var info = Request.Cookies.Get("LoginUserInfo"); if (info != null) { md.UserID = info["UserID"].ToUpper(); } ManufactureBLL bll = new ManufactureBLL(); if (ID == "0") { md.ID = Guid.NewGuid().ToString(); Response.Write(bll.AddInfo(md) ? "true" : "false"); } else { md.ID = ID; Response.Write(bll.UpdateInfo(md) ? "true" : "false"); } Response.End(); } protected override void QueryList() { string page = GetParam("page").DefaultValue("0"); string rows = GetParam("rows").DefaultValue("15"); string ManufacturerName = GetParam("ManufacturerName"); ManufactureBLL bll = new ManufactureBLL(); Response.Write(bll.SearchInfoAll(page, rows, ManufacturerName)); Response.End(); } } }