一厂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.

185 lines
4.9 KiB

2 months ago
using MESClassLibrary.BLL.Plan247;
using MESClassLibrary.EFModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MESWebSite.HttpHandlers
{
/// <summary>
/// Plan_247Handler 的摘要说明
/// </summary>
public class Plan_247Handler : 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 "SearchOrderNo":
SearchOrderNo();
break;
case "QueryForCombobox":
QueryForCombobox();
break;
case "GetMistake":
GetMistake();
break;
case "QueryForComboboxOrderNo":
QueryForComboboxOrderNo();
break;
case "QueryForItem":
QueryForItem();
break;
default:
break;
}
}
public bool IsReusable
{
get
{
return false;
}
}
void QueryList()
{
string page = Request.Params["page"];
string pagesize = Request.Params["rows"];
string StartTime = Request.Params["StartTime"];
string EndTime = Request.Params["EndTime"];
string OrderNo = Request.Params["OrderNo"];
if (string.IsNullOrEmpty(page))
{
page = "0";
}
if (string.IsNullOrEmpty(pagesize))
{
pagesize = "15";
}
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.SearchInfoAll(page, pagesize, StartTime, EndTime, OrderNo));
Response.End();
}
void SaveInfo()
{
string ID = Request.Params["ID"];
string OrderNo = Request.Params["OrderNo"];
string Item = Request.Params["Item"];
string PartNo = Request.Params["PartNo"];
string PartName = Request.Params["PartName"];
string PartConfig = Request.Params["PartConfig"];
string OrderCount = Request.Params["OrderCount"];
string Des = Request.Params["Des"];
Plan247BLL bll = new Plan247BLL();
tb_Plan_247 md = new tb_Plan_247();
md.OrderNo = OrderNo;
md.PartNo = PartNo;
md.Des = Des;
int Item_ = 0;
Int32.TryParse(Item, out Item_);
md.Item = Item_;
int OrderCount_ = 0;
Int32.TryParse(OrderCount, out OrderCount_);
md.OrderCount = OrderCount_;
if (ID == "0")
{
md.ID = Guid.NewGuid().ToString();
md.CreateTime = DateTime.Now;
md.LyCount = 0;
md.RepairCount = 0;
md.ScrapCount1 = 0;
md.ScrapCount2 = 0;
md.CompleteCount = 0;
md.IsFinish = 0;
//新增
Response.Write(bll.AddInfo(md) == true ? "true" : "false");
}
else
{
md.ID = ID;
//修改
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
}
Response.End();
}
void SearchOrderNo()
{
string StartTime = Request.Params["StartTime"];
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.SearchOrderNo(StartTime));
Response.End();
}
void QueryForCombobox()
{
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.GetComboboxData());
Response.End();
}
void GetMistake() {
string ID = Request.Params["ID"];
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.GetMistake(ID));
Response.End();
}
void QueryForComboboxOrderNo()
{
string StartTime = Request.Params["StartTime"];
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.QueryForComboboxOrderNo(StartTime));
Response.End();
}
void QueryForItem() {
string OrderNo = Request.Params["OrderNo"];
Plan247BLL bll = new Plan247BLL();
Response.Write(bll.QueryForItem(OrderNo));
Response.End();
}
}
}