/// <summary> /// 根据主键删除采购供货厂家管理 /// </summary> /// <param name="inUnitId"></param> public static void DeleteInUnitById(string inUnitId) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_InUnit inUnit = db.QualityAudit_InUnit.FirstOrDefault(e => e.InUnitId == inUnitId); if (inUnit != null) { CodeRecordsService.DeleteCodeRecordsByDataId(inUnitId); if (!string.IsNullOrEmpty(inUnit.TrainRecordsUrl)) { UploadFileService.DeleteFile(Funs.RootPath, inUnit.TrainRecordsUrl); } if (!string.IsNullOrEmpty(inUnit.PlanUrl)) { UploadFileService.DeleteFile(Funs.RootPath, inUnit.PlanUrl); } if (!string.IsNullOrEmpty(inUnit.TemporaryPersonUrl)) { UploadFileService.DeleteFile(Funs.RootPath, inUnit.TemporaryPersonUrl); } if (!string.IsNullOrEmpty(inUnit.InPersonTrainUrl)) { UploadFileService.DeleteFile(Funs.RootPath, inUnit.InPersonTrainUrl); } if (!string.IsNullOrEmpty(inUnit.HSEAgreementUrl)) { UploadFileService.DeleteFile(Funs.RootPath, inUnit.HSEAgreementUrl); } db.QualityAudit_InUnit.DeleteOnSubmit(inUnit); db.SubmitChanges(); } }
/// <summary> /// 根据教育培训主键删除一个教育培训信息 /// </summary> /// <param name="trainingId">教育培训主键</param> public static void DeleteTrainingByTrainingId(string trainingId) { Model.SUBHSSEDB db = Funs.DB; Model.EduTrain_TrainRecord training = db.EduTrain_TrainRecord.FirstOrDefault(e => e.TrainingId == trainingId); if (training != null) { ///删除培训明细 EduTrain_TrainRecordDetailService.DeleteTrainDetailByTrainingId(trainingId); ///删除编码表记录 CodeRecordsService.DeleteCodeRecordsByDataId(training.TrainingId); ////删除附件表 CommonService.DeleteAttachFileById(training.TrainingId); ///删除工程师日志收集记录 var flowOperate = from x in db.Sys_FlowOperate where x.DataId == training.TrainingId select x; if (flowOperate.Count() > 0) { var details = BLL.EduTrain_TrainRecordDetailService.GetTrainRecordDetailByTrainingId(training.TrainingId); foreach (var item in flowOperate) { BLL.HSSELogService.CollectHSSELog(training.ProjectId, item.OperaterId, item.OperaterTime, "27", training.TrainContent, Const.BtnDelete, details.Count()); } ////删除流程表 BLL.CommonService.DeleteFlowOperateByID(training.TrainingId); } ///删除培训试卷 EduTrain_TrainTestService.DeleteTrainTestByTrainingId(training.TrainingId); db.EduTrain_TrainRecord.DeleteOnSubmit(training); db.SubmitChanges(); } }
/// <summary> /// 修改施工方案/审查 /// </summary> /// <param name="constructSolution"></param> public static void UpdateConstructSolution(Model.Solution_ConstructSolution constructSolution) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_ConstructSolution newConstructSolution = db.Solution_ConstructSolution.FirstOrDefault(e => e.ConstructSolutionId == constructSolution.ConstructSolutionId); if (newConstructSolution != null) { newConstructSolution.ConstructSolutionName = constructSolution.ConstructSolutionName; newConstructSolution.VersionNo = constructSolution.VersionNo; newConstructSolution.UnitId = constructSolution.UnitId; newConstructSolution.InvestigateType = constructSolution.InvestigateType; newConstructSolution.SolutinType = constructSolution.SolutinType; newConstructSolution.FileContents = constructSolution.FileContents; newConstructSolution.Remark = constructSolution.Remark; newConstructSolution.States = constructSolution.States; if (!string.IsNullOrEmpty(constructSolution.QRCodeAttachUrl)) { newConstructSolution.QRCodeAttachUrl = constructSolution.QRCodeAttachUrl; } db.SubmitChanges(); if (constructSolution.ConstructSolutionCode != CodeRecordsService.ReturnCodeByDataId(constructSolution.ConstructSolutionId)) { CodeRecordsService.DeleteCodeRecordsByDataId(constructSolution.ConstructSolutionId);//删除编号 } } }
/// <summary> /// 根据主键删除施工方案/审查 /// </summary> /// <param name="constructSolutionId"></param> public static void DeleteConstructSolutionById(string constructSolutionId) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_ConstructSolution constructSolution = db.Solution_ConstructSolution.FirstOrDefault(e => e.ConstructSolutionId == constructSolutionId); if (constructSolution != null) { ///删除工程师日志收集记录 var flowOperate = from x in db.Sys_FlowOperate where x.DataId == constructSolution.ConstructSolutionId select x; if (flowOperate.Count() > 0) { foreach (var item in flowOperate) { BLL.HSSELogService.CollectHSSELog(constructSolution.ProjectId, item.OperaterId, item.OperaterTime, "32", constructSolution.ConstructSolutionName, Const.BtnDelete, 1); } ////删除审核流程表 CommonService.DeleteFlowOperateByID(constructSolutionId); } CodeRecordsService.DeleteCodeRecordsByDataId(constructSolutionId); //删除编号 CommonService.DeleteAttachFileById(constructSolutionId); //删除附件 db.Solution_ConstructSolution.DeleteOnSubmit(constructSolution); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除隐患整改通知单 /// </summary> /// <param name="rectifyNoticesId"></param> public static void DeleteRectifyNoticesById(string rectifyNoticesId) { Model.SUBHSSEDB db = Funs.DB; Model.Check_RectifyNotices rectifyNotices = db.Check_RectifyNotices.FirstOrDefault(e => e.RectifyNoticesId == rectifyNoticesId); if (rectifyNotices != null) { CodeRecordsService.DeleteCodeRecordsByDataId(rectifyNoticesId); UploadFileService.DeleteFile(Funs.RootPath, rectifyNotices.AttachUrl); CommonService.DeleteAttachFileById(rectifyNoticesId); var getCheck_RectifyNoticesItem = from x in db.Check_RectifyNoticesItem where x.RectifyNoticesId == rectifyNoticesId select x; if (getCheck_RectifyNoticesItem.Count() > 0) { db.Check_RectifyNoticesItem.DeleteAllOnSubmit(getCheck_RectifyNoticesItem); db.SubmitChanges(); } var getRectifyNoticesFlowOperate = from x in db.Check_RectifyNoticesFlowOperate where x.RectifyNoticesId == rectifyNoticesId select x; if (getRectifyNoticesFlowOperate.Count() > 0) { db.Check_RectifyNoticesFlowOperate.DeleteAllOnSubmit(getRectifyNoticesFlowOperate); db.SubmitChanges(); } db.Check_RectifyNotices.DeleteOnSubmit(rectifyNotices); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除专家论证清单 /// </summary> /// <param name="expertArgumentId"></param> public static void DeleteExpertArgumentById(string expertArgumentId) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_ExpertArgument expertArgument = db.Solution_ExpertArgument.FirstOrDefault(e => e.ExpertArgumentId == expertArgumentId); if (expertArgument != null) { CodeRecordsService.DeleteCodeRecordsByDataId(expertArgumentId); db.Solution_ExpertArgument.DeleteOnSubmit(expertArgument); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除现场施工方案模板 /// </summary> /// <param name="projectSolutionTempleteId"></param> public static void DeleteProjectSolutionTempleteById(string projectSolutionTempleteId) { Model.SUBHSSEDB db = Funs.DB; Model.Technique_ProjectSolutionTemplete projectSolutionTemplete = db.Technique_ProjectSolutionTemplete.FirstOrDefault(e => e.TempleteId == projectSolutionTempleteId); if (projectSolutionTemplete != null) { CodeRecordsService.DeleteCodeRecordsByDataId(projectSolutionTempleteId); db.Technique_ProjectSolutionTemplete.DeleteOnSubmit(projectSolutionTemplete); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除特殊机具设备资质 /// </summary> /// <param name="equipmentQualityId"></param> public static void DeleteEquipmentQualityById(string equipmentQualityId) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_EquipmentQuality equipmentQuality = db.QualityAudit_EquipmentQuality.FirstOrDefault(e => e.EquipmentQualityId == equipmentQualityId); if (equipmentQuality != null) { CodeRecordsService.DeleteCodeRecordsByDataId(equipmentQualityId); //删除编号 CommonService.DeleteAttachFileById(equipmentQualityId); //删除附件 db.QualityAudit_EquipmentQuality.DeleteOnSubmit(equipmentQuality); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除HSSE事故(含未遂)处理 /// </summary> /// <param name="accidentHandleId"></param> public static void DeleteAccidentHandleById(string accidentHandleId) { Model.SUBHSSEDB db = Funs.DB; Model.Accident_AccidentHandle accidentHandle = db.Accident_AccidentHandle.FirstOrDefault(e => e.AccidentHandleId == accidentHandleId); if (accidentHandle != null) { CodeRecordsService.DeleteCodeRecordsByDataId(accidentHandleId); CommonService.DeleteFlowOperateByID(accidentHandleId); db.Accident_AccidentHandle.DeleteOnSubmit(accidentHandle); db.SubmitChanges(); } }
/// <summary> /// 根据Id获取数据 /// </summary> /// <param name="AccidentCauseReportId"></param> public static void DeleteAccidentCauseReportById(string AccidentCauseReportId) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_AccidentCauseReport newAccidentCauseReport = db.InformationProject_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReportId); if (newAccidentCauseReport != null) { CodeRecordsService.DeleteCodeRecordsByDataId(AccidentCauseReportId); CommonService.DeleteFlowOperateByID(AccidentCauseReportId); db.InformationProject_AccidentCauseReport.DeleteOnSubmit(newAccidentCauseReport); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除一般机具设备资质 /// </summary> /// <param name="generalEquipmentQualityId"></param> public static void DeleteGeneralEquipmentQualityById(string generalEquipmentQualityId) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_GeneralEquipmentQuality generalEquipmentQuality = db.QualityAudit_GeneralEquipmentQuality.FirstOrDefault(e => e.GeneralEquipmentQualityId == generalEquipmentQualityId); if (generalEquipmentQuality != null) { CodeRecordsService.DeleteCodeRecordsByDataId(generalEquipmentQualityId); CommonService.DeleteAttachFileById(generalEquipmentQualityId); db.QualityAudit_GeneralEquipmentQuality.DeleteOnSubmit(generalEquipmentQuality); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除项目协议记录 /// </summary> /// <param name="projectRecordId"></param> public static void DeleteProjectRecordById(string projectRecordId) { Model.SUBHSSEDB db = Funs.DB; Model.QualityAudit_ProjectRecord projectRecord = db.QualityAudit_ProjectRecord.FirstOrDefault(e => e.ProjectRecordId == projectRecordId); if (projectRecord != null) { CodeRecordsService.DeleteCodeRecordsByDataId(projectRecordId); CommonService.DeleteAttachFileById(projectRecordId); db.QualityAudit_ProjectRecord.DeleteOnSubmit(projectRecord); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除违规人员记录 /// </summary> /// <param name="violationPersonId"></param> public static void DeleteViolationPersonById(string violationPersonId) { Model.SUBHSSEDB db = Funs.DB; Model.Check_ViolationPerson violationPerson = db.Check_ViolationPerson.FirstOrDefault(e => e.ViolationPersonId == violationPersonId); if (violationPerson != null) { CodeRecordsService.DeleteCodeRecordsByDataId(violationPersonId); CommonService.DeleteFlowOperateByID(violationPersonId); db.Check_ViolationPerson.DeleteOnSubmit(violationPerson); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除获奖证书或奖杯 /// </summary> /// <param name="hSECertificateId"></param> public static void DeleteHSECertificateById(string hSECertificateId) { Model.SUBHSSEDB db = Funs.DB; Model.Check_HSECertificate hseCertificate = db.Check_HSECertificate.FirstOrDefault(e => e.HSECertificateId == hSECertificateId); if (hseCertificate != null) { CodeRecordsService.DeleteCodeRecordsByDataId(hSECertificateId); CommonService.DeleteFlowOperateByID(hSECertificateId); db.Check_HSECertificate.DeleteOnSubmit(hseCertificate); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除气瓶入场报批 /// </summary> /// <param name="gasCylinderInId"></param> public static void DeleteGasCylinderInById(string gasCylinderInId) { Model.SUBHSSEDB db = Funs.DB; Model.InApproveManager_GasCylinderIn gasCylinderIn = db.InApproveManager_GasCylinderIn.FirstOrDefault(e => e.GasCylinderInId == gasCylinderInId); if (gasCylinderIn != null) { CodeRecordsService.DeleteCodeRecordsByDataId(gasCylinderInId); CommonService.DeleteAttachFileById(gasCylinderInId); BLL.CommonService.DeleteFlowOperateByID(gasCylinderInId); ////删除审核流程表 db.InApproveManager_GasCylinderIn.DeleteOnSubmit(gasCylinderIn); db.SubmitChanges(); } }
/// <summary> /// 根据标准规范辨识编号删除一个标准规范辨识信息 /// </summary> /// <param name="constructionStandardIdentifyId">标准规范辨识主键</param> public static void DeleteConstructionStandardIdentifyById(string constructionStandardIdentifyId) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_ConstructionStandardIdentify constructionStandardIdentify = db.InformationProject_ConstructionStandardIdentify.FirstOrDefault(e => e.ConstructionStandardIdentifyId == constructionStandardIdentifyId); if (constructionStandardIdentify != null) { CodeRecordsService.DeleteCodeRecordsByDataId(constructionStandardIdentifyId); //删除编号 //CommonService.DeleteAttachFileById(constructionStandardIdentifyId);//删除附件 CommonService.DeleteFlowOperateByID(constructionStandardIdentifyId); //删除流程 db.InformationProject_ConstructionStandardIdentify.DeleteOnSubmit(constructionStandardIdentify); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除安全技术交底 /// </summary> /// <param name="hseTechnicalId"></param> public static void DeleteHSETechnicalById(string hseTechnicalId) { Model.SUBHSSEDB db = Funs.DB; Model.License_HSETechnical hseTechnical = db.License_HSETechnical.FirstOrDefault(e => e.HSETechnicalId == hseTechnicalId); if (hseTechnical != null) { CodeRecordsService.DeleteCodeRecordsByDataId(hseTechnicalId); CommonService.DeleteAttachFileById(hseTechnicalId); BLL.CommonService.DeleteFlowOperateByID(hseTechnicalId); ////删除审核流程表 db.License_HSETechnical.DeleteOnSubmit(hseTechnical); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除一般设备机具出场报批 /// </summary> /// <param name="generalEquipmentOutId"></param> public static void DeleteGeneralEquipmentOutById(string generalEquipmentOutId) { Model.SUBHSSEDB db = Funs.DB; Model.InApproveManager_GeneralEquipmentOut generalEquipmentOut = db.InApproveManager_GeneralEquipmentOut.FirstOrDefault(e => e.GeneralEquipmentOutId == generalEquipmentOutId); if (generalEquipmentOut != null) { CommonService.DeleteAttachFileById(generalEquipmentOutId); CodeRecordsService.DeleteCodeRecordsByDataId(generalEquipmentOutId); BLL.CommonService.DeleteFlowOperateByID(generalEquipmentOutId); ////删除审核流程表 db.InApproveManager_GeneralEquipmentOut.DeleteOnSubmit(generalEquipmentOut); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除分包方绩效评价 /// </summary> /// <param name="perfomanceRecordId"></param> public static void DeletePerfomanceRecordById(string perfomanceRecordId) { Model.SUBHSSEDB db = Funs.DB; Model.Perfomance_PerfomanceRecord perfomanceRecord = db.Perfomance_PerfomanceRecord.FirstOrDefault(e => e.PerfomanceRecordId == perfomanceRecordId); if (perfomanceRecord != null) { CodeRecordsService.DeleteCodeRecordsByDataId(perfomanceRecordId); //删除编号 CommonService.DeleteFlowOperateByID(perfomanceRecordId); //删除流程 UploadFileService.DeleteFile(Funs.RootPath, perfomanceRecord.AttachUrl); //删除附件 db.Perfomance_PerfomanceRecord.DeleteOnSubmit(perfomanceRecord); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除普通货物出场报批 /// </summary> /// <param name="goodsOutId"></param> public static void DeleteGoodsOutById(string goodsOutId) { Model.SUBHSSEDB db = Funs.DB; Model.InApproveManager_GoodsOut goodsOut = BLL.GoodsOutService.GetGoodsOutById(goodsOutId); if (goodsOut != null) { CommonService.DeleteAttachFileById(goodsOutId); CodeRecordsService.DeleteCodeRecordsByDataId(goodsOutId); BLL.CommonService.DeleteFlowOperateByID(goodsOutId); ////删除审核流程表 db.InApproveManager_GoodsOut.DeleteOnSubmit(goodsOut); db.SubmitChanges(); } }
/// <summary> /// 删除所有方案模板 /// </summary> /// <param name="solutionTemplateId"></param> public static void DeleteSolutionTemplateById(string solutionTemplateId) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_SolutionTemplate solutionTemplate = db.Solution_SolutionTemplate.FirstOrDefault(e => e.SolutionTemplateId == solutionTemplateId); if (solutionTemplate != null) { CodeRecordsService.DeleteCodeRecordsByDataId(solutionTemplateId); //删除编号 CommonService.DeleteAttachFileById(solutionTemplateId); //删除附件 CommonService.DeleteFlowOperateByID(solutionTemplateId); //删除流程 db.Solution_SolutionTemplate.DeleteOnSubmit(solutionTemplate); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除费用管理 /// </summary> /// <param name="costManageId"></param> public static void DeleteCostManageById(string costManageId) { Model.SUBHSSEDB db = Funs.DB; Model.CostGoods_CostManage costManage = db.CostGoods_CostManage.FirstOrDefault(e => e.CostManageId == costManageId); if (costManage != null) { CodeRecordsService.DeleteCodeRecordsByDataId(costManageId); //删除编号 ProjectDataFlowSetService.DeleteFlowSetByDataId(costManageId); //删除流程 CommonService.DeleteFlowOperateByID(costManageId); //删除审核流程 CommonService.DeleteAttachFileById(costManageId); //删除附件 db.CostGoods_CostManage.DeleteOnSubmit(costManage); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除物资出库管理 /// </summary> /// <param name="goodsOutId"></param> public static void DeleteGoodsOutById(string goodsOutId) { Model.SUBHSSEDB db = Funs.DB; Model.CostGoods_GoodsOut goodsOut = db.CostGoods_GoodsOut.FirstOrDefault(e => e.GoodsOutId == goodsOutId); if (goodsOut != null) { CodeRecordsService.DeleteCodeRecordsByDataId(goodsOutId); //删除编号 ProjectDataFlowSetService.DeleteFlowSetByDataId(goodsOutId); //删除流程 ////删除审核流程表 BLL.CommonService.DeleteFlowOperateByID(goodsOutId); db.CostGoods_GoodsOut.DeleteOnSubmit(goodsOut); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除安全措施费使用计划 /// </summary> /// <param name="measuresPlanId"></param> public static void DeleteMeasuresPlanById(string measuresPlanId) { Model.SUBHSSEDB db = Funs.DB; Model.CostGoods_MeasuresPlan measuresPlan = db.CostGoods_MeasuresPlan.FirstOrDefault(e => e.MeasuresPlanId == measuresPlanId); if (measuresPlan != null) { CodeRecordsService.DeleteCodeRecordsByDataId(measuresPlanId); CommonService.DeleteAttachFileById(measuresPlanId); ////删除审核流程表 BLL.CommonService.DeleteFlowOperateByID(measuresPlanId); db.CostGoods_MeasuresPlan.DeleteOnSubmit(measuresPlan); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除特种设备机具入场报批 /// </summary> /// <param name="equipmentInId"></param> public static void DeleteEquipmentInById(string equipmentInId) { Model.SUBHSSEDB db = Funs.DB; Model.InApproveManager_EquipmentIn equipmentIn = db.InApproveManager_EquipmentIn.FirstOrDefault(e => e.EquipmentInId == equipmentInId); if (equipmentIn != null) { CodeRecordsService.DeleteCodeRecordsByDataId(equipmentInId); //删除编号 CommonService.DeleteAttachFileById(equipmentInId); //删除附件 BLL.CommonService.DeleteFlowOperateByID(equipmentInId); ////删除审核流程表 db.InApproveManager_EquipmentIn.DeleteOnSubmit(equipmentIn); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除违章曝光台 /// </summary> /// <param name="exposureId"></param> public static void DeleteExposureById(string exposureId) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_Exposure exposure = db.InformationProject_Exposure.FirstOrDefault(e => e.ExposureId == exposureId); if (exposure != null) { CommonService.DeleteAttachFileById(exposureId); //删除附件 CodeRecordsService.DeleteCodeRecordsByDataId(exposureId); //删除编号 ProjectDataFlowSetService.DeleteFlowSetByDataId(exposureId); //删除流程 ////删除审核流程表 BLL.CommonService.DeleteFlowOperateByID(exposureId); db.InformationProject_Exposure.DeleteOnSubmit(exposure); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除吊装作业票 /// </summary> /// <param name="liftingWorkId"></param> public static void DeleteLiftingWorkById(string liftingWorkId) { Model.SUBHSSEDB db = Funs.DB; Model.License_LiftingWork liftingWork = db.License_LiftingWork.FirstOrDefault(e => e.LiftingWorkId == liftingWorkId); if (liftingWork != null) { ///删除编码表记录 CodeRecordsService.DeleteCodeRecordsByDataId(liftingWorkId); ///删除-安全措施 DeleteLicenseItemByDataId(liftingWorkId); ///删除作业票审核信息 DeleteFlowOperateByDataId(liftingWorkId); db.License_LiftingWork.DeleteOnSubmit(liftingWork); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除断路(占道)作业票 /// </summary> /// <param name="openCircuitId"></param> public static void DeleteOpenCircuitById(string openCircuitId) { Model.SUBHSSEDB db = Funs.DB; Model.License_OpenCircuit openCircuit = db.License_OpenCircuit.FirstOrDefault(e => e.OpenCircuitId == openCircuitId); if (openCircuit != null) { ///删除编码表记录 CodeRecordsService.DeleteCodeRecordsByDataId(openCircuitId); ///删除-安全措施 DeleteLicenseItemByDataId(openCircuitId); ///删除作业票审核信息 DeleteFlowOperateByDataId(openCircuitId); db.License_OpenCircuit.DeleteOnSubmit(openCircuit); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除知识竞赛计划 /// </summary> /// <param name="TestPlanId"></param> public static void DeleteTestPlanById(string TestPlanId) { Model.SUBHSSEDB db = Funs.DB; Model.Test_TestPlan TestPlan = db.Test_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlanId); if (TestPlan != null) { ///删除编码表记录 CodeRecordsService.DeleteCodeRecordsByDataId(TestPlan.TestPlanId); ////删除附件表 CommonService.DeleteAttachFileById(TestPlan.TestPlanId); ///删除题目类型 ServerTestPlanTrainingService.DeleteTestPlanTrainingByTestPlanId(TestPlan.TestPlanId); db.Test_TestPlan.DeleteOnSubmit(TestPlan); db.SubmitChanges(); } }
/// <summary> /// 删除 /// </summary> /// <param name="ContactListId"></param> public static void DeleteContactListById(string ContactListId) { Model.SUBHSSEDB db = Funs.DB; Model.Check_ContactList ContactList = db.Check_ContactList.FirstOrDefault(e => e.ContactListId == ContactListId); if (ContactList != null) { if (!string.IsNullOrEmpty(ContactList.AttachUrl)) { BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, ContactList.AttachUrl);//删除附件 } CodeRecordsService.DeleteCodeRecordsByDataId(ContactListId); CommonService.DeleteAttachFileById(ContactListId); db.Check_ContactList.DeleteOnSubmit(ContactList); db.SubmitChanges(); } }