162 lines
7.5 KiB
C#
162 lines
7.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 在建项目信息月报
|
|
/// </summary>
|
|
public class ProjectInfoMonthReportService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取在建项目信息月报
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
public static Model.Report_ProjectInfoMonthReport GetProjectInfoMonthReportById(string id)
|
|
{
|
|
return Funs.DB.Report_ProjectInfoMonthReport.FirstOrDefault(e => e.MonthReportId == id);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据项目Id、月份获取月报信息
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <param name="month"></param>
|
|
/// <returns></returns>
|
|
public static Model.Report_ProjectInfoMonthReport GetProjectInfoMonthReportByMonth(string projectId, string month)
|
|
{
|
|
return Funs.DB.Report_ProjectInfoMonthReport.FirstOrDefault(e => e.ProjectId == projectId && e.Months == Convert.ToDateTime(month));
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据单位Id月份获取月报
|
|
/// </summary>
|
|
/// <param name="unitId"></param>
|
|
/// <param name="months"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.Report_ProjectInfoMonthReport> GetProjectInfoMonthReportByUnitMonth(string unitId, string months)
|
|
{
|
|
return (from x in Funs.DB.Report_ProjectInfoMonthReport where x.UnitId == unitId && x.Months == Convert.ToDateTime(months) select x).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加在建项目信息月报
|
|
/// </summary>
|
|
/// <param name="report"></param>
|
|
public static void AddProjectInfoMonthReport(Model.Report_ProjectInfoMonthReport report)
|
|
{
|
|
Model.Report_ProjectInfoMonthReport newReport = new Model.Report_ProjectInfoMonthReport
|
|
{
|
|
MonthReportId = report.MonthReportId,
|
|
Months = report.Months,
|
|
UnitId = report.UnitId,
|
|
ProjectId = report.ProjectId,
|
|
ProjectNature = report.ProjectNature,
|
|
Address = report.Address,
|
|
ProjectStatus = report.ProjectStatus,
|
|
ContractStartDate = report.ContractStartDate,
|
|
ContractEndDate = report.ContractEndDate,
|
|
ProjectManager = report.ProjectManager,
|
|
SecurityManager = report.SecurityManager,
|
|
ContractAmount = report.ContractAmount,
|
|
SitePeopleCount = report.SitePeopleCount,
|
|
SefeWorkHours = report.SefeWorkHours,
|
|
SafeWrokHoursTotalYear = report.SafeWrokHoursTotalYear,
|
|
SafeWorkHoursStartCon = report.SafeWorkHoursStartCon,
|
|
SafetyTraining = report.SafetyTraining,
|
|
HiddenDangerSameAs = report.HiddenDangerSameAs,
|
|
HiddenDangerMajor = report.HiddenDangerMajor,
|
|
HotWork = report.HotWork,
|
|
ConfinedSpace = report.ConfinedSpace,
|
|
HeightsWork = report.HeightsWork,
|
|
Hoisting = report.Hoisting,
|
|
Groundbreaking = report.Groundbreaking,
|
|
TemporaryElectricity = report.TemporaryElectricity,
|
|
RadiationHomework = report.RadiationHomework,
|
|
NightConstruction = report.NightConstruction,
|
|
UnitAward = report.UnitAward,
|
|
PersonalAward = report.PersonalAward,
|
|
UnitPunish = report.UnitPunish,
|
|
PersonalPunish = report.PersonalPunish,
|
|
AccidentCount = report.AccidentCount,
|
|
Injured = report.Injured,
|
|
Severity = report.Severity,
|
|
AccidentType = report.AccidentType,
|
|
EconomicLosses = report.EconomicLosses,
|
|
LostWorkingHours = report.LostWorkingHours,
|
|
States = report.States
|
|
};
|
|
Funs.DB.Report_ProjectInfoMonthReport.InsertOnSubmit(newReport);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改在线项目信息月报
|
|
/// </summary>
|
|
/// <param name="report"></param>
|
|
public static void UpdateProjectInfoMonthReport(Model.Report_ProjectInfoMonthReport report)
|
|
{
|
|
Model.Report_ProjectInfoMonthReport newReport = Funs.DB.Report_ProjectInfoMonthReport.FirstOrDefault(e => e.MonthReportId == report.MonthReportId);
|
|
if (newReport != null)
|
|
{
|
|
newReport.Months = report.Months;
|
|
newReport.UnitId = report.UnitId;
|
|
newReport.ProjectId = report.ProjectId;
|
|
newReport.ProjectNature = report.ProjectNature;
|
|
newReport.Address = report.Address;
|
|
newReport.ProjectStatus = report.ProjectStatus;
|
|
newReport.ContractStartDate = report.ContractStartDate;
|
|
newReport.ContractEndDate = report.ContractEndDate;
|
|
newReport.ProjectManager = report.ProjectManager;
|
|
newReport.SecurityManager = report.SecurityManager;
|
|
newReport.ContractAmount = report.ContractAmount;
|
|
newReport.SitePeopleCount = report.SitePeopleCount;
|
|
newReport.SefeWorkHours = report.SefeWorkHours;
|
|
newReport.SafeWrokHoursTotalYear = report.SafeWrokHoursTotalYear;
|
|
newReport.SafeWorkHoursStartCon = report.SafeWorkHoursStartCon;
|
|
newReport.SafetyTraining = report.SafetyTraining;
|
|
newReport.HiddenDangerSameAs = report.HiddenDangerSameAs;
|
|
newReport.HiddenDangerMajor = report.HiddenDangerMajor;
|
|
newReport.HotWork = report.HotWork;
|
|
newReport.ConfinedSpace = report.ConfinedSpace;
|
|
newReport.HeightsWork = report.HeightsWork;
|
|
newReport.Hoisting = report.Hoisting;
|
|
newReport.Groundbreaking = report.Groundbreaking;
|
|
newReport.TemporaryElectricity = report.TemporaryElectricity;
|
|
newReport.RadiationHomework = report.RadiationHomework;
|
|
newReport.NightConstruction = report.NightConstruction;
|
|
newReport.UnitAward = report.UnitAward;
|
|
newReport.PersonalAward = report.PersonalAward;
|
|
newReport.UnitPunish = report.UnitPunish;
|
|
newReport.PersonalPunish = report.PersonalPunish;
|
|
newReport.AccidentCount = report.AccidentCount;
|
|
newReport.Injured = report.Injured;
|
|
newReport.Severity = report.Severity;
|
|
newReport.AccidentType = report.AccidentType;
|
|
newReport.EconomicLosses = report.EconomicLosses;
|
|
newReport.LostWorkingHours = report.LostWorkingHours;
|
|
newReport.States = report.States;
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除在线项目信息月报
|
|
/// </summary>
|
|
/// <param name="reportId"></param>
|
|
public static void DeleteProjectInfoMonthReportById(string reportId)
|
|
{
|
|
Model.Report_ProjectInfoMonthReport newReport = Funs.DB.Report_ProjectInfoMonthReport.FirstOrDefault(e => e.MonthReportId == reportId);
|
|
if (newReport != null)
|
|
{
|
|
Funs.DB.Report_ProjectInfoMonthReport.DeleteOnSubmit(newReport);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|