From 5f53f2b4cff3c09365d23a7ee28732aafc0a0a1a Mon Sep 17 00:00:00 2001 From: 沈泽 <211959439@qq.com> Date: 星期二, 14 九月 2021 08:21:21 +0800 Subject: [PATCH] 1 --- WebAPI/Controllers/Sc_MouldOtherInBillController.cs | 69 +++++++++++++++++++++++++++++----- 1 files changed, 58 insertions(+), 11 deletions(-) diff --git a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs index 9e51174..1d96c12 100644 --- a/WebAPI/Controllers/Sc_MouldOtherInBillController.cs +++ b/WebAPI/Controllers/Sc_MouldOtherInBillController.cs @@ -13,7 +13,7 @@ public class Sc_MouldOtherInBillController : ApiController { private json objJsonResult = new json(); - public DataSet ds = new DataSet(); + DataSet ds; public WebServer webserver = new WebServer(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); @@ -23,22 +23,31 @@ /// <returns></returns> /// <summary> - /// 妯″叿鍏朵粬鍏ュ簱鍗曞垪琛� + /// 杩斿洖妯″叿鍏朵粬鍏ュ簱鍗曞垪琛� + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� /// </summary> - /// <returns></returns> [Route("Sc_MouldOtherInBill/GetMouldOtherInBillList")] [HttpGet] - public object GetMouldOtherInBillList(string sWhere) + public object list(string sWhere) { try { - - ds = Sc_MouldOtherInBillList_s(sWhere); - if (ds == null || ds.Tables[0].Rows.Count <= 0) + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from Sc_MouldStockBillMain " + sWhere, "Sc_MouldStockBillMain"); + } + else + { + string sql1 = "select * from Sc_MouldStockBillMain where 1 = 1 "; + string sql = sql1 + sWhere; + ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain"); + } + if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + objJsonResult.Message = "false锛�"; objJsonResult.data = null; return objJsonResult; } @@ -46,20 +55,58 @@ { objJsonResult.code = "1"; objJsonResult.count = 1; - objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + objJsonResult.Message = "Sucess锛�"; objJsonResult.data = ds.Tables[0]; return objJsonResult; } } - catch (Exception ex) + catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + objJsonResult.Message = "Exception锛�" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } + ///// <summary> + ///// 妯″叿鍏朵粬鍏ュ簱鍗曞垪琛� + ///// </summary> + ///// <returns></returns> + //[Route("Sc_MouldOtherInBill/GetMouldOtherInBillList")] + //[HttpGet] + //public object GetMouldOtherInBillList(string sWhere) + //{ + // try + // { + + // ds = Sc_MouldOtherInBillList_s(sWhere); + // if (ds == null || ds.Tables[0].Rows.Count <= 0) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�"; + // objJsonResult.data = null; + // return objJsonResult; + // } + // else + // { + // objJsonResult.code = "1"; + // objJsonResult.count = 1; + // objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; + // objJsonResult.data = ds.Tables[0]; + // return objJsonResult; + // } + // } + // catch (Exception ex) + // { + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString(); + // objJsonResult.data = null; + // return objJsonResult; + // } + //} #region sql璇彞 -- Gitblit v1.9.1