From 38244296b847f218f3fb43e60d6b9cba43dbb25e Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Mon, 20 Apr 2026 11:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84UpdateLawRegulationIdentify?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawRegulationIdentifyService.cs | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/SGGL/BLL/HSSE/InformationProject/LawRegulationIdentifyService.cs b/SGGL/BLL/HSSE/InformationProject/LawRegulationIdentifyService.cs index 3d504b0f..a6377eea 100644 --- a/SGGL/BLL/HSSE/InformationProject/LawRegulationIdentifyService.cs +++ b/SGGL/BLL/HSSE/InformationProject/LawRegulationIdentifyService.cs @@ -49,21 +49,23 @@ namespace BLL /// 法律法规辨识实体 public static void UpdateLawRegulationIdentify(Model.Law_LawRegulationIdentify lawRegulationIdentify) { - Model.SGGLDB db = Funs.DB; - Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId); - if (newLawRegulationIdentify != null) + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber; - newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId; - newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson; - newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate; - newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent; - newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude; - newLawRegulationIdentify.States = lawRegulationIdentify.States; - newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember; - newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark; - newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate; - db.SubmitChanges(); + Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId); + if (newLawRegulationIdentify != null) + { + newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber; + newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId; + newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson; + newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate; + newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent; + newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude; + newLawRegulationIdentify.States = lawRegulationIdentify.States; + newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember; + newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark; + newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate; + db.SubmitChanges(); + } } }