using System; using System.Collections; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { public class ConstructionMonthReportService { public static Model.SGGLDB db = Funs.DB; /// /// 添加施工月报 /// /// public static void AddConstructionMonthReport(Model.ZHGL_ConstructionMonthReport ConstructionMonthReport) { Model.SGGLDB db = Funs.DB; Model.ZHGL_ConstructionMonthReport newConstructionMonthReport = new Model.ZHGL_ConstructionMonthReport(); newConstructionMonthReport.ConstructionMonthReportId = ConstructionMonthReport.ConstructionMonthReportId; newConstructionMonthReport.ProjectId = ConstructionMonthReport.ProjectId; newConstructionMonthReport.Month = ConstructionMonthReport.Month; newConstructionMonthReport.OwnerName = ConstructionMonthReport.OwnerName; newConstructionMonthReport.ContractScope = ConstructionMonthReport.ContractScope; newConstructionMonthReport.ContractPriceAndPricingModel = ConstructionMonthReport.ContractPriceAndPricingModel; newConstructionMonthReport.ContractStartDate = ConstructionMonthReport.ContractStartDate; newConstructionMonthReport.ContractEndDate = ConstructionMonthReport.ContractEndDate; newConstructionMonthReport.MainConstructionActivities = ConstructionMonthReport.MainConstructionActivities; newConstructionMonthReport.ProgressDeviationAndCauseAnalysis = ConstructionMonthReport.ProgressDeviationAndCauseAnalysis; newConstructionMonthReport.KeyDeviationAndCauseAnalysis = ConstructionMonthReport.KeyDeviationAndCauseAnalysis; newConstructionMonthReport.TargetedCorrectiveMeasures = ConstructionMonthReport.TargetedCorrectiveMeasures; newConstructionMonthReport.NextMonthWork = ConstructionMonthReport.NextMonthWork; newConstructionMonthReport.NeedCoordinateMatter = ConstructionMonthReport.NeedCoordinateMatter; newConstructionMonthReport.CompileMan = ConstructionMonthReport.CompileMan; newConstructionMonthReport.CompileDate = ConstructionMonthReport.CompileDate; db.ZHGL_ConstructionMonthReport.InsertOnSubmit(newConstructionMonthReport); db.SubmitChanges(); } /// /// 修改施工月报 /// /// public static void UpdateConstructionMonthReport(Model.ZHGL_ConstructionMonthReport ConstructionMonthReport) { Model.SGGLDB db = Funs.DB; Model.ZHGL_ConstructionMonthReport newConstructionMonthReport = db.ZHGL_ConstructionMonthReport.First(e => e.ConstructionMonthReportId == ConstructionMonthReport.ConstructionMonthReportId); newConstructionMonthReport.OwnerName = ConstructionMonthReport.OwnerName; newConstructionMonthReport.ContractScope = ConstructionMonthReport.ContractScope; newConstructionMonthReport.ContractPriceAndPricingModel = ConstructionMonthReport.ContractPriceAndPricingModel; newConstructionMonthReport.ContractStartDate = ConstructionMonthReport.ContractStartDate; newConstructionMonthReport.ContractEndDate = ConstructionMonthReport.ContractEndDate; newConstructionMonthReport.MainConstructionActivities = ConstructionMonthReport.MainConstructionActivities; newConstructionMonthReport.ProgressDeviationAndCauseAnalysis = ConstructionMonthReport.ProgressDeviationAndCauseAnalysis; newConstructionMonthReport.KeyDeviationAndCauseAnalysis = ConstructionMonthReport.KeyDeviationAndCauseAnalysis; newConstructionMonthReport.TargetedCorrectiveMeasures = ConstructionMonthReport.TargetedCorrectiveMeasures; newConstructionMonthReport.NextMonthWork = ConstructionMonthReport.NextMonthWork; newConstructionMonthReport.NeedCoordinateMatter = ConstructionMonthReport.NeedCoordinateMatter; db.SubmitChanges(); } /// /// 根据施工月报Id删除一个施工月报信息 /// /// public static void DeleteConstructionMonthReport(string ConstructionMonthReportId) { Model.SGGLDB db = Funs.DB; Model.ZHGL_ConstructionMonthReport ConstructionMonthReport = db.ZHGL_ConstructionMonthReport.First(e => e.ConstructionMonthReportId == ConstructionMonthReportId); db.ZHGL_ConstructionMonthReport.DeleteOnSubmit(ConstructionMonthReport); db.SubmitChanges(); } /// /// 根据施工月报Id获取一个施工月报信息 /// /// public static Model.ZHGL_ConstructionMonthReport GetConstructionMonthReport(string ConstructionMonthReportId) { return Funs.DB.ZHGL_ConstructionMonthReport.FirstOrDefault(e => e.ConstructionMonthReportId == ConstructionMonthReportId); } /// /// 根据月份获取一个施工月报信息 /// /// 月份 public static Model.ZHGL_ConstructionMonthReport GetConstructionMonthReportByMonth(DateTime month, string projectId) { return Funs.DB.ZHGL_ConstructionMonthReport.FirstOrDefault(e => e.Month == month && e.ProjectId == projectId); } } }