GetUserJobs.ashx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <%@ WebHandler Language="C#" Class="GetUserJobs" %>
  2. using System.Web;
  3. using System.Data;
  4. using System.Web.SessionState;
  5. using System.Web.Configuration;
  6. using Newtonsoft.Json.Linq;
  7. using Curtain.DataAccess;
  8. using Curtain.Log;
  9. using DK.XuWei.WebMes;
  10. /// <summary>
  11. /// 获取当前配置的工号工种
  12. /// </summary>
  13. public class GetUserJobs : IHttpHandler, IReadOnlySessionState
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. using (IDataAccess conn = DataAccess.Create())
  18. {
  19. DataTable dt = conn.ExecuteDatatable(@"
  20. SELECT
  21. J.JOBSID,
  22. J.JOBSNAME
  23. FROM
  24. TP_MST_USERJOBS UJ
  25. LEFT JOIN TP_MST_USER U ON U.USERID = UJ.USERID
  26. LEFT JOIN TP_MST_JOBS J ON UJ.JOBSID = J.JOBSID
  27. WHERE
  28. U.USERCODE = @USERCODE@
  29. ",
  30. new CDAParameter("USERCODE", context.Request["UserCode"])
  31. );
  32. context.Response.Write(new JsonResult(dt).ToJson());
  33. }
  34. }
  35. public bool IsReusable
  36. {
  37. get
  38. {
  39. return false;
  40. }
  41. }
  42. }