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

981 lines
38 KiB

<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
using System.Collections.Generic;
public class Handler : 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"];
string j = Request.Params["pa"];
switch (method)
{
case "GetTable1":
GetTable1();
break;
case "GetTable2":
GetTable2();
break;
case "GetTable3":
GetTable3();
break;
case "GetTable4":
GetTable4();
break;
case "GetTable5":
GetTable5();
break;
case "GetTable6":
GetTable6();
break;
case "GetTableX1":
GetTableX1(Convert.ToInt16(j));
break;
case "GetTableX2":
GetTableX2(Convert.ToInt16(j));
break;
case "GetTableX":
GetTableX(Convert.ToInt16(j));
break;
case "GetPlanTable":
GetPlanTable();
break;
default:
break;
}
}
public bool IsReusable
{
get
{
return false;
}
}
#region 注塑车间塑料粒子加料目视看板
void GetTable1()
{
string html = "<table id='TableTop'>";
List<Model> list = Function.GetData();
if (list.Count > 0)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 0; i <= 4; i++)
{
switch (j)
{
case 0:
if (i == 0)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 0)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 0)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 0)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 0)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 0)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
void GetTable2()
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
if (list.Count >= 5)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 5; i < 10; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 5)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 5)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 5)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
void GetTable3()
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
if (list.Count >= 10)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 10; i < 15; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 5)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 5)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 5)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
void GetTable4()
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
if (list.Count >= 10)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 15; i < 20; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 5)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 5)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 5)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
void GetTable5()
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
if (list.Count >= 15)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 20; i < 25; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 5)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 5)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 5)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
void GetTable6()
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
if (list.Count >= 26)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 25; i < 30; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Drum + "</td>";
}
break;
case 1:
if (i == 5)
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Station + "</td>";
}
break;
case 2:
if (i == 5)
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].ProductName + "</td>";
}
break;
case 3:
if (i == 5)
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].BatchNo + "</td>";
}
break;
case 5:
if (i == 5)
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (i % 2 == 0)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
break;
}
}
html += "</tr>";
}
}
html += "</table>";
Response.Write(html);
Response.End();
}
string GetTableX1(int k)
{
string html = "<table id='TableTop'>";
List<Model> list = Function.GetData();
int tmp = 0;
if (list.Count > 0)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 0; i <= 4; i++)
{
if (k < 20)
{
switch (j)
{
case 0:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Drum + "</td>";
}
break;
case 1:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Station + "</td>";
}
break;
case 2:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].ProductName + "</td>";
}
break;
case 3:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].MaterialName + "</td>";
}
break;
case 4:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].BatchNo + "</td>";
}
break;
case 5:
tmp = k + i;
if ((tmp == 0) || (tmp == 10) || (tmp == 20))
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Time1 + "</td>";
}
break;
}
}
}
html += "</tr>";
}
}
html += "</table>";
//Response.Write(html);
//Response.End();
return html;
}
string GetTableX2(int k)
{
string html = "<table id='TableBottom'>";
List<Model> list = Function.GetData();
int tmp = 0;
if (list.Count >= 5)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
for (int i = 5; i < 10; i++)
{
if(k<20)
{
switch (j)
{
case 0:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "烘干料筒" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Drum + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Drum + "</td>";
}
break;
case 1:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "注塑机号" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Station + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Station + "</td>";
}
break;
case 2:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "产品名称" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].ProductName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].ProductName + "</td>";
}
break;
case 3:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "原料名称" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].MaterialName + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].MaterialName + "</td>";
}
break;
case 4:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "加料批次" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].BatchNo + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].BatchNo + "</td>";
}
break;
case 5:
tmp = k + i;
if ((tmp == 5) || (tmp == 15))
{
html += "<td class='TableTitle'>" + "加料时间" + "</td>";
}
if (tmp % 2 == 0)
{
html += "<td class='tdWhite'>" + list[tmp].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[tmp].Time1 + "</td>";
}
break;
}
}
}
html += "</tr>";
}
}
html += "</table>";
//Response.Write(html);
//Response.End();
return html;
}
void GetTableX(int k)
{
string result1 = GetTableX1(k);
string result2 = GetTableX2(k);
//defaultX result = new defaultX();
//result.result1 = result1;
//result.result2 = result2;
//Response.Write(Tools.JSONTools.ScriptSerialize<defaultX>(result));
//Response.End();
Response.Write(result1 + ";" + result2);
Response.End();
}
#endregion
void GetPlanTable()
{
Response.Write(Function.GetPlanTable());
Response.End();
}
}
//public class defaultX
//{
// public string result1 { get; set; }
// public string result2 { get; set; }
//}