%@ 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 = "
";
List list = Function.GetData();
if (list.Count > 0)
{
for (int j = 0; j <= 5; j++)
{
html += "";
for (int i = 0; i <= 4; i++)
{
switch (j)
{
case 0:
if (i == 0)
{
html += "" + "烘干料筒" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Drum + " | ";
}
else
{
html += "" + list[i].Drum + " | ";
}
break;
case 1:
if (i == 0)
{
html += "" + "注塑机号" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Station + " | ";
}
else
{
html += "" + list[i].Station + " | ";
}
break;
case 2:
if (i == 0)
{
html += "" + "产品名称" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].ProductName + " | ";
}
else
{
html += "" + list[i].ProductName + " | ";
}
break;
case 3:
if (i == 0)
{
html += "" + "原料名称" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].MaterialName + " | ";
}
else
{
html += "" + list[i].MaterialName + " | ";
}
break;
case 4:
if (i == 0)
{
html += "" + "加料批次" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].BatchNo + " | ";
}
else
{
html += "" + list[i].BatchNo + " | ";
}
break;
case 5:
if (i == 0)
{
html += "" + "加料时间" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Time1 + " | ";
}
else
{
html += "" + list[i].Time1 + " | ";
}
break;
}
}
html += "
";
}
}
html += "
";
Response.Write(html);
Response.End();
}
void GetTable2()
{
string html = "";
List list = Function.GetData();
if (list.Count >= 5)
{
for (int j = 0; j <= 5; j++)
{
html += "";
for (int i = 5; i < 10; i++)
{
switch (j)
{
case 0:
if (i == 5)
{
html += "" + "烘干料筒" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Drum + " | ";
}
else
{
html += "" + list[i].Drum + " | ";
}
break;
case 1:
if (i == 5)
{
html += "" + "注塑机号" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Station + " | ";
}
else
{
html += "" + list[i].Station + " | ";
}
break;
case 2:
if (i == 5)
{
html += "" + "产品名称" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].ProductName + " | ";
}
else
{
html += "" + list[i].ProductName + " | ";
}
break;
case 3:
if (i == 5)
{
html += "" + "原料名称" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].MaterialName + " | ";
}
else
{
html += "" + list[i].MaterialName + " | ";
}
break;
case 4:
if (i == 5)
{
html += "" + "加料批次" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].BatchNo + " | ";
}
else
{
html += "" + list[i].BatchNo + " | ";
}
break;
case 5:
if (i == 5)
{
html += "" + "加料时间" + " | ";
}
if (i % 2 == 0)
{
html += "" + list[i].Time1 + " | ";
}
else
{
html += "" + list[i].Time1 + " | ";
}
break;
}
}
html += "
";
}
}
html += "
";
Response.Write(html);
Response.End();
}
#endregion
void GetPlanTable()
{
Response.Write(Function.GetPlanTable());
Response.End();
}
}