using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { /// /// 危大工程实施清单月报 /// public class HazardousEngineeringService { /// /// 根据主键获取危大工程实施清单月报 /// /// /// public static Model.Report_HazardousEngineering GetReportById(string reportId) { return Funs.DB.Report_HazardousEngineering.FirstOrDefault(e => e.ReportId == reportId); } /// /// 添加危大工程实施清单月报 /// /// public static void AddHazardousEngineering(Model.Report_HazardousEngineering report) { Model.Report_HazardousEngineering newReport = new Model.Report_HazardousEngineering { ReportId = report.ReportId, Months = report.Months, ProjectId = report.ProjectId, UnitId = report.UnitId, SubProjectName = report.SubProjectName, WorksCategory = report.WorksCategory, IsSuperDangerous = report.IsSuperDangerous, Address = report.Address, ConStartDate = report.ConStartDate, ConEndDate = report.ConEndDate, PlanSubmissionDate = report.PlanSubmissionDate, PlanApprovalDate = report.PlanApprovalDate, CompletionDate = report.CompletionDate, SpecializedClass = report.SpecializedClass, States = report.States }; Funs.DB.Report_HazardousEngineering.InsertOnSubmit(newReport); Funs.DB.SubmitChanges(); } /// /// 修改危大工程实施清单月报 /// /// public static void UpdateHazardousEngineering(Model.Report_HazardousEngineering report) { Model.Report_HazardousEngineering newReport = Funs.DB.Report_HazardousEngineering.FirstOrDefault(e => e.ReportId == report.ReportId); if (newReport != null) { newReport.Months = report.Months; newReport.ProjectId = report.ProjectId; newReport.UnitId = report.UnitId; newReport.SubProjectName = report.SubProjectName; newReport.WorksCategory = report.WorksCategory; newReport.IsSuperDangerous = report.IsSuperDangerous; newReport.Address = report.Address; newReport.ConStartDate = report.ConStartDate; newReport.ConEndDate = report.ConEndDate; newReport.PlanSubmissionDate = report.PlanSubmissionDate; newReport.PlanApprovalDate = report.PlanApprovalDate; newReport.CompletionDate = report.CompletionDate; newReport.SpecializedClass = report.SpecializedClass; newReport.States = report.States; Funs.DB.SubmitChanges(); } } /// /// 根据主键删除危大工程实施清单月报 /// /// public static void DeleteHazardousEngineeringById(string reportId) { Model.Report_HazardousEngineering newReport = Funs.DB.Report_HazardousEngineering.FirstOrDefault(e => e.ReportId == reportId); if (newReport != null) { Funs.DB.Report_HazardousEngineering.DeleteOnSubmit(newReport); Funs.DB.SubmitChanges(); } } } }