Get_Report_Kiln.ashx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 
  2. <%@ WebHandler Language="C#" Class="Get_Report_Kiln" %>
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Web;
  6. using System.Web.SessionState;
  7. using System.Configuration;
  8. using System.Data;
  9. using Newtonsoft.Json;
  10. using Curtain.DataAccess;
  11. using Curtain.Log;
  12. using DK.XuWei.WebMes;
  13. public class Get_Report_Kiln : IHttpHandler,IRequiresSessionState
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. if (HttpContext.Current.Session["userCode"] is object)
  18. {
  19. using (IDataAccess conn = DataAccess.Create())
  20. {
  21. //统计语句
  22. string sqlStr = @"
  23. SELECT
  24. KILNCODE,
  25. KILNNAME
  26. FROM
  27. TP_MST_KILN
  28. WHERE
  29. ACCOUNTID = 1
  30. AND VALUEFLAG = '1'
  31. ORDER BY
  32. KILNCODE DESC
  33. ";
  34. DataTable dt = conn.ExecuteDatatable(sqlStr);
  35. //输出结果
  36. context.Response.Write(new JsonResult(dt).ToJson());
  37. }
  38. }
  39. else
  40. {
  41. context.Response.Write(new JsonResult(-1).ToJson());
  42. }
  43. }
  44. public bool IsReusable
  45. {
  46. get
  47. {
  48. return false;
  49. }
  50. }
  51. }