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.
124 lines
3.2 KiB
124 lines
3.2 KiB
3 months ago
|
using MESClassLibrary.BLL.BasicInfo;
|
||
|
using MESClassLibrary.EFModel;
|
||
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Web;
|
||
|
|
||
|
namespace MESWebSite.HttpHandlers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// BomHandler 的摘要说明
|
||
|
/// </summary>
|
||
|
public class BomHandler : 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"];
|
||
|
string partNo1 = Request.Params["PartNo1"];
|
||
|
string partNo2 = Request.Params["PartNo2"];
|
||
|
|
||
|
if (string.IsNullOrEmpty(page))
|
||
|
{
|
||
|
page = "0";
|
||
|
}
|
||
|
if (string.IsNullOrEmpty(pagesize))
|
||
|
{
|
||
|
pagesize = "15";
|
||
|
}
|
||
|
BomBLL bll = new BomBLL();
|
||
|
Response.Write(bll.SearchInfoAll(page, pagesize, partNo1, partNo2));
|
||
|
Response.End();
|
||
|
|
||
|
|
||
|
}
|
||
|
void SaveInfo()
|
||
|
{
|
||
|
string BomID = Request.Params["BomID"];
|
||
|
string PartNo1 = Request.Params["PartNo1"];
|
||
|
string PartNo2 = Request.Params["PartNo2"];
|
||
|
|
||
|
BomBLL bll = new BomBLL();
|
||
|
tb_Bom md = new tb_Bom();
|
||
|
|
||
|
md.PartNo1 = PartNo1;
|
||
|
md.PartNo2 = PartNo2;
|
||
|
|
||
|
var info = Request.Cookies.Get("LoginUserInfo");
|
||
|
if (info != null)
|
||
|
{
|
||
|
md.UserID = info["UserID"].ToUpper();
|
||
|
}
|
||
|
|
||
|
if (BomID == "0")
|
||
|
{
|
||
|
//新增
|
||
|
md.BomID = Guid.NewGuid().ToString();
|
||
|
Response.Write(bll.AddInfo(md) == true ? "true" : "false");
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
//修改
|
||
|
md.BomID = BomID;
|
||
|
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
|
||
|
}
|
||
|
Response.End();
|
||
|
}
|
||
|
void DelInfo()
|
||
|
{
|
||
|
string BomID = Request.Params["BomID"];
|
||
|
|
||
|
BomBLL bll = new BomBLL();
|
||
|
tb_Bom md = new tb_Bom();
|
||
|
md.BomID = BomID;
|
||
|
var info = Request.Cookies.Get("LoginUserInfo");
|
||
|
if (info != null)
|
||
|
{
|
||
|
md.UserID = info["UserID"].ToUpper();
|
||
|
}
|
||
|
Response.Write(bll.DeleteInfo(md) == true ? "true" : "false");
|
||
|
Response.End();
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|