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.Collections.Generic;
public class Handler : IHttpHandler {
public class Handler : IHttpHandler
{
HttpRequest Request = null;
HttpResponse Response = null;
@ -14,7 +15,6 @@ public class Handler : IHttpHandler {
context.Response.ContentType = "text/plain";
Request = context.Request;
Response = context.Response;
string method = Request.Params["method"];
switch (method)
{
@ -111,6 +111,7 @@ public class Handler : IHttpHandler {
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 0)
@ -133,11 +134,87 @@ public class Handler : IHttpHandler {
}
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
{
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;
}
@ -157,6 +234,7 @@ public class Handler : IHttpHandler {
List<Model> list = Function.GetData();
if (list.Count >= 5)
{
for (int j = 0; j <= 5; j++)
{
html += "<tr>";
@ -219,6 +297,7 @@ public class Handler : IHttpHandler {
{
html += "<td class='tdGreen'>" + list[i].MaterialName + "</td>";
}
break;
case 4:
if (i == 5)
@ -241,11 +320,86 @@ public class Handler : IHttpHandler {
}
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
{
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;
}
@ -258,6 +412,8 @@ public class Handler : IHttpHandler {
Response.Write(html);
Response.End();
}
#endregion
void GetPlanTable()

12
PaintingScreen/Handler/Handler.ashx

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

Loading…
Cancel
Save