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