using System.Linq; namespace BLL { /// /// 国内法律法规相关条款 /// public static class FileControl_DomesticLawsRegulationsService { /// /// 根据主键获取国内法律法规相关条款 /// /// /// public static Model.FileControl_DomesticLawsRegulations GetDomesticLawsRegulationsById(string domesticLawsRegulationsId) { return Funs.DB.FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulationsId); } /// /// 添加国内法律法规相关条款 /// /// public static void AddDomesticLawsRegulations(Model.FileControl_DomesticLawsRegulations domesticLawsRegulations) { Model.HJGLDB db = Funs.DB; Model.FileControl_DomesticLawsRegulations newDomesticLawsRegulations = new Model.FileControl_DomesticLawsRegulations(); newDomesticLawsRegulations.DomesticLawsRegulationsId = domesticLawsRegulations.DomesticLawsRegulationsId; newDomesticLawsRegulations.DomesticLawsRegulationsCode = domesticLawsRegulations.DomesticLawsRegulationsCode; newDomesticLawsRegulations.DomesticLawsRegulationsName = domesticLawsRegulations.DomesticLawsRegulationsName; newDomesticLawsRegulations.Abstract = domesticLawsRegulations.Abstract; newDomesticLawsRegulations.CompileMan = domesticLawsRegulations.CompileMan; newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate; newDomesticLawsRegulations.Remarks = domesticLawsRegulations.Remarks; newDomesticLawsRegulations.AttachUrl = domesticLawsRegulations.AttachUrl; db.FileControl_DomesticLawsRegulations.InsertOnSubmit(newDomesticLawsRegulations); db.SubmitChanges(); } /// /// 修改国内法律法规相关条款 /// /// public static void UpdateDomesticLawsRegulations(Model.FileControl_DomesticLawsRegulations domesticLawsRegulations) { Model.HJGLDB db = Funs.DB; Model.FileControl_DomesticLawsRegulations newDomesticLawsRegulations = db.FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulations.DomesticLawsRegulationsId); if (newDomesticLawsRegulations != null) { newDomesticLawsRegulations.DomesticLawsRegulationsCode = domesticLawsRegulations.DomesticLawsRegulationsCode; newDomesticLawsRegulations.DomesticLawsRegulationsName = domesticLawsRegulations.DomesticLawsRegulationsName; newDomesticLawsRegulations.Abstract = domesticLawsRegulations.Abstract; newDomesticLawsRegulations.CompileMan = domesticLawsRegulations.CompileMan; newDomesticLawsRegulations.CompileDate = domesticLawsRegulations.CompileDate; newDomesticLawsRegulations.Remarks = domesticLawsRegulations.Remarks; newDomesticLawsRegulations.AttachUrl = domesticLawsRegulations.AttachUrl; db.SubmitChanges(); } } /// /// 根据主键删除国内法律法规相关条款 /// /// public static void DeleteDomesticLawsRegulationsById(string domesticLawsRegulationsId) { Model.HJGLDB db = Funs.DB; Model.FileControl_DomesticLawsRegulations domesticLawsRegulations = db.FileControl_DomesticLawsRegulations.FirstOrDefault(e => e.DomesticLawsRegulationsId == domesticLawsRegulationsId); if (domesticLawsRegulations != null) { BLL.AttachFileService.DeleteAttachFile(Funs.RootPath, domesticLawsRegulationsId, Const.DomesticLawsRegulationsMenuId);//删除附件 db.FileControl_DomesticLawsRegulations.DeleteOnSubmit(domesticLawsRegulations); db.SubmitChanges(); } } } }