93 lines
3.7 KiB
C#
93 lines
3.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 危大工程实施清单月报
|
|
/// </summary>
|
|
public class HazardousEngineeringService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取危大工程实施清单月报
|
|
/// </summary>
|
|
/// <param name="reportId"></param>
|
|
/// <returns></returns>
|
|
public static Model.Report_HazardousEngineering GetReportById(string reportId)
|
|
{
|
|
return Funs.DB.Report_HazardousEngineering.FirstOrDefault(e => e.ReportId == reportId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加危大工程实施清单月报
|
|
/// </summary>
|
|
/// <param name="report"></param>
|
|
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();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改危大工程实施清单月报
|
|
/// </summary>
|
|
/// <param name="report"></param>
|
|
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();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除危大工程实施清单月报
|
|
/// </summary>
|
|
/// <param name="reportId"></param>
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
} |