list.ashx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <%@ WebHandler Language="C#" Class="list" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using Curtain.DataAccess;
  8. using DK.XuWei.WebMes;
  9. public class list : IHttpHandler, IReadOnlySessionState
  10. {
  11. public void ProcessRequest(HttpContext context)
  12. {
  13. context.Response.ContentType = "text/plain";
  14. if (context.Request["m"] is object)
  15. {
  16. //不验证帐套 默认为1
  17. int accountId = (context.Session["accountId"] is object) ?
  18. Convert.ToInt32(context.Session["accountId"]) : 1;
  19. switch (context.Request["m"].ToString())
  20. {
  21. case "getMSTDictionary": // 获取数据字典
  22. {
  23. using (IDataAccess conn = DataAccess.Create())
  24. {
  25. DataTable dt = conn.ExecuteDatatable(@"
  26. SELECT DICTIONARYTYPE,
  27. DICTIONARYVALUE
  28. FROM tp_mst_datadictionary
  29. WHERE VALUEFLAG = '1'
  30. AND ACCOUNTID = 1
  31. AND DICTIONARYTYPE = @DICTIONARYTYPE@
  32. ORDER BY DISPLAYNO ",
  33. new CDAParameter("ACCOUNTID", accountId),
  34. new CDAParameter("DICTIONARYTYPE", context.Request["dictionarytype"])
  35. );
  36. context.Response.Write(dt.ToJson());
  37. }
  38. break;
  39. }
  40. default:
  41. {
  42. break;
  43. }
  44. }
  45. }
  46. //else
  47. //{
  48. // context.Response.Write(new JsonResult(JsonStatus.loginError).ToJson());
  49. //}
  50. }
  51. public bool IsReusable
  52. {
  53. get
  54. {
  55. return false;
  56. }
  57. }
  58. }