/// <summary> /// 根据工作日报主键删除一个工作日报信息 /// </summary> /// <param name="monthReportId">工作日报主键</param> public static void DeleteMonthReportByMonthReportId(string monthReportId) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_MonthReport monthReport = db.SitePerson_MonthReport.FirstOrDefault(e => e.MonthReportId == monthReportId); if (monthReport != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(monthReportId); BLL.CommonService.DeleteFlowOperateByID(monthReportId); db.SitePerson_MonthReport.DeleteOnSubmit(monthReport); db.SubmitChanges(); } }
/// <summary> /// 修改工作日报信息 /// </summary> /// <param name="monthReport">工作日报实体</param> public static void UpdateMonthReport(Model.SitePerson_MonthReport monthReport) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_MonthReport newMonthReport = db.SitePerson_MonthReport.FirstOrDefault(e => e.MonthReportId == monthReport.MonthReportId); if (newMonthReport != null) { //newMonthReport.ProjectId = monthReport.ProjectId; newMonthReport.CompileMan = monthReport.CompileMan; newMonthReport.CompileDate = monthReport.CompileDate; newMonthReport.States = monthReport.States; db.SubmitChanges(); } }
/// <summary> /// 增加工作日报信息 /// </summary> /// <param name="monthReport">工作日报实体</param> public static void AddMonthReport(Model.SitePerson_MonthReport monthReport) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_MonthReport newMonthReport = new Model.SitePerson_MonthReport { MonthReportId = monthReport.MonthReportId, ProjectId = monthReport.ProjectId, CompileMan = monthReport.CompileMan, CompileDate = monthReport.CompileDate, States = monthReport.States }; db.SitePerson_MonthReport.InsertOnSubmit(newMonthReport); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectMonthReportMenuId, monthReport.ProjectId, null, monthReport.MonthReportId, monthReport.CompileDate); }