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.
88 lines
2.7 KiB
88 lines
2.7 KiB
3 months ago
|
using MESClassLibrary.BLL.BasicInfo;
|
||
|
using MESClassLibrary.EFModel;
|
||
|
using MESWebSite.CommonClass;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Web;
|
||
|
|
||
|
namespace MESWebSite.HttpHandlers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// CarTypeHandler 的摘要说明
|
||
|
/// </summary>
|
||
|
public class CarTypeHandler : BaseHandler
|
||
|
{
|
||
|
public CarTypeHandler() : base()
|
||
|
{
|
||
|
RegisterAction(CarTypeCombo);
|
||
|
}
|
||
|
|
||
|
private void CarTypeCombo()
|
||
|
{
|
||
|
CarTypeBLL bll = new CarTypeBLL();
|
||
|
Response.Write(bll.CarTypeCombo());
|
||
|
Response.End();
|
||
|
}
|
||
|
|
||
|
protected override void QueryList()
|
||
|
{
|
||
|
string page = GetParam("page").DefaultValue("0");
|
||
|
string rows = GetParam("rows").DefaultValue("15");
|
||
|
string carTypeName = GetParam("CarTypeName");
|
||
|
string manufacturerID = GetParam("ManufacturerID");
|
||
|
CarTypeBLL bll = new CarTypeBLL();
|
||
|
Response.Write(bll.SearchInfoAll(page, rows, carTypeName, manufacturerID));
|
||
|
Response.End();
|
||
|
}
|
||
|
|
||
|
protected override void SaveInfo()
|
||
|
{
|
||
|
string ID = GetParam("ID");
|
||
|
string carTypeName = GetParam("CarTypeName");
|
||
|
string manufacturerID = GetParam("ManufacturerID");
|
||
|
tb_CarType md = new tb_CarType
|
||
|
{
|
||
|
ID = ID,
|
||
|
CarTypeName = carTypeName,
|
||
|
ManufacturerID = manufacturerID
|
||
|
};
|
||
|
|
||
|
var info = Request.Cookies.Get("LoginUserInfo");
|
||
|
if (info != null)
|
||
|
{
|
||
|
md.UserID = info["UserID"].ToUpper();
|
||
|
}
|
||
|
|
||
|
CarTypeBLL bll = new CarTypeBLL();
|
||
|
if (ID == "0")
|
||
|
{
|
||
|
md.ID = Guid.NewGuid().ToString();
|
||
|
Response.Write(bll.AddInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("保存失败"));
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
md.ID = ID;
|
||
|
Response.Write(bll.UpdateInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("更新失败"));
|
||
|
}
|
||
|
Response.End();
|
||
|
}
|
||
|
|
||
|
protected override void DelInfo()
|
||
|
{
|
||
|
string ID = GetParam("ID");
|
||
|
|
||
|
CarTypeBLL bll = new CarTypeBLL();
|
||
|
tb_CarType md = new tb_CarType { ID = ID };
|
||
|
var info = Request.Cookies.Get("LoginUserInfo");
|
||
|
if (info != null)
|
||
|
{
|
||
|
md.UserID = info["UserID"].ToUpper();
|
||
|
}
|
||
|
|
||
|
Response.Write(bll.DeleteInfo(md) ? ResponseResult.Success() : ResponseResult.Fail("删除失败"));
|
||
|
Response.End();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|