注塑喷涂
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.

268 lines
9.7 KiB

4 months ago
<%@ 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"];
switch (method)
{
case "GetTable1":
GetTable1();
break;
case "GetTable2":
GetTable2();
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();
}
#endregion
void GetPlanTable()
{
Response.Write(Function.GetPlanTable());
Response.End();
}
}