From 8658c02633f9746781d2e6f5da9998eef8c0e0a7 Mon Sep 17 00:00:00 2001 From: yusijie <ysj@hz-kingdee.com> Date: 星期五, 28 十月 2022 16:31:52 +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 072aca9..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