From f1e01b3972fe8dbe3e823c519bf1317d1c524a02 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期三, 28 二月 2024 16:31:25 +0800 Subject: [PATCH] (已完成-普通)删除客户时,若客户存在关联的销售订单、销售出库单、生产订单,报错修改。 --- WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs index 940142c..8f4ae94 100644 --- a/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs +++ b/WebAPI/Controllers/BaseSet/Xt_grdAlignment_WMESController.cs @@ -38,7 +38,7 @@ objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucess锛�"; - objJsonResult.data = null; + objJsonResult.data = ds.Tables[0]; return objJsonResult; } } @@ -204,11 +204,11 @@ #region 鎸夐挳璁剧疆 鍒楄〃 [Route("Xt_ModuleButtonSet_WMES/moduleButtonSetWMESList")] [HttpGet] - public object moduleButtonSetWMESList(string HModName, string HBillType) + public object moduleButtonSetWMESList(string HModName, string HBillType, string HUserName) { try { - ds = oCN.RunProcReturn("select * from Xt_ModuleButtonSet where HModuleName='" + HModName + "' and HBillType='" + HBillType + "'", "Xt_ModuleButtonSet"); + ds = oCN.RunProcReturn("select * from Xt_ModuleButtonSet where HModuleName='" + HModName + "' and HBillType='" + HBillType + "' and HUserName='" + HUserName + "'", "Xt_ModuleButtonSet"); objJsonResult.code = "1"; objJsonResult.count = ds.Tables[0].Rows.Count; @@ -281,6 +281,7 @@ string HModuleName = sArray[4].ToString(); string HBillType = sArray[5].ToString(); string NoEditList = sArray[6].ToString(); + string HUserName = sArray[7].ToString(); try { @@ -291,7 +292,7 @@ List<noEditList> noEditLists= Newtonsoft.Json.JsonConvert.DeserializeObject<List<noEditList>>(NoEditList); //鎻掑叆鍙紪杈戞寜閽殑淇℃伅璁板綍 - oCN.RunProc("delete from Xt_ModuleButtonSet where HModuleName= '" + HModuleName + "' and HBillType='" + HBillType + "'"); + oCN.RunProc("delete from Xt_ModuleButtonSet where HModuleName= '" + HModuleName + "' and HBillType='" + HBillType + "' and HUserName= '" + HUserName + "'"); for (int i = 0; i < button.Count; i++) { for(int j = 0; j < HButtonIDLists.Count; j++) @@ -307,7 +308,12 @@ { HHideFlag = 1; } - string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag; + if(button[i].BtnID== "HideButton") //鐢ㄦ埛杩涜绗竴娆¤缃椂锛岃缃� 鎸夐挳璁剧疆 鎸夐挳涓轰笉鍙紪杈戜笖涓嶉殣钘� + { + HEditFlag = 0; + HHideFlag = 0; + } + string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag + ",'" + HUserName + "'"; oCN.RunProc(sql); } } @@ -325,7 +331,7 @@ string HButtonID = noEditLists[i].HButtonID; string HButtonName = noEditLists[i].HButtonName; int HOrder = HOrderLists[j]; - string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag; + string sql = "exec h_p_Xt_ModuleButtonSet '" + HBillType + "','" + HModuleName + "','" + HButtonID + "','" + HButtonName + "'," + HOrder + "," + HHideFlag + "," + HEditFlag + ",'" + HUserName + "'"; oCN.RunProc(sql); } } -- Gitblit v1.9.1