From acdbefae8e00a3d32b17fd23c95ad31c73d9566f Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期二, 07 六月 2022 09:57:39 +0800 Subject: [PATCH] nothing --- WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs | 90 +++++++++++++++++++++++++++++---------------- 1 files changed, 58 insertions(+), 32 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs b/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs index fde83d0..5212abd 100644 --- a/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs +++ b/WebAPI/Controllers/SBGL/Gy_EquipTypeController.cs @@ -17,34 +17,44 @@ private json objJsonResult = new json(); public DataSet ds = new DataSet(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); - public DLL.ClsGy_EquipTypeBill BillNew0 = new DLL.ClsGy_EquipTypeBill(); //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫� - public DLL.ClsGy_EquipTypeBill BillOld0 = new DLL.ClsGy_EquipTypeBill(); //妯″叿鎶ュ簾鍏ュ簱瀵瑰簲鍗曟嵁绫� + public DLL.ClsGy_EquipTypeBill BillNew0 = new DLL.ClsGy_EquipTypeBill(); + public DLL.ClsGy_EquipTypeBill BillOld0 = new DLL.ClsGy_EquipTypeBill(); #region 璁惧鍒嗙被鍒楄〃 [Route("Gy_EquipType/GetList")] [HttpGet] - public object GetList(string sWhere) + public object GetList(string sWhere,string user) { try { - ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere, "Gy_EquipFileType"); - if (ds == null) + if (!DBUtility.ClsPub.Security_Log("Gy_EquipTypeList", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�"; + objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒"; objJsonResult.data = null; return objJsonResult; } - else - { - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�"; - objJsonResult.data = ds.Tables[0]; - return objJsonResult; - } + + ds = oCN.RunProcReturn("select HItemID,HParentID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_EquipFileType where 1=1 " + sWhere+ " order by HItemID ", "Gy_EquipFileType"); + + //if (ds.Tables[0].Rows.Count != 0 || ds != null) + //{ + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + //} + //else + //{ + //objJsonResult.code = "0"; + //objJsonResult.count = 0; + //objJsonResult.Message = "鏃犳暟鎹�"; + //objJsonResult.data = null; + //return objJsonResult; + //} } catch (Exception ex) { @@ -61,8 +71,17 @@ #region [璁惧鍒嗙被鍒犻櫎鍔熻兘] [Route("Gy_EquipType/Delete_EquipType")] [HttpGet] - public object Delete_EquipType(string HItemID) + public object Delete_EquipType(string HItemID,string user) { + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Delete", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } + string s = ""; Int64 lngBillKey = 0; lngBillKey = DBUtility.ClsPub.isLong(HItemID); @@ -77,23 +96,12 @@ DLL.ClsGy_EquipTypeBill oBill = new DLL.ClsGy_EquipTypeBill(); if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) { - bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo); - if (IsDete) - { - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } - else - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; - objJsonResult.data = null; - return objJsonResult; - } + oCN.RunProc("Delete From Gy_EquipFileType where HItemID=" + lngBillKey); + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "鍒犻櫎鎴愬姛"; + objJsonResult.data = null; + return objJsonResult; } else { @@ -123,7 +131,16 @@ string msg1 = _value.ToString(); string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); + string msg4 = sArray[2].ToString(); + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } //鍙嶅簭鍒楀寲 msg2 = "[" + msg2.ToString() + "]"; @@ -199,7 +216,16 @@ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg2 = sArray[0].ToString(); string msg3 = sArray[1].ToString(); + string msg4 = sArray[2].ToString(); + if (!DBUtility.ClsPub.Security_Log("Gy_EquipType_Edit", 1, false, msg4)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒"; + objJsonResult.data = null; + return objJsonResult; + } //鍙嶅簭鍒楀寲 msg2 = "[" + msg2.ToString() + "]"; List<Models.ClsGy_EquipFileType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_EquipFileType>>(msg2); -- Gitblit v1.9.1