From 4441719f8b9dba3bb533c6b4c43627d1443dc171 Mon Sep 17 00:00:00 2001 From: 王 垚 <1402714037@qq.com> Date: 星期一, 21 十一月 2022 10:32:16 +0800 Subject: [PATCH] 工作日设置 --- WebAPI/Controllers/ReportPlatFormController.cs | 41 ++++++++++++++++++++++------------------- 1 files changed, 22 insertions(+), 19 deletions(-) diff --git a/WebAPI/Controllers/ReportPlatFormController.cs b/WebAPI/Controllers/ReportPlatFormController.cs index bfc89cd..8a91897 100644 --- a/WebAPI/Controllers/ReportPlatFormController.cs +++ b/WebAPI/Controllers/ReportPlatFormController.cs @@ -70,28 +70,31 @@ try { - //ds = oCN.RunProcReturn("select * from Gy_SourceRelationSet where HSourceID='" + HSourceID + "'", "Gy_SourceRelationSet"); - //if (ds.Tables[0].Rows.Count > 0) - //{ - - // objJsonResult.code = "0"; - // objJsonResult.count = 0; - // objJsonResult.Message = "鐢熶骇璧勬簮宸插瓨鍦紒"; - // objJsonResult.data = null; - // return objJsonResult; - //} - oCN.BeginTran(); - //鍐欏叆浜х嚎缁戝畾 - string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag,HCheckManID) + ds = oCN.RunProcReturn("select * from Gy_SourceRelationSet where HSourceID='" + HSourceID + "' and HUserName='" + HUserName + "'", "Gy_SourceRelationSet"); + + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "褰撳墠浜哄憳鍒涘缓姝ょ敓浜ц祫婧�,涓嶅厑璁搁噸澶嶅垱寤猴紒"; + objJsonResult.data = null; + + } + else + { + oCN.BeginTran(); + //鍐欏叆浜х嚎缁戝畾 + string sql = string.Format(@"insert into Gy_SourceRelationSet (HSourceID,HUserName,HGroupID,HManagerID,HRemark,HCreateDate,HCreator,HNowFlag,HCheckManID) values('" + HSourceID + "','" + HUserName + "','" + HGroupID + "','" + HManagerID + "','" + HRemark + "','" + DateTime.Parse(HCreateDate).ToShortDateString() + "','" + HUserName + "','0','')"); - oCN.RunProc(sql); - oCN.Commit(); + oCN.RunProc(sql); + oCN.Commit(); - objJsonResult.code = "1"; - objJsonResult.count = 1; - objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; - objJsonResult.data = null; + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + objJsonResult.data = null; + } } catch (Exception e) { -- Gitblit v1.9.1