getUser.ashx 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <%@ WebHandler Language="C#" Class="getUser" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Data;
  6. using System.Text;
  7. using System.Collections;
  8. using System.Collections.Generic;
  9. using Newtonsoft.Json;
  10. using Newtonsoft.Json.Linq;
  11. using Curtain.DataAccess;
  12. using DK.XuWei.WebMes;
  13. public class getUser : IHttpHandler, IReadOnlySessionState
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. context.Response.ContentType = "text/plain";
  18. using(IDataAccess conn = DataAccess.Create())
  19. {
  20. DataTable dt = conn.ExecuteDatatable(@"
  21. SELECT
  22. m.USERID,
  23. m.USERCODE
  24. FROM
  25. TP_MST_USER m
  26. WHERE
  27. m.VALUEFLAG = '1'
  28. ");
  29. context.Response.Write(dt.ToJson());
  30. }
  31. }
  32. public bool IsReusable
  33. {
  34. get
  35. {
  36. return false;
  37. }
  38. }
  39. }