一厂MES,含注塑,喷涂,冲孔
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.
 
 
 
 
 

137 lines
3.6 KiB

using MESClassLibrary.BLL.BasicInfo;
using MESClassLibrary.EFModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MESWebSite.HttpHandlers
{
/// <summary>
/// PlaceHandler 的摘要说明
/// </summary>
public class PlaceHandler : 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;
case "QueryForCombobox":
QueryForCombobox();
break;
default:
break;
}
}
public bool IsReusable
{
get
{
return false;
}
}
void QueryList()
{
string page = Request.Params["page"];
string pagesize = Request.Params["rows"];
string PlaceName = Request.Params["PlaceName"];
string FactoryID = Request.Params["FactoryID"];
if (string.IsNullOrEmpty(page))
{
page = "0";
}
if (string.IsNullOrEmpty(pagesize))
{
pagesize = "15";
}
PlaceBLL bll = new PlaceBLL();
Response.Write(bll.SearchInfo(page, pagesize, PlaceName, FactoryID));
Response.End();
}
void SaveInfo()
{
string PlaceID = Request.Params["PlaceID"];
string FactoryID = Request.Params["FactoryID"];
string PlaceName = Request.Params["PlaceName"];
string Des = Request.Params["Des"];
PlaceBLL bll = new PlaceBLL();
tb_Place md = new tb_Place();
md.FactoryID = FactoryID;
md.PlaceName = PlaceName;
md.Des = Des;
var info = Request.Cookies.Get("LoginUserInfo");
if (info != null)
{
md.UserID = info["UserID"].ToUpper();
}
if (PlaceID == "0")
{
//新增
md.PlaceID = Guid.NewGuid().ToString();
Response.Write(bll.AddInfo(md) == true ? "true" : "false");
}
else
{
//修改
md.PlaceID = PlaceID;
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
}
Response.End();
}
void DelInfo()
{
string PlaceID = Request.Params["PlaceID"];
PlaceBLL bll = new PlaceBLL();
tb_Place md = new tb_Place();
var info = Request.Cookies.Get("LoginUserInfo");
if (info != null)
{
md.UserID = info["UserID"].ToUpper();
}
md.PlaceID = PlaceID;
Response.Write(bll.DelInfo(md) == true ? "true" : "false");
Response.End();
}
void QueryForCombobox()
{
PlaceBLL bll = new PlaceBLL();
Response.Write(bll.GetComboboxData());
Response.End();
}
}
}