GetCompleteProcedureIDPDA_WCF.ashx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <%@ WebHandler Language="C#" Class="GetCompleteProcedureIDPDA_WCF" %>
  2. using System.Web;
  3. using System.Web.SessionState;
  4. using System.Web.Configuration;
  5. using Newtonsoft.Json.Linq;
  6. using Curtain.DataAccess;
  7. using Curtain.Log;
  8. using DK.XuWei.WebMes;
  9. /// <summary>
  10. /// 从WCF接口获取 产品信息
  11. /// xuwei 2019-10-26
  12. /// </summary>
  13. public class GetCompleteProcedureIDPDA_WCF : IHttpHandler, IReadOnlySessionState
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. context.Response.ContentType = "text/plain";
  18. if(context.Request["barcode"].ToString()!="")
  19. {
  20. WCF wcf = new WCF();
  21. wcf.Para = wcf.LoadParaBySession();
  22. wcf.Para.Add(new JProperty("barcode", context.Request["barcode"]));
  23. string jsonStr = wcf.Post("/DKService/PDAModuleService/GetCompleteProcedureIDPDA");
  24. jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
  25. context.Response.Write(jsonStr);
  26. }
  27. else
  28. {
  29. string jsonStr = "";
  30. jsonStr = ("{'success':false,'message':'请指定barcode!','rows':''}").Replace("'","\"");
  31. context.Response.Write(jsonStr);
  32. }
  33. }
  34. public bool IsReusable
  35. {
  36. get
  37. {
  38. return false;
  39. }
  40. }
  41. }