using MESClassLibrary.BLL.Report; using MESClassLibrary.EFModel; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MESWebSite.HttpHandlers { /// /// FiveScreenLastHandler 的摘要说明 /// public class FiveScreenLastHandler : 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; default: break; } } public bool IsReusable { get { return false; } } void QueryList() { string page = Request.Params["page"]; string pagesize = Request.Params["rows"]; if (string.IsNullOrEmpty(page)) { page = "0"; } if (string.IsNullOrEmpty(pagesize)) { pagesize = "15"; } FiveScreenLastBLL bll = new FiveScreenLastBLL(); Response.Write(bll.SearchInfoAll(page, pagesize)); Response.End(); } void SaveInfo() { string ID = Request.Params["ID"]; string StationID = Request.Params["StationID"]; string StationNo = Request.Params["StationNo"]; string UseRate = Request.Params["UseRate"]; string PassRate = Request.Params["PassRate"]; string Remark1 = Request.Params["Remark1"]; FiveScreenLastBLL bll = new FiveScreenLastBLL(); tb_Report_FiveScreenLast md = new tb_Report_FiveScreenLast(); md.StationID = StationID; md.StationNo = StationNo; md.UseRate = UseRate; md.PassRate = PassRate; md.Remark1 = Remark1; if (ID == "0") { //新增 md.ID = Guid.NewGuid().ToString(); md.CreateTime = DateTime.Now; 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"]; FiveScreenLastBLL bll = new FiveScreenLastBLL(); tb_Report_FiveScreenLast md = new tb_Report_FiveScreenLast(); md.ID = ID; Response.Write(bll.DeleteInfo(md) == true ? "true" : "false"); Response.End(); } } }