using MESClassLibrary.BLL.BasicInfo; using MESClassLibrary.EFModel; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; namespace MESWebSite.HttpHandlers { /// /// ModelProductHandler 的摘要说明 /// public class ModelProductHandler : BaseHandler { //public ModelProductHandler(): base() //{ // RegisterAction(QueryExcel); //} protected override void QueryList() { string ProductID = GetParam("ProductID"); string ModelID = GetParam("ModelID"); ModelProductBLL bll = new ModelProductBLL(); Response.Write(bll.SearchInfoAll(Page, Rows, ModelID, ProductID)); Response.End(); } protected override void SaveInfo() { string ID = GetParam("ID"); string ProductID = GetParam("ProductID"); string ModelID = GetParam("ModelID"); tb_Model_Product md = new tb_Model_Product { ProuctID = ProductID, ModelID = ModelID }; ModelProductBLL bll = new ModelProductBLL(); 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 DelInfo() { string ID = GetParam("ID"); ModelProductBLL bll = new ModelProductBLL(); tb_Model_Product mp = new tb_Model_Product { ID = ID }; Response.Write(bll.DeleteInfo(mp) ? "true" : "false"); Response.End(); } } }