| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <%@ WebHandler Language="C#" Class="GetProductionData_WCF" %>
- using System.Web;
- using System.Web.SessionState;
- using System.Web.Configuration;
- using Newtonsoft.Json.Linq;
- using Curtain.DataAccess;
- using Curtain.Log;
- using DK.XuWei.WebMes;
- /// <summary>
- /// 从WCF接口获取 产品信息
- /// xuwei 2019-10-26
- /// </summary>
- public class GetProductionData_WCF : IHttpHandler, IReadOnlySessionState
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- if(context.Request["BarCode"].ToString()!="")
- {
- WCF wcf = new WCF();
- wcf.Para = wcf.LoadParaBySession();
- wcf.Para.Add(new JProperty("BarCode", context.Request["BarCode"]));
- wcf.Para.Add(new JProperty("ProcedureID", context.Request["ProcedureID"]));
- //wcf.Para.Add(new JProperty("userCode", context.Request["userCode"]));
- string jsonStr = wcf.Post("/DKService/PDAModuleService/GetProductionData");
- //2020-04-20 冷补后 jsonStr = "" 找不到 productiondataid
- if (jsonStr == "") jsonStr = "\"\"";
- jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
- context.Response.Write(jsonStr);
- }
- else
- {
- string jsonStr = "";
- jsonStr = ("{'success':false,'message':'请指定BarCode、ProcedureID、userCode!','rows':''}").Replace("'","\"");
- context.Response.Write(jsonStr);
- }
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
|