using System; using System.Collections.Generic; using System.Linq; using System.Web; using MESClassLibrary.BLL.ZPPlan; using MESClassLibrary.EFModel; namespace MESWebSite.HttpHandlers { /// /// ZPBomHandler 的摘要说明 /// public class ZPBomHandler : IHttpHandler { HttpRequest Request = null; HttpResponse Response = null; public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; Request = context.Request; Response = context.Response; string method = Request.Params["method"]; switch (method) { case "QueryList": QueryList(); break; case "SaveInfo": SaveInfo(); break; case "DelInfo": DelInfo(); break; case "QueryForStep": QueryForStep(); break; default: break; } } public bool IsReusable { get { return false; } } void QueryList() { string page = Request.Params["page"]; string pagesize = Request.Params["rows"]; string PartNo1 = Request.Params["PartNo1"]; string PartNo2 = Request.Params["PartNo2"]; if (string.IsNullOrEmpty(page)) { page = "0"; } if (string.IsNullOrEmpty(pagesize)) { pagesize = "15"; } ZPBomBLL bll=new ZPBomBLL(); Response.Write(bll.SearchStepInfo(page, pagesize, PartNo1, PartNo2)); Response.End(); } void SaveInfo() { string ID = Request.Params["ID"]; string StationID = Request.Params["StationID"]; string ProductID1 = Request.Params["ProductID1"]; string ProductID2 = Request.Params["ProductID2"]; string MouldNo = Request.Params["MouldNo"]; string Step = Request.Params["Step"]; string IsHigh = Request.Params["IsHigh"]; string IsCode = Request.Params["IsCode"]; string IsPhoto = Request.Params["IsPhoto"]; tb_ZPBom md=new tb_ZPBom(); ZPBomBLL bll=new ZPBomBLL(); md.StationID = StationID; md.ProductID1 = ProductID1; md.ProductID2 = ProductID2; md.MouldNo = MouldNo; md.Step = Convert.ToInt32(Step); //md.IsHigh = Convert.ToInt32(IsHigh); md.IsScanCode = Convert.ToInt32(IsCode); md.IsPhoto = Convert.ToInt32(IsPhoto); if (ID == "0") { //新增 md.ID = Guid.NewGuid().ToString(); Response.Write(bll.AddInfo(md) == true ? "true" : "false"); } else { //修改 md.ID = ID; Response.Write(bll.UpdateInfo(md) == true ? "true" : "false"); } Response.End(); } void DelInfo() { string ID = Request.Params["ID"]; ZPBomBLL bll = new ZPBomBLL(); tb_ZPBom md = new tb_ZPBom(); md.ID = ID; var info = Request.Cookies.Get("LoginUserInfo"); if (info != null) { md.UserID = info["UserID"].ToUpper(); } Response.Write(bll.DeleteInfo(md) == true ? "true" : "false"); Response.End(); } void QueryForStep() { string stationID = Request.Params["stationID"]; string ProductID = Request.Params["ProductID"]; ZPBomBLL bll=new ZPBomBLL(); Response.Write(bll.QueryForStep(stationID, ProductID)); Response.End(); } } }