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.
134 lines
3.5 KiB
134 lines
3.5 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using MESClassLibrary.BLL.BasicInfo;
|
|
using MESClassLibrary.EFModel;
|
|
|
|
namespace MESWebSite.HttpHandlers
|
|
{
|
|
/// <summary>
|
|
/// ProjectHandler 的摘要说明
|
|
/// </summary>
|
|
public class ProjectHandler : 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;
|
|
case "QueryCombox":
|
|
QueryCombobox();
|
|
break;
|
|
default:
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
void QueryForCombobox()
|
|
{
|
|
string Project = Request.Params["Project"];
|
|
|
|
ProjectBLL bll = new ProjectBLL();
|
|
Response.Write(bll.GetComboboxData(Project));
|
|
Response.End();
|
|
}
|
|
|
|
void QueryList()
|
|
{
|
|
string page = Request.Params["page"];
|
|
string pagesize = Request.Params["rows"];
|
|
string Project = Request.Params["Project"];
|
|
string LocationID = Request.Params["LocationID"];
|
|
|
|
|
|
if (string.IsNullOrEmpty(page))
|
|
{
|
|
page = "0";
|
|
}
|
|
if (string.IsNullOrEmpty(pagesize))
|
|
{
|
|
pagesize = "15";
|
|
}
|
|
ProjectBLL bll = new ProjectBLL();
|
|
Response.Write(bll.SearchInfo(page, pagesize, Project, LocationID));
|
|
Response.End();
|
|
}
|
|
|
|
void SaveInfo()
|
|
{
|
|
string ID = Request.Params["ID"];
|
|
string LocationID = Request.Params["LocationID"];
|
|
string Project = Request.Params["Project"];
|
|
|
|
ProjectBLL bll = new ProjectBLL();
|
|
tb_Project md = new tb_Project();
|
|
|
|
md.LocationID = LocationID;
|
|
md.Project = Project;
|
|
|
|
if (ID == "0")
|
|
{
|
|
//新增
|
|
md.ID = Guid.NewGuid().ToString();
|
|
Response.Write(bll.AddInfo(md) == true ? "true" : "false");
|
|
}
|
|
else
|
|
{
|
|
//修改
|
|
md.ID = ID;
|
|
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
|
|
}
|
|
Response.End();
|
|
}
|
|
|
|
void DelInfo()
|
|
{
|
|
string ID = Request.Params["ID"];
|
|
|
|
ProjectBLL bll = new ProjectBLL();
|
|
tb_Project md = new tb_Project();
|
|
md.ID = ID;
|
|
Response.Write(bll.DelInfo(md) == true ? "true" : "false");
|
|
Response.End();
|
|
|
|
}
|
|
|
|
void QueryCombobox()
|
|
{
|
|
ProjectBLL bll = new ProjectBLL();
|
|
Response.Write(bll.GetData());
|
|
Response.End();
|
|
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|