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

198 lines
6.9 KiB

3 months ago
using MESClassLibrary.BLL.Report;
using MESClassLibrary.EFModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MESWebSite.HttpHandlers
{
/// <summary>
/// FiveScreenHandler 的摘要说明
/// </summary>
public class FiveScreenHandler : 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"];
if (string.IsNullOrEmpty(page))
{
page = "0";
}
if (string.IsNullOrEmpty(pagesize))
{
pagesize = "15";
}
FiveScreenBLL bll = new FiveScreenBLL();
Response.Write(bll.SearchInfoAll(page, pagesize));
Response.End();
}
void SaveInfo()
{
string ID = Request.Params["ID"];
string Name = Request.Params["Name"];
string LastYear = Request.Params["LastYear"];
string Jan = Request.Params["Jan"];
string Feb = Request.Params["Feb"];
string Mar = Request.Params["Mar"];
string Apr = Request.Params["Apr"];
string May = Request.Params["May"];
string Jun = Request.Params["Jun"];
string Jul = Request.Params["Jul"];
string Aug = Request.Params["Aug"];
string Sept = Request.Params["Sept"];
string Oct = Request.Params["Oct"];
string Nov = Request.Params["Nov"];
string Dec = Request.Params["Dec"];
string day1 = Request.Params["day1"];
string day2 = Request.Params["day2"];
string day3 = Request.Params["day3"];
string day4 = Request.Params["day4"];
string day5 = Request.Params["day5"];
string day6 = Request.Params["day6"];
string day7 = Request.Params["day7"];
string day8 = Request.Params["day8"];
string day9 = Request.Params["day9"];
string day10 = Request.Params["day10"];
string day11 = Request.Params["day11"];
string day12 = Request.Params["day12"];
string day13 = Request.Params["day13"];
string day14 = Request.Params["day14"];
string day15 = Request.Params["day15"];
string day16 = Request.Params["day16"];
string day17 = Request.Params["day17"];
string day18 = Request.Params["day18"];
string day19 = Request.Params["day19"];
string day20 = Request.Params["day20"];
string day21 = Request.Params["day21"];
string day22 = Request.Params["day22"];
string day23 = Request.Params["day23"];
string day24 = Request.Params["day24"];
string day25 = Request.Params["day25"];
string day26 = Request.Params["day26"];
string day27 = Request.Params["day27"];
string day28 = Request.Params["day28"];
string day29 = Request.Params["day29"];
string day30 = Request.Params["day30"];
string day31 = Request.Params["day31"];
FiveScreenBLL bll = new FiveScreenBLL();
tb_Report_FiveScreen md = new tb_Report_FiveScreen();
md.Name = Name;
md.LastYear = Convert.ToDecimal(LastYear);
md.Jan = Convert.ToDecimal(Jan);
md.Feb = Convert.ToDecimal(Feb);
md.Mar = Convert.ToDecimal(Mar);
md.Apr = Convert.ToDecimal(Apr);
md.May = Convert.ToDecimal(May);
md.Jun = Convert.ToDecimal(Jun);
md.Jul = Convert.ToDecimal(Jul);
md.Aug = Convert.ToDecimal(Aug);
md.Sept = Convert.ToDecimal(Sept);
md.Oct = Convert.ToDecimal(Oct);
md.Nov = Convert.ToDecimal(Nov);
md.Dec = Convert.ToDecimal(Dec);
md.day1 = Convert.ToDecimal(day1);
md.day2 = Convert.ToDecimal(day2);
md.day3 = Convert.ToDecimal(day3);
md.day4 = Convert.ToDecimal(day4);
md.day5 = Convert.ToDecimal(day5);
md.day6 = Convert.ToDecimal(day6);
md.day7 = Convert.ToDecimal(day7);
md.day8 = Convert.ToDecimal(day8);
md.day9 = Convert.ToDecimal(day9);
md.day10 = Convert.ToDecimal(day10);
md.day11 = Convert.ToDecimal(day11);
md.day12 = Convert.ToDecimal(day12);
md.day13 = Convert.ToDecimal(day13);
md.day14 = Convert.ToDecimal(day14);
md.day15 = Convert.ToDecimal(day15);
md.day16 = Convert.ToDecimal(day16);
md.day17 = Convert.ToDecimal(day17);
md.day18 = Convert.ToDecimal(day18);
md.day19 = Convert.ToDecimal(day19);
md.day20 = Convert.ToDecimal(day20);
md.day21 = Convert.ToDecimal(day21);
md.day22 = Convert.ToDecimal(day22);
md.day23 = Convert.ToDecimal(day23);
md.day24 = Convert.ToDecimal(day24);
md.day25 = Convert.ToDecimal(day25);
md.day26 = Convert.ToDecimal(day26);
md.day27 = Convert.ToDecimal(day27);
md.day28 = Convert.ToDecimal(day28);
md.day29 = Convert.ToDecimal(day29);
md.day30 = Convert.ToDecimal(day30);
md.day31 = Convert.ToDecimal(day31);
if (ID == "0")
{
//新增
md.ID = Guid.NewGuid().ToString();
md.CreateTime = DateTime.Now;
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"];
FiveScreenBLL bll = new FiveScreenBLL();
tb_Report_FiveScreen md = new tb_Report_FiveScreen();
md.ID = ID;
Response.Write(bll.DeleteInfo(md) == true ? "true" : "false");
Response.End();
}
}
}