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(); + } } }