using System.Linq; namespace BLL { /// /// 安全管理工作总结报告 /// public static class WorkSummaryReportService { /// /// 根据主键获取安全管理工作总结报告 /// /// /// public static Model.Information_WorkSummaryReport GetWorkSummaryReportById(string workSummaryReportId) { return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); } /// /// 安全管理工作总结报告 /// /// 单位Id /// 年度 /// 安全管理工作总结报告 public static Model.Information_WorkSummaryReport GetWorkSummaryReportByUnitIdAndYear(string unitId, int year) { return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year); } /// /// 添加安全管理工作总结报告 /// /// public static void AddWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport) { Model.Information_WorkSummaryReport newWorkSummaryReport = new Model.Information_WorkSummaryReport { WorkSummaryReportId = workSummaryReport.WorkSummaryReportId, YearId = workSummaryReport.YearId, UnitId = workSummaryReport.UnitId, ResponsiblePerson = workSummaryReport.ResponsiblePerson, ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel, ContactPerson = workSummaryReport.ContactPerson, ContactPersonTel = workSummaryReport.ContactPersonTel, ReportDate = workSummaryReport.ReportDate, SafeLaborTime = workSummaryReport.SafeLaborTime, SafetyObjectives = workSummaryReport.SafetyObjectives, AccidentSituation = workSummaryReport.AccidentSituation, Awards = workSummaryReport.Awards, WorkDevelopment = workSummaryReport.WorkDevelopment, PersonnelTraining = workSummaryReport.PersonnelTraining, GovernanceSituation = workSummaryReport.GovernanceSituation, ManagementActivity = workSummaryReport.ManagementActivity, WorkExperience = workSummaryReport.WorkExperience, Countermeasures = workSummaryReport.Countermeasures, NextYearWorkPlan = workSummaryReport.NextYearWorkPlan, JobSuggestion = workSummaryReport.JobSuggestion, UpState = workSummaryReport.UpState }; Funs.DB.Information_WorkSummaryReport.InsertOnSubmit(newWorkSummaryReport); Funs.DB.SubmitChanges(); } /// /// 修改安全管理工作总结报告 /// /// public static void UpdateWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport) { Model.Information_WorkSummaryReport newWorkSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReport.WorkSummaryReportId); if (newWorkSummaryReport != null) { newWorkSummaryReport.UnitId = workSummaryReport.UnitId; newWorkSummaryReport.YearId = workSummaryReport.YearId; newWorkSummaryReport.ResponsiblePerson = workSummaryReport.ResponsiblePerson; newWorkSummaryReport.ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel; newWorkSummaryReport.ContactPerson = workSummaryReport.ContactPerson; newWorkSummaryReport.ContactPersonTel = workSummaryReport.ContactPersonTel; newWorkSummaryReport.ReportDate = workSummaryReport.ReportDate; newWorkSummaryReport.SafeLaborTime = workSummaryReport.SafeLaborTime; newWorkSummaryReport.SafetyObjectives = workSummaryReport.SafetyObjectives; newWorkSummaryReport.AccidentSituation = workSummaryReport.AccidentSituation; newWorkSummaryReport.Awards = workSummaryReport.Awards; newWorkSummaryReport.WorkDevelopment = workSummaryReport.WorkDevelopment; newWorkSummaryReport.PersonnelTraining = workSummaryReport.PersonnelTraining; newWorkSummaryReport.GovernanceSituation = workSummaryReport.GovernanceSituation; newWorkSummaryReport.ManagementActivity = workSummaryReport.ManagementActivity; newWorkSummaryReport.WorkExperience = workSummaryReport.WorkExperience; newWorkSummaryReport.Countermeasures = workSummaryReport.Countermeasures; newWorkSummaryReport.NextYearWorkPlan = workSummaryReport.NextYearWorkPlan; newWorkSummaryReport.JobSuggestion = workSummaryReport.JobSuggestion; newWorkSummaryReport.UpState = workSummaryReport.UpState; Funs.DB.SubmitChanges(); } } /// /// 根据主键删除安全管理工作总结报告 /// /// public static void DeleteWorkSummaryReportById(string workSummaryReportId) { Model.Information_WorkSummaryReport workSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId); if (workSummaryReport != null) { Funs.DB.Information_WorkSummaryReport.DeleteOnSubmit(workSummaryReport); Funs.DB.SubmitChanges(); } } } }