ruoxing.wang 2 months ago
parent
commit
39207940ca
  1. 168
      AddMaterial/Handler.ashx
  2. 12
      PaintingScreen/Handler/Handler.ashx

168
AddMaterial/Handler.ashx

@ -4,7 +4,8 @@ using System;
using System.Web; using System.Web;
using System.Collections.Generic; using System.Collections.Generic;
public class Handler : IHttpHandler { public class Handler : IHttpHandler
{
HttpRequest Request = null; HttpRequest Request = null;
HttpResponse Response = null; HttpResponse Response = null;
@ -14,7 +15,6 @@ public class Handler : IHttpHandler {
context.Response.ContentType = "text/plain"; context.Response.ContentType = "text/plain";
Request = context.Request; Request = context.Request;
Response = context.Response; Response = context.Response;
string method = Request.Params["method"]; string method = Request.Params["method"];
switch (method) switch (method)
{ {
@ -111,6 +111,7 @@ public class Handler : IHttpHandler {
{ {
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>"; html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
} }
break; break;
case 4: case 4:
if (i == 0) if (i == 0)
@ -133,11 +134,87 @@ public class Handler : IHttpHandler {
} }
if (i % 2 == 0) if (i % 2 == 0)
{ {
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
if (string.IsNullOrEmpty(list[i].Time1))
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
if (list[i].Flag == "0")
{
if (Function.TimeDiff(Convert.ToDateTime(list[i].Time1), DateTime.Now) > 7200)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
//else
//{
// html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
//}
else
{
string lastMaterial = Function.GetLastMaterialCode(list[i].Drum);
string currentMaterial = list[i].PartNo;
if(lastMaterial!= currentMaterial)
{
html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
}
}
else
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
}
//html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
} }
else else
{ {
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>"; if (string.IsNullOrEmpty(list[i].Time1))
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
else
{
if (list[i].Flag == "0")
{
if (Function.TimeDiff(Convert.ToDateTime(list[i].Time1), DateTime.Now) > 7200)
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
//else
//{
// html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
//}
else
{
string lastMaterial = Function.GetLastMaterialCode(list[i].Drum);
string currentMaterial = list[i].PartNo;
if(lastMaterial!= currentMaterial)
{
html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
}
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
}
//html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
} }
break; break;
} }
@ -157,6 +234,7 @@ public class Handler : IHttpHandler {
List<Model> list = Function.GetData(); List<Model> list = Function.GetData();
if (list.Count >= 5) if (list.Count >= 5)
{ {
for (int j = 0; j <= 5; j++) for (int j = 0; j <= 5; j++)
{ {
html += "<tr>"; html += "<tr>";
@ -219,6 +297,7 @@ public class Handler : IHttpHandler {
{ {
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>"; html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
} }
break; break;
case 4: case 4:
if (i == 5) if (i == 5)
@ -241,11 +320,86 @@ public class Handler : IHttpHandler {
} }
if (i % 2 == 0) if (i % 2 == 0)
{ {
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>"; if (string.IsNullOrEmpty(list[i].Time1))
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
else
{
if (list[i].Flag == "0")
{
if (Function.TimeDiff(Convert.ToDateTime(list[i].Time1), DateTime.Now) > 7200)
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
//else
//{
// html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
//}
else
{
string lastMaterial = Function.GetLastMaterialCode(list[i].Drum);
string currentMaterial = list[i].PartNo;
if(lastMaterial!= currentMaterial)
{
html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
}
}
else
{
html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
}
}
//html += "<td class='tdWhite'>" + list[i].Time1 + "</td>";
} }
else else
{ {
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>"; if (string.IsNullOrEmpty(list[i].Time1))
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
else
{
if (list[i].Flag == "0")
{
if (Function.TimeDiff(Convert.ToDateTime(list[i].Time1), DateTime.Now) > 7200)
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
//else
//{
// html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
//}
else
{
string lastMaterial = Function.GetLastMaterialCode(list[i].Drum);
string currentMaterial = list[i].PartNo;
if(lastMaterial!= currentMaterial)
{
html += "<td class='tdRed'>" + list[i].Time1 + "</td>";
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
}
}
else
{
html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
}
}
//html += "<td class='tdGreen'>" + list[i].Time1 + "</td>";
} }
break; break;
} }
@ -258,6 +412,8 @@ public class Handler : IHttpHandler {
Response.Write(html); Response.Write(html);
Response.End(); Response.End();
} }
#endregion #endregion
void GetPlanTable() void GetPlanTable()

12
PaintingScreen/Handler/Handler.ashx

@ -19,10 +19,10 @@ public class Handler : IHttpHandler {
switch (method) switch (method)
{ {
case "GetTable1": case "GetTable1": //PaintingResultScreen1
GetTable1(); GetTable1();
break; break;
case "GetTableSum": case "GetTableSum": //PaintingResultScreen2 PaintingResultScreen1
GetTableSum(); GetTableSum();
break; break;
case "CreateTable": case "CreateTable":
@ -31,21 +31,21 @@ public class Handler : IHttpHandler {
case "CreateMiddleTable": case "CreateMiddleTable":
CreateMiddleTable(); CreateMiddleTable();
break; break;
case "GetMiddleTableData": case "GetMiddleTableData": //PaintingResultScreen2
string page = Request.Params["page"]; string page = Request.Params["page"];
GetMiddleTableData(page); GetMiddleTableData(page);
break; break;
case "CreateTablePaoGuang": case "CreateTablePaoGuang":
CreateTablePaoGuang(); CreateTablePaoGuang();
break; break;
case "GetTableSumPaoGuang": case "GetTableSumPaoGuang": //PaintingScreenPaoGuang
GetTableSumPaoGuang(); GetTableSumPaoGuang();
break; break;
case "GetMiddleTablePaoGuang": case "GetMiddleTablePaoGuang": //PaintingScreenPaoGuang
string pagePG = Request.Params["page"]; string pagePG = Request.Params["page"];
GetMiddleTablePaoGuang(pagePG); GetMiddleTablePaoGuang(pagePG);
break; break;
case "GetSumRateTable": case "GetSumRateTable"://PaintingScreenPaoGuang
GetSumRateTable(); GetSumRateTable();
break; break;
default: default:

Loading…
Cancel
Save