| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <%@ WebHandler Language="C#" Class="getSecurityCode" %>
- using System;
- using System.Web;
- using Curtain.DataAccess;
- using System.Data;
- using DK.XuWei.WebMes;
- using Newtonsoft.Json.Linq;
- public class getSecurityCode : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- if (context.Request["barcode"] is object)
- {
- //读取参数
- string barCode = context.Request["barcode"].ToString();
- using (IDataAccess conn = DataAccess.Create())
- {
- //读取防伪码
- DataTable dt = conn.ExecuteDatatable(@"
- SELECT
- '11111111111' AS 条码,
- '22222222222' AS 防伪码,
- '2021-08-02 09:00' AS 绑定时间,
- 'DONGKEXW' AS 绑定工号
- FROM
- DUAL
- ",
- new CDAParameter("BARCODE", "")
- );
- context.Response.Write(new JsonResult(dt.Rows[0]).ToJson());
- }
- }
- else
- {
- context.Response.Write(new JsonResult(JsonStatus.error) { message = "条码不能为空值!" }.ToJson());
- }
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
|