You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.6 KiB
94 lines
2.6 KiB
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
|
|
{
|
|
/// <summary>
|
|
/// ManufacturerHandler 的摘要说明
|
|
/// </summary>
|
|
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();
|
|
}
|
|
|
|
}
|
|
}
|