/// <summary> /// 修改夜间施工作业票 /// </summary> /// <param name="nightWork"></param> public static void UpdateNightWork(Model.License_NightWork nightWork) { Model.SUBHSSEDB db = Funs.DB; Model.License_NightWork newNightWork = db.License_NightWork.FirstOrDefault(e => e.NightWorkId == nightWork.NightWorkId); if (newNightWork != null) { newNightWork.WorkPalce = nightWork.WorkPalce; newNightWork.WorkMeasures = nightWork.WorkMeasures; newNightWork.ValidityStartTime = nightWork.ValidityStartTime; newNightWork.ValidityEndTime = nightWork.ValidityEndTime; newNightWork.WorkLeaderId = nightWork.WorkLeaderId; newNightWork.WorkLeaderTel = nightWork.WorkLeaderTel; newNightWork.SafeLeaderId = nightWork.SafeLeaderId; newNightWork.SafeLeaderTel = nightWork.SafeLeaderTel; newNightWork.CancelManId = nightWork.CancelManId; newNightWork.CancelReasons = nightWork.CancelReasons; newNightWork.CancelTime = nightWork.CancelTime; newNightWork.CloseManId = nightWork.CloseManId; newNightWork.CloseReasons = nightWork.CloseReasons; newNightWork.CloseTime = nightWork.CloseTime; newNightWork.NextManId = nightWork.NextManId; newNightWork.States = nightWork.States; db.SubmitChanges(); } }
/// <summary> /// 添加夜间施工作业票 /// </summary> /// <param name="nightWork"></param> public static void AddNightWork(Model.License_NightWork nightWork) { Model.SUBHSSEDB db = Funs.DB; Model.License_NightWork newNightWork = new Model.License_NightWork { NightWorkId = nightWork.NightWorkId, ProjectId = nightWork.ProjectId, LicenseCode = nightWork.LicenseCode, ApplyUnitId = nightWork.ApplyUnitId, ApplyManId = nightWork.ApplyManId, ApplyDate = nightWork.ApplyDate, WorkPalce = nightWork.WorkPalce, WorkMeasures = nightWork.WorkMeasures, ValidityStartTime = nightWork.ValidityStartTime, ValidityEndTime = nightWork.ValidityEndTime, WorkLeaderId = nightWork.WorkLeaderId, WorkLeaderTel = nightWork.WorkLeaderTel, SafeLeaderId = nightWork.SafeLeaderId, SafeLeaderTel = nightWork.SafeLeaderTel, CancelManId = nightWork.CancelManId, CancelReasons = nightWork.CancelReasons, CancelTime = nightWork.CancelTime, CloseManId = nightWork.CloseManId, CloseReasons = nightWork.CloseReasons, CloseTime = nightWork.CloseTime, NextManId = nightWork.NextManId, States = nightWork.States, }; db.License_NightWork.InsertOnSubmit(newNightWork); db.SubmitChanges(); ////增加一条编码记录 CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectNightWorkMenuId, nightWork.ProjectId, nightWork.ApplyUnitId, nightWork.NightWorkId, nightWork.ApplyDate); }
/// <summary> /// 根据主键删除夜间施工作业票 /// </summary> /// <param name="nightWorkId"></param> public static void DeleteNightWorkById(string nightWorkId) { Model.SUBHSSEDB db = Funs.DB; Model.License_NightWork nightWork = db.License_NightWork.FirstOrDefault(e => e.NightWorkId == nightWorkId); if (nightWork != null) { ///删除编码表记录 CodeRecordsService.DeleteCodeRecordsByDataId(nightWorkId); ///删除-安全措施 DeleteLicenseItemByDataId(nightWorkId); ///删除作业票审核信息 DeleteFlowOperateByDataId(nightWorkId); db.License_NightWork.DeleteOnSubmit(nightWork); db.SubmitChanges(); } }