Get_Report_RptProcedure.ashx 1.3 KB

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