| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <%@ WebHandler Language="C#" Class="batchscrap_execute" %>
- using System;
- using System.Web;
- using System.Web.SessionState;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Data;
- using Curtain.DataAccess;
- using DK.XuWei.WebMes;
- /// <summary>
- /// TP_PM_BATCHSCRAPLOG 批量报损
- /// xuwei create 2024-05-10
- /// </summary>
- public class batchscrap_execute : IHttpHandler, IReadOnlySessionState
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- if (mes.LoginCheck() && context.Request["m"] is object)
- {
- Button b = new Button();
- if(mes.RightCheck(""))
- {
- b.btnBatchScrap = true;
- };
- switch (context.Request["m"].ToString().ToLower())
- {
- case "a":
- {
- //添加
- if (b.btnBatchScrap)
- {
- }
- else
- {
- }
- break;
- }
- case "i":
- {
- //插入
- if (b.btnBatchScrap)
- context.Response.Write(insert(context.Request.Form));
- else
- context.Response.Write(new JsonResult(JsonStatus.rightError).ToJson());
- break;
- }
- default:
- {
- break;
- }
- }
- }
- else
- {
- context.Response.Write(new JsonResult(JsonStatus.loginError).ToJson());
- }
- }
- private string insert(NameValueCollection form)
- {
- using(IDataAccess conn= DataAccess.Create())
- {
- //报损处理
- //写入日志
- //int result = conn.ExecuteNonQuery(@"
- // INSERT INTO TP_PM_BATCHSCRAPLOG (
- // --GUID,
- // BARCODE,
- // SUCCESS,
- // REMARKS,
- // ACCOUNTID,CREATEUSERID,UPDATEUSERID
- // ) VALUES (
- // --@GUID@,
- // @BARCODE@,
- // @SUCCESS@,
- // @REMARKS@,
- // @ACCOUNTID@,@CREATEUSERID@,@UPDATEUSERID@
- // )
- // ",
- // new CDAParameter("BARCODE",form["BARCODE"]),
- // new CDAParameter("SUCCESS",form["SUCCESS"]),
- // new CDAParameter("REMARKS",form["REMARKS"]),
- // new CDAParameter("ACCOUNTID",HttpContext.Current.Session["accountId"]),
- // new CDAParameter("CREATEUSERID",HttpContext.Current.Session["userId"]),
- // new CDAParameter("UPDATEUSERID",HttpContext.Current.Session["userId"])
- //);
- }
- return new JsonResult(JsonStatus.error) { message="此功能还在开发中。。。"}.ToJson();
- }
- private class Button
- {
- public bool btnBatchScrap = false;
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
|