You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.3 KiB
74 lines
2.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Web;
|
|
using DBUtility;
|
|
using Tools;
|
|
|
|
namespace PaintingScreen.Handler
|
|
{
|
|
/// <summary>
|
|
/// Plan247 的摘要说明
|
|
/// </summary>
|
|
public class Plan247 : 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 "GetTableContent":
|
|
GetTableContent();
|
|
break;
|
|
}
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
void GetTableContent()
|
|
{
|
|
Response.Write(JSONTools.DataTableToJson("result", GetTable()));
|
|
Response.End();
|
|
}
|
|
|
|
private static DataTable GetTable()
|
|
{
|
|
DataTable res = new DataTable();
|
|
try
|
|
{
|
|
string time = DateTime.Now.ToString("yyyyMMdd");
|
|
string sql = @"SELECT dbo.tb_Plan_247.OrderNo, dbo.tb_Plan_247.Item, dbo.tb_Plan_247.PartNo, dbo.tb_Mistake_247.PartName2,
|
|
dbo.tb_Plan_247.OrderCount, dbo.tb_Plan_247.CompleteCount
|
|
FROM dbo.tb_Plan_247 LEFT OUTER JOIN
|
|
dbo.tb_Mistake_247 ON dbo.tb_Plan_247.PartNo = dbo.tb_Mistake_247.PartNo2 where OrderNo like '"+time+"%' and IsFinish=0 order by Item";
|
|
|
|
SqlParameter[] param=new SqlParameter[1];
|
|
param[0] = new SqlParameter("@OrderNo", SqlDbType.VarChar);
|
|
param[0].Value = time;
|
|
|
|
res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql,null);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.WriteLogManager(ex);
|
|
LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name);
|
|
}
|
|
return res;
|
|
}
|
|
}
|
|
}
|