batchscrap_execute.ashx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <%@ WebHandler Language="C#" Class="batchscrap_execute" %>
  2. using System;
  3. using System.Web;
  4. using System.Web.SessionState;
  5. using System.Collections.Generic;
  6. using System.Collections.Specialized;
  7. using System.Data;
  8. using Curtain.DataAccess;
  9. using DK.XuWei.WebMes;
  10. /// <summary>
  11. /// TP_PM_BATCHSCRAPLOG 批量报损
  12. /// xuwei create 2024-05-10
  13. /// </summary>
  14. public class batchscrap_execute : IHttpHandler, IReadOnlySessionState
  15. {
  16. public void ProcessRequest(HttpContext context)
  17. {
  18. context.Response.ContentType = "text/plain";
  19. if (mes.LoginCheck() && context.Request["m"] is object)
  20. {
  21. Button b = new Button();
  22. if(mes.RightCheck(""))
  23. {
  24. b.btnBatchScrap = true;
  25. };
  26. switch (context.Request["m"].ToString().ToLower())
  27. {
  28. case "a":
  29. {
  30. //添加
  31. if (b.btnBatchScrap)
  32. {
  33. }
  34. else
  35. {
  36. }
  37. break;
  38. }
  39. case "i":
  40. {
  41. //插入
  42. if (b.btnBatchScrap)
  43. context.Response.Write(insert(context.Request.Form));
  44. else
  45. context.Response.Write(new JsonResult(JsonStatus.rightError).ToJson());
  46. break;
  47. }
  48. default:
  49. {
  50. break;
  51. }
  52. }
  53. }
  54. else
  55. {
  56. context.Response.Write(new JsonResult(JsonStatus.loginError).ToJson());
  57. }
  58. }
  59. private string insert(NameValueCollection form)
  60. {
  61. using(IDataAccess conn= DataAccess.Create())
  62. {
  63. //报损处理
  64. //写入日志
  65. //int result = conn.ExecuteNonQuery(@"
  66. // INSERT INTO TP_PM_BATCHSCRAPLOG (
  67. // --GUID,
  68. // BARCODE,
  69. // SUCCESS,
  70. // REMARKS,
  71. // ACCOUNTID,CREATEUSERID,UPDATEUSERID
  72. // ) VALUES (
  73. // --@GUID@,
  74. // @BARCODE@,
  75. // @SUCCESS@,
  76. // @REMARKS@,
  77. // @ACCOUNTID@,@CREATEUSERID@,@UPDATEUSERID@
  78. // )
  79. // ",
  80. // new CDAParameter("BARCODE",form["BARCODE"]),
  81. // new CDAParameter("SUCCESS",form["SUCCESS"]),
  82. // new CDAParameter("REMARKS",form["REMARKS"]),
  83. // new CDAParameter("ACCOUNTID",HttpContext.Current.Session["accountId"]),
  84. // new CDAParameter("CREATEUSERID",HttpContext.Current.Session["userId"]),
  85. // new CDAParameter("UPDATEUSERID",HttpContext.Current.Session["userId"])
  86. //);
  87. }
  88. return new JsonResult(JsonStatus.error) { message="此功能还在开发中。。。"}.ToJson();
  89. }
  90. private class Button
  91. {
  92. public bool btnBatchScrap = false;
  93. }
  94. public bool IsReusable
  95. {
  96. get
  97. {
  98. return false;
  99. }
  100. }
  101. }