getWorkstation.ashx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <%@ WebHandler Language="C#" Class="getWorkstation" %>
  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 getWorkstation : 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. WORKSTATIONID AS ID,
  23. WORKSTATIONNAME AS NAME
  24. FROM
  25. TP_MST_WORKSTATION
  26. WHERE
  27. VALUEFLAG = '1'
  28. ORDER BY
  29. DISPLAYNO
  30. ");
  31. context.Response.Write(dt.ToJson());
  32. }
  33. }
  34. public bool IsReusable
  35. {
  36. get
  37. {
  38. return false;
  39. }
  40. }
  41. }