GetPackingDefectRemarks_WCF.ashx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <%@ WebHandler Language="C#" Class="GetDataDictionary_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 System.Data;
  8. using DK.XuWei.WebMes;
  9. /// <summary>
  10. /// 从WCF接口获取 数据字典
  11. /// </summary>
  12. public class GetDataDictionary_WCF : IHttpHandler, IReadOnlySessionState
  13. {
  14. public void ProcessRequest(HttpContext context)
  15. {
  16. using (IDataAccess conn = DataAccess.Create())
  17. {
  18. DataTable dt = null;
  19. dt = conn.ExecuteDatatable(@"
  20. SELECT distinct D.Remarks
  21. FROM TP_MST_DATADICTIONARY D
  22. WHERE VALUEFLAG = '1'
  23. AND D.DICTIONARYTYPE = @DICTIONARYTYPE@ ",
  24. new CDAParameter("DICTIONARYTYPE", "TPC019"));
  25. context.Response.Write(new JsonResult(dt).ToJson());
  26. }
  27. //context.Response.ContentType = "text/plain";
  28. //WCF wcf = new WCF();
  29. //wcf.Para = wcf.LoadParaBySession();
  30. //wcf.Para.Add(new JProperty("dicType", context.Request["type"]));
  31. //string jsonStr = wcf.Post("/DKService/PDAModuleService/GetDataDictionaryByType");
  32. //jsonStr = ("{'success':true,'message':'操作成功!','rows':" + jsonStr + "}").Replace("'","\"");
  33. //context.Response.Write(jsonStr);
  34. }
  35. public bool IsReusable
  36. {
  37. get
  38. {
  39. return false;
  40. }
  41. }
  42. }