<%@ 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 = ""; 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(); } void GetTable3() { string html = ""; List list = Function.GetData(); if (list.Count >= 10) { for (int j = 0; j <= 5; j++) { html += ""; for (int i = 10; i < 15; 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(); } void GetTable4() { string html = ""; List list = Function.GetData(); if (list.Count >= 10) { for (int j = 0; j <= 5; j++) { html += ""; for (int i = 15; i < 20; 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(); } void GetTable5() { string html = ""; List list = Function.GetData(); if (list.Count >= 15) { for (int j = 0; j <= 5; j++) { html += ""; for (int i = 20; i < 25; 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(); } void GetTable6() { string html = ""; List list = Function.GetData(); if (list.Count >= 26) { for (int j = 0; j <= 5; j++) { html += ""; for (int i = 25; i < 30; 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(); } string GetTableX1(int k) { string html = ""; List list = Function.GetData(); int tmp = 0; if (list.Count > 0) { for (int j = 0; j <= 5; j++) { html += ""; 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 += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 1: tmp = k + i; if ((tmp == 0) || (tmp == 10) || (tmp == 20)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 2: tmp = k + i; if ((tmp == 0) || (tmp == 10) || (tmp == 20)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 3: tmp = k + i; if ((tmp == 0) || (tmp == 10) || (tmp == 20)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 4: tmp = k + i; if ((tmp == 0) || (tmp == 10) || (tmp == 20)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 5: tmp = k + i; if ((tmp == 0) || (tmp == 10) || (tmp == 20)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; } } } html += ""; } } html += "
" + "烘干料筒" + "" + list[tmp].Drum + "" + list[tmp].Drum + "" + "注塑机号" + "" + list[tmp].Station + "" + list[tmp].Station + "" + "产品名称" + "" + list[tmp].ProductName + "" + list[tmp].ProductName + "" + "原料名称" + "" + list[tmp].MaterialName + "" + list[tmp].MaterialName + "" + "加料批次" + "" + list[tmp].BatchNo + "" + list[tmp].BatchNo + "" + "加料时间" + "" + list[tmp].Time1 + "" + list[tmp].Time1 + "
"; //Response.Write(html); //Response.End(); return html; } string GetTableX2(int k) { string html = ""; List list = Function.GetData(); int tmp = 0; if (list.Count >= 5) { for (int j = 0; j <= 5; j++) { html += ""; for (int i = 5; i < 10; i++) { if(k<20) { switch (j) { case 0: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 1: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 2: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 3: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 4: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; case 5: tmp = k + i; if ((tmp == 5) || (tmp == 15)) { html += ""; } if (tmp % 2 == 0) { html += ""; } else { html += ""; } break; } } } html += ""; } } html += "
" + "烘干料筒" + "" + list[tmp].Drum + "" + list[tmp].Drum + "" + "注塑机号" + "" + list[tmp].Station + "" + list[tmp].Station + "" + "产品名称" + "" + list[tmp].ProductName + "" + list[tmp].ProductName + "" + "原料名称" + "" + list[tmp].MaterialName + "" + list[tmp].MaterialName + "" + "加料批次" + "" + list[tmp].BatchNo + "" + list[tmp].BatchNo + "" + "加料时间" + "" + list[tmp].Time1 + "" + list[tmp].Time1 + "
"; //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(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; } //}