重构UpdateLawRegulationIdentify方法的数据库上下文

This commit is contained in:
李鹏飞 2026-04-20 11:44:21 +08:00
parent b7fb2e95bb
commit 38244296b8
1 changed files with 16 additions and 14 deletions

View File

@ -49,21 +49,23 @@ namespace BLL
/// <param name="lawRegulationIdentify">法律法规辨识实体</param>
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();
}
}
}