/// <summary> /// 保存发卡信息 /// </summary> /// <param name="personId"></param> /// <param name="cardNo"></param> public static void SaveSendCard(string personId, string cardNo, int personIndex) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_Person card = db.SitePerson_Person.FirstOrDefault(e => e.CardNo == cardNo); if (card != null) { card.CardNo = null; } else { Model.SitePerson_Person person = db.SitePerson_Person.FirstOrDefault(e => e.PersonId == personId); person.CardNo = cardNo; person.PersonIndex = personIndex; //person.CardNo = sendCardNo; } db.SubmitChanges(); }
/// <summary> /// 添加报表上报情况 /// </summary> /// <param name="reportRemind"></param> public static void AddReportRemind(Model.ManagementReport_ReportRemind reportRemind) { Model.SUBHSSEDB db = Funs.DB; Model.ManagementReport_ReportRemind newReportRemind = new Model.ManagementReport_ReportRemind { ReportRemindId = SQLHelper.GetNewID(typeof(Model.ManagementReport_ReportRemind)), ProjectId = reportRemind.ProjectId, Months = reportRemind.Months, Year = reportRemind.Year, Month = reportRemind.Month, Quarterly = reportRemind.Quarterly, HalfYear = reportRemind.HalfYear, ReportName = reportRemind.ReportName, CompileDate = reportRemind.CompileDate }; db.ManagementReport_ReportRemind.InsertOnSubmit(newReportRemind); db.SubmitChanges(); }
/// <summary> /// 添加获奖证书或奖杯 /// </summary> /// <param name="hSECertificate"></param> public static void AddHSECertificate(Model.Check_HSECertificate hSECertificate) { Model.SUBHSSEDB db = Funs.DB; Model.Check_HSECertificate newHSECertificate = new Model.Check_HSECertificate { HSECertificateId = hSECertificate.HSECertificateId, ProjectId = hSECertificate.ProjectId, HSECertificateCode = hSECertificate.HSECertificateCode, HSECertificateName = hSECertificate.HSECertificateName, AttachUrl = hSECertificate.AttachUrl, CompileMan = hSECertificate.CompileMan, CompileDate = hSECertificate.CompileDate, States = hSECertificate.States }; db.Check_HSECertificate.InsertOnSubmit(newHSECertificate); db.SubmitChanges(); CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.ProjectHSECertificateMenuId, hSECertificate.ProjectId, null, hSECertificate.HSECertificateId, hSECertificate.CompileDate); }
/// <summary> /// 根据日常巡检ID删除对应日常巡检记录信息 /// </summary> /// <param name="superviseCheckReportId"></param> public static void DeleteCheckDay(string checkDayId) { Model.SUBHSSEDB db = Funs.DB; var checkDay = (from x in db.Check_CheckDay where x.CheckDayId == checkDayId select x).FirstOrDefault(); if (checkDay != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(checkDay.CheckDayId); ////删除附件表 BLL.CommonService.DeleteAttachFileById(checkDay.CheckDayId); ///删除工程师日志收集记录 BLL.HSSELogService.CollectHSSELog(checkDay.ProjectId, checkDay.CheckPerson, checkDay.CheckTime, "21", "日常巡检", Const.BtnDelete, 1); BLL.CommonService.DeleteFlowOperateByID(checkDay.CheckDayId); db.Check_CheckDay.DeleteOnSubmit(checkDay); db.SubmitChanges(); } }
/// <summary> /// 根据主键删除管理规定 /// </summary> /// <param name="manageRuleId"></param> public static void DeleteManageRuleById(string manageRuleId) { Model.SUBHSSEDB db = Funs.DB; Model.Law_ManageRule manageRule = db.Law_ManageRule.FirstOrDefault(e => e.ManageRuleId == manageRuleId); if (manageRule != null) { //if (!string.IsNullOrEmpty(manageRule.AttachUrl)) //{ // BLL.UploadFileService.DeleteFile(Funs.RootPath, manageRule.AttachUrl); //} ////删除附件表 //BLL.CommonService.DeleteAttachFileById(manageRule.ManageRuleId); db.Law_ManageRule.DeleteOnSubmit(manageRule); db.SubmitChanges(); } }
/// <summary> /// 修改百万工时安全统计月报 /// </summary> /// <param name="millionsMonthlyReport"></param> public static void UpdateMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_MillionsMonthlyReport newMillionsMonthlyReport = db.InformationProject_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == millionsMonthlyReport.MillionsMonthlyReportId); if (newMillionsMonthlyReport != null) { newMillionsMonthlyReport.ProjectId = millionsMonthlyReport.ProjectId; newMillionsMonthlyReport.Year = millionsMonthlyReport.Year; newMillionsMonthlyReport.Month = millionsMonthlyReport.Month; newMillionsMonthlyReport.CompileMan = millionsMonthlyReport.CompileMan; newMillionsMonthlyReport.CompileDate = millionsMonthlyReport.CompileDate; newMillionsMonthlyReport.States = millionsMonthlyReport.States; newMillionsMonthlyReport.Affiliation = millionsMonthlyReport.Affiliation; newMillionsMonthlyReport.Name = millionsMonthlyReport.Name; newMillionsMonthlyReport.PostPersonNum = millionsMonthlyReport.PostPersonNum; newMillionsMonthlyReport.SnapPersonNum = millionsMonthlyReport.SnapPersonNum; newMillionsMonthlyReport.ContractorNum = millionsMonthlyReport.ContractorNum; newMillionsMonthlyReport.SumPersonNum = millionsMonthlyReport.SumPersonNum; newMillionsMonthlyReport.TotalWorkNum = millionsMonthlyReport.TotalWorkNum; newMillionsMonthlyReport.SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum; newMillionsMonthlyReport.SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum; newMillionsMonthlyReport.SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour; newMillionsMonthlyReport.MinorAccidentNum = millionsMonthlyReport.MinorAccidentNum; newMillionsMonthlyReport.MinorAccidentPersonNum = millionsMonthlyReport.MinorAccidentPersonNum; newMillionsMonthlyReport.MinorAccidentLossHour = millionsMonthlyReport.MinorAccidentLossHour; newMillionsMonthlyReport.OtherAccidentNum = millionsMonthlyReport.OtherAccidentNum; newMillionsMonthlyReport.OtherAccidentPersonNum = millionsMonthlyReport.OtherAccidentPersonNum; newMillionsMonthlyReport.OtherAccidentLossHour = millionsMonthlyReport.OtherAccidentLossHour; newMillionsMonthlyReport.RestrictedWorkPersonNum = millionsMonthlyReport.RestrictedWorkPersonNum; newMillionsMonthlyReport.RestrictedWorkLossHour = millionsMonthlyReport.RestrictedWorkLossHour; newMillionsMonthlyReport.MedicalTreatmentPersonNum = millionsMonthlyReport.MedicalTreatmentPersonNum; newMillionsMonthlyReport.MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour; newMillionsMonthlyReport.FireNum = millionsMonthlyReport.FireNum; newMillionsMonthlyReport.ExplosionNum = millionsMonthlyReport.ExplosionNum; newMillionsMonthlyReport.TrafficNum = millionsMonthlyReport.TrafficNum; newMillionsMonthlyReport.EquipmentNum = millionsMonthlyReport.EquipmentNum; newMillionsMonthlyReport.QualityNum = millionsMonthlyReport.QualityNum; newMillionsMonthlyReport.OtherNum = millionsMonthlyReport.OtherNum; newMillionsMonthlyReport.FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum; newMillionsMonthlyReport.AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum; newMillionsMonthlyReport.LossDayNum = millionsMonthlyReport.LossDayNum; db.SubmitChanges(); } }
/// <summary> /// 修改职工伤亡事故原因分析报表明细表 /// </summary> /// <param name="AccidentCauseReportItem">职工伤亡事故原因分析报表明细表实体</param> public static void UpdateAccidentCauseReportItem(Model.InformationProject_AccidentCauseReportItem AccidentCauseReportItem) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_AccidentCauseReportItem newAccidentCauseReportItem = db.InformationProject_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportItemId == AccidentCauseReportItem.AccidentCauseReportItemId); newAccidentCauseReportItem.AccidentType = AccidentCauseReportItem.AccidentType; newAccidentCauseReportItem.TotalDeath = AccidentCauseReportItem.TotalDeath; newAccidentCauseReportItem.TotalInjuries = AccidentCauseReportItem.TotalInjuries; newAccidentCauseReportItem.TotalMinorInjuries = AccidentCauseReportItem.TotalMinorInjuries; newAccidentCauseReportItem.Death1 = AccidentCauseReportItem.Death1; newAccidentCauseReportItem.Injuries1 = AccidentCauseReportItem.Injuries1; newAccidentCauseReportItem.MinorInjuries1 = AccidentCauseReportItem.MinorInjuries1; newAccidentCauseReportItem.Death2 = AccidentCauseReportItem.Death2; newAccidentCauseReportItem.Injuries2 = AccidentCauseReportItem.Injuries2; newAccidentCauseReportItem.MinorInjuries2 = AccidentCauseReportItem.MinorInjuries2; newAccidentCauseReportItem.Death3 = AccidentCauseReportItem.Death3; newAccidentCauseReportItem.Injuries3 = AccidentCauseReportItem.Injuries3; newAccidentCauseReportItem.MinorInjuries3 = AccidentCauseReportItem.MinorInjuries3; newAccidentCauseReportItem.Death4 = AccidentCauseReportItem.Death4; newAccidentCauseReportItem.Injuries4 = AccidentCauseReportItem.Injuries4; newAccidentCauseReportItem.MinorInjuries4 = AccidentCauseReportItem.MinorInjuries4; newAccidentCauseReportItem.Death5 = AccidentCauseReportItem.Death5; newAccidentCauseReportItem.Injuries5 = AccidentCauseReportItem.Injuries5; newAccidentCauseReportItem.MinorInjuries5 = AccidentCauseReportItem.MinorInjuries5; newAccidentCauseReportItem.Death6 = AccidentCauseReportItem.Death6; newAccidentCauseReportItem.Injuries6 = AccidentCauseReportItem.Injuries6; newAccidentCauseReportItem.MinorInjuries6 = AccidentCauseReportItem.MinorInjuries6; newAccidentCauseReportItem.Death7 = AccidentCauseReportItem.Death7; newAccidentCauseReportItem.Injuries7 = AccidentCauseReportItem.Injuries7; newAccidentCauseReportItem.MinorInjuries7 = AccidentCauseReportItem.MinorInjuries7; newAccidentCauseReportItem.Death8 = AccidentCauseReportItem.Death8; newAccidentCauseReportItem.Injuries8 = AccidentCauseReportItem.Injuries8; newAccidentCauseReportItem.MinorInjuries8 = AccidentCauseReportItem.MinorInjuries8; newAccidentCauseReportItem.Death9 = AccidentCauseReportItem.Death9; newAccidentCauseReportItem.Injuries9 = AccidentCauseReportItem.Injuries9; newAccidentCauseReportItem.MinorInjuries9 = AccidentCauseReportItem.MinorInjuries9; newAccidentCauseReportItem.Death10 = AccidentCauseReportItem.Death10; newAccidentCauseReportItem.Injuries10 = AccidentCauseReportItem.Injuries10; newAccidentCauseReportItem.MinorInjuries10 = AccidentCauseReportItem.MinorInjuries10; newAccidentCauseReportItem.Death11 = AccidentCauseReportItem.Death11; newAccidentCauseReportItem.Injuries11 = AccidentCauseReportItem.Injuries11; newAccidentCauseReportItem.MinorInjuries11 = AccidentCauseReportItem.MinorInjuries11; db.SubmitChanges(); }
/// <summary> /// 添加企业安全管理资料计划总表 /// </summary> /// <param name="SafetyDataEPlan"></param> public static void AddSafetyDataEPlan(Model.SafetyDataE_SafetyDataEPlan SafetyDataEPlan) { Model.SUBHSSEDB db = Funs.DB; Model.SafetyDataE_SafetyDataEPlan newSafetyDataEPlan = new Model.SafetyDataE_SafetyDataEPlan { SafetyDataEPlanId = SafetyDataEPlan.SafetyDataEPlanId, ProjectId = SafetyDataEPlan.ProjectId, SafetyDataEId = SafetyDataEPlan.SafetyDataEId, CheckDate = SafetyDataEPlan.CheckDate, Score = SafetyDataEPlan.Score, ShouldScore = SafetyDataEPlan.ShouldScore, Remark = SafetyDataEPlan.Remark, ReminderDate = SafetyDataEPlan.ReminderDate, IsManual = SafetyDataEPlan.IsManual, States = SafetyDataEPlan.States, }; db.SafetyDataE_SafetyDataEPlan.InsertOnSubmit(newSafetyDataEPlan); db.SubmitChanges(); }
/// <summary> /// 添加方案模板 /// </summary> /// <param name="solutionTemplate"></param> public static void AddSolutionTemplate(Model.Solution_SolutionTemplate solutionTemplate) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_SolutionTemplate newSolutionTemplate = new Model.Solution_SolutionTemplate { SolutionTemplateId = solutionTemplate.SolutionTemplateId, ProjectId = solutionTemplate.ProjectId, SolutionTemplateCode = solutionTemplate.SolutionTemplateCode, SolutionTemplateName = solutionTemplate.SolutionTemplateName, SolutionTemplateType = solutionTemplate.SolutionTemplateType, FileContents = solutionTemplate.FileContents, CompileMan = solutionTemplate.CompileMan, CompileDate = solutionTemplate.CompileDate }; db.Solution_SolutionTemplate.InsertOnSubmit(newSolutionTemplate); db.SubmitChanges(); //暂时不取统一编号,自己手动编号 //CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.SolutionTemplateMenuId, newSolutionTemplate.ProjectId, null, solutionTemplate.SolutionTemplateId, solutionTemplate.CompileDate); }
/// <summary> /// 添加HAZOP /// </summary> /// <param name="hazop"></param> public static void AddHAZOP(Model.Technique_HAZOP hazop) { Model.SUBHSSEDB db = Funs.DB; Model.Technique_HAZOP newHAZOP = new Model.Technique_HAZOP { HAZOPId = hazop.HAZOPId, UnitId = hazop.UnitId, HAZOPTitle = hazop.HAZOPTitle, Abstract = hazop.Abstract, HAZOPDate = hazop.HAZOPDate, AttachUrl = hazop.AttachUrl, CompileMan = hazop.CompileMan, CompileDate = hazop.CompileDate, IsPass = hazop.IsPass, UpState = hazop.UpState }; db.Technique_HAZOP.InsertOnSubmit(newHAZOP); db.SubmitChanges(); }
/// <summary> /// 修改安全日常巡检 /// </summary> /// <param name="checkDay"></param> public static void UpdateCheckDay(Model.Check_CheckDayXA checkDay) { Model.SUBHSSEDB db = Funs.DB; Model.Check_CheckDayXA newCheckDay = db.Check_CheckDayXA.FirstOrDefault(e => e.CheckDayId == checkDay.CheckDayId); if (newCheckDay != null) { newCheckDay.CheckDayCode = checkDay.CheckDayCode; newCheckDay.NotOKNum = checkDay.NotOKNum; newCheckDay.DutyUnitIds = checkDay.DutyUnitIds; newCheckDay.DutyTeamGroupIds = checkDay.DutyTeamGroupIds; newCheckDay.WorkAreaIds = checkDay.WorkAreaIds; newCheckDay.Unqualified = checkDay.Unqualified; newCheckDay.CheckDate = checkDay.CheckDate; newCheckDay.HandleStation = checkDay.HandleStation; newCheckDay.IsOK = checkDay.IsOK; newCheckDay.States = checkDay.States; db.SubmitChanges(); } }
/// <summary> /// 根据月报告主键删除一个月报告信息 /// </summary> /// <param name="monthReportId">月报告主键</param> public static void DeleteMonthReportByMonthReportId(string monthReportId) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_MonthReportD monthReport = db.Manager_MonthReportD.FirstOrDefault(e => e.MonthReportId == monthReportId); if (monthReport != null) { ///删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(monthReportId); BLL.CommonService.DeleteAttachFileById(monthReportId);//删除附件 //BLL.MonthSafetyRecordDService.DeleteMonthSafetyRecordDByMonthReportId(monthReportId); //BLL.MonthSummaryDService.DeleteMonthSummaryDByMonthReportId(monthReportId); //BLL.HSSEMeetingDService.DeleteHSSEMeetingDByMonthReportId(monthReportId); BLL.SafetyDataDService.DeleteSafetyDataDByMonthReportId(monthReportId); //BLL.EnvironmentalHealthMonthlyDService.DeleteEnvironmentalHealthMonthlyDByMonthReportId(monthReportId); //BLL.CheckDayRecordDService.DeleteCheckDayRecordDByMonthReportId(monthReportId); db.Manager_MonthReportD.DeleteOnSubmit(monthReport); db.SubmitChanges(); } }
/// <summary> /// 增加月报告信息 /// </summary> /// <param name="monthReport">月报告实体</param> public static void AddMonthReport(Model.Manager_MonthReportD monthReport) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_MonthReportD newMonthReport = new Model.Manager_MonthReportD { MonthReportId = monthReport.MonthReportId, MonthReportCode = monthReport.MonthReportCode, ProjectId = monthReport.ProjectId, Months = monthReport.Months, MonthReportDate = monthReport.MonthReportDate, ReportMan = monthReport.ReportMan, States = monthReport.States }; db.Manager_MonthReportD.InsertOnSubmit(newMonthReport); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectManagerMonthCMenuId, monthReport.ProjectId, null, monthReport.MonthReportId, monthReport.MonthReportDate); }
/// <summary> /// 修改法律法规辨识信息 /// </summary> /// <param name="lawRegulationIdentify">法律法规辨识实体</param> public static void UpdateLawRegulationIdentify(Model.Law_LawRegulationIdentify lawRegulationIdentify) { Model.SUBHSSEDB db = Funs.DB; Model.Law_LawRegulationIdentify newLawRegulationIdentify = db.Law_LawRegulationIdentify.FirstOrDefault(e => e.LawRegulationIdentifyId == lawRegulationIdentify.LawRegulationIdentifyId); if (newLawRegulationIdentify != null) { newLawRegulationIdentify.VersionNumber = lawRegulationIdentify.VersionNumber; newLawRegulationIdentify.ProjectId = lawRegulationIdentify.ProjectId; newLawRegulationIdentify.IdentifyPerson = lawRegulationIdentify.IdentifyPerson; newLawRegulationIdentify.IdentifyDate = lawRegulationIdentify.IdentifyDate; newLawRegulationIdentify.ManagerContent = lawRegulationIdentify.ManagerContent; newLawRegulationIdentify.IdentifyConclude = lawRegulationIdentify.IdentifyConclude; newLawRegulationIdentify.States = lawRegulationIdentify.States; newLawRegulationIdentify.GroupMember = lawRegulationIdentify.GroupMember; newLawRegulationIdentify.Remark = lawRegulationIdentify.Remark; newLawRegulationIdentify.UpdateDate = lawRegulationIdentify.UpdateDate; db.SubmitChanges(); } }
/// <summary> /// 增加月报告HSE检查明细情况信息 /// </summary> /// <param name="checkSort">月报告HSE检查明细情况实体</param> public static void AddCheckDetailSort(Model.Manager_CheckDetailSortC checkSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_CheckDetailSortC)); Model.Manager_CheckDetailSortC newCheckDetailSort = new Model.Manager_CheckDetailSortC { CheckDetailSortId = newKeyID, MonthReportId = checkSort.MonthReportId, SortIndex = checkSort.SortIndex, CheckType = checkSort.CheckType, CheckTime = checkSort.CheckTime, JoinUnit = checkSort.JoinUnit, StateDef = checkSort.StateDef }; db.Manager_CheckDetailSortC.InsertOnSubmit(newCheckDetailSort); db.SubmitChanges(); }
/// <summary> /// 添加四不放过 /// </summary> /// <param name="noFourLetoff"></param> public static void AddNoFourLetoff(Model.Accident_NoFourLetoff noFourLetoff) { Model.SUBHSSEDB db = Funs.DB; Model.Accident_NoFourLetoff newNoFourLetoff = new Model.Accident_NoFourLetoff { NoFourLetoffId = noFourLetoff.NoFourLetoffId, ProjectId = noFourLetoff.ProjectId, AccidentHandleId = noFourLetoff.AccidentHandleId, NoFourLetoffCode = noFourLetoff.NoFourLetoffCode, UnitId = noFourLetoff.UnitId, AccidentDate = noFourLetoff.AccidentDate, FileContents = noFourLetoff.FileContents, RegistUnitId = noFourLetoff.RegistUnitId, HeadMan = noFourLetoff.HeadMan, RegistDate = noFourLetoff.RegistDate }; db.Accident_NoFourLetoff.InsertOnSubmit(newNoFourLetoff); db.SubmitChanges(); }
/// <summary> /// 增加月报告应急演练信息 /// </summary> /// <param name="checkSort">月报告应急演练实体</param> public static void AddDrillSort(Model.Manager_DrillSortC checkSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_DrillSortC)); Model.Manager_DrillSortC newDrillSort = new Model.Manager_DrillSortC { DrillSortId = newKeyID, MonthReportId = checkSort.MonthReportId, SortIndex = checkSort.SortIndex, DrillContent = checkSort.DrillContent, DrillDate = checkSort.DrillDate, JointUnit = checkSort.JointUnit, JoinPerson = checkSort.JoinPerson }; db.Manager_DrillSortC.InsertOnSubmit(newDrillSort); db.SubmitChanges(); }
/// <summary> /// 菜单编码模板信息 /// </summary> /// <param name="codeTemplateRule"></param> public static void AddCodeTemplateRule(Model.Sys_CodeTemplateRule codeTemplateRule) { Model.SUBHSSEDB db = Funs.DB; Model.Sys_CodeTemplateRule newCodeTemplateRule = new Model.Sys_CodeTemplateRule { CodeTemplateRuleId = SQLHelper.GetNewID(typeof(Model.Sys_CodeTemplateRule)), MenuId = codeTemplateRule.MenuId, Template = codeTemplateRule.Template, Symbol = codeTemplateRule.Symbol, IsProjectCode = codeTemplateRule.IsProjectCode, Prefix = codeTemplateRule.Prefix, IsUnitCode = codeTemplateRule.IsUnitCode, Digit = codeTemplateRule.Digit, IsFileCabinetA = codeTemplateRule.IsFileCabinetA, IsFileCabinetB = codeTemplateRule.IsFileCabinetB }; db.Sys_CodeTemplateRule.InsertOnSubmit(newCodeTemplateRule); db.SubmitChanges(); }
/// <summary> /// 修改一般设备机具入场报批 /// </summary> /// <param name="GeneralGeneralEquipmentIn"></param> public static void UpdateGeneralEquipmentIn(Model.InApproveManager_GeneralEquipmentIn generalEquipmentIn) { Model.SUBHSSEDB db = Funs.DB; Model.InApproveManager_GeneralEquipmentIn newGeneralEquipmentIn = db.InApproveManager_GeneralEquipmentIn.FirstOrDefault(e => e.GeneralEquipmentInId == generalEquipmentIn.GeneralEquipmentInId); if (newGeneralEquipmentIn != null) { //newGeneralEquipmentIn.ProjectId = generalEquipmentIn.ProjectId; newGeneralEquipmentIn.GeneralEquipmentInCode = generalEquipmentIn.GeneralEquipmentInCode; newGeneralEquipmentIn.UnitId = generalEquipmentIn.UnitId; newGeneralEquipmentIn.CarNumber = generalEquipmentIn.CarNumber; newGeneralEquipmentIn.SubProjectName = generalEquipmentIn.SubProjectName; newGeneralEquipmentIn.ContentDef = generalEquipmentIn.ContentDef; newGeneralEquipmentIn.OtherDef = generalEquipmentIn.OtherDef; newGeneralEquipmentIn.State = generalEquipmentIn.State; newGeneralEquipmentIn.CompileMan = generalEquipmentIn.CompileMan; newGeneralEquipmentIn.CompileDate = generalEquipmentIn.CompileDate; db.SubmitChanges(); } }
/// <summary> /// 增加月报告事故台账信息 /// </summary> /// <param name="accidentSort">月报告事故台账实体</param> public static void AddAccidentDetailSort(Model.Manager_AccidentDetailSortB accidentSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_AccidentDetailSortB)); Model.Manager_AccidentDetailSortB newAccidentSort = new Model.Manager_AccidentDetailSortB { AccidentDetailSortId = newKeyID, MonthReportId = accidentSort.MonthReportId, Abstract = accidentSort.Abstract, AccidentType = accidentSort.AccidentType, PeopleNum = accidentSort.PeopleNum, WorkingHoursLoss = accidentSort.WorkingHoursLoss, EconomicLoss = accidentSort.EconomicLoss, AccidentDate = accidentSort.AccidentDate }; db.Manager_AccidentDetailSortB.InsertOnSubmit(newAccidentSort); db.SubmitChanges(); }
/// <summary> /// 增加月报告危险源信息 /// </summary> /// <param name="checkSort">月报告危险源实体</param> public static void AddHazardSort(Model.Manager_HazardSortC checkSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_HazardSortC)); Model.Manager_HazardSortC newHazardSort = new Model.Manager_HazardSortC { HazardSortId = newKeyID, MonthReportId = checkSort.MonthReportId, SortIndex = checkSort.SortIndex, HazardName = checkSort.HazardName, UnitAndArea = checkSort.UnitAndArea, StationDef = checkSort.StationDef, HandleWay = checkSort.HandleWay }; db.Manager_HazardSortC.InsertOnSubmit(newHazardSort); db.SubmitChanges(); }
/// <summary> /// 根据主键删除安全生产数据季报 /// </summary> /// <param name="safetyQuarterlyReportId"></param> public static void DeleteSafetyQuarterlyReportById(string safetyQuarterlyReportId) { Model.SUBHSSEDB db = Funs.DB; Model.InformationProject_SafetyQuarterlyReport safetyQuarterlyReport = db.InformationProject_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReportId); if (safetyQuarterlyReport != null) { if (!string.IsNullOrEmpty(safetyQuarterlyReport.FullTimeManAttachUrl)) { BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.FullTimeManAttachUrl); } if (!string.IsNullOrEmpty(safetyQuarterlyReport.PMManAttachUrl)) { BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.PMManAttachUrl); } CommonService.DeleteFlowOperateByID(safetyQuarterlyReportId); db.InformationProject_SafetyQuarterlyReport.DeleteOnSubmit(safetyQuarterlyReport); db.SubmitChanges(); } }
/// <summary> /// 添加安全试题库明细信息 /// </summary> /// <param name="trainTestDBItem"></param> public static void AddTrainTestDBItem(Model.Training_TrainTestDBItem trainTestDBItem) { Model.SUBHSSEDB db = Funs.DB; Model.Training_TrainTestDBItem newTrainTestDBItem = new Model.Training_TrainTestDBItem { TrainTestItemId = trainTestDBItem.TrainTestItemId, TrainTestId = trainTestDBItem.TrainTestId, TrainTestItemCode = trainTestDBItem.TrainTestItemCode, TraiinTestItemName = trainTestDBItem.TraiinTestItemName, AttachUrl = trainTestDBItem.AttachUrl, CompileMan = trainTestDBItem.CompileMan, CompileDate = trainTestDBItem.CompileDate, IsPass = trainTestDBItem.IsPass, UnitId = trainTestDBItem.UnitId, UpState = trainTestDBItem.UpState }; db.Training_TrainTestDBItem.InsertOnSubmit(newTrainTestDBItem); db.SubmitChanges(); }
/// <summary> /// 添加工作总结 /// </summary> /// <param name="managerTotal"></param> public static void AddManagerTotal(Model.Manager_ManagerTotal managerTotal) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_ManagerTotal newManagerTotal = new Model.Manager_ManagerTotal { ManagerTotalId = managerTotal.ManagerTotalId, ProjectId = managerTotal.ProjectId, ManagerTotalCode = managerTotal.ManagerTotalCode, ManagerTotalName = managerTotal.ManagerTotalName, FileContent = managerTotal.FileContent, CompileMan = managerTotal.CompileMan, CompileDate = managerTotal.CompileDate, States = managerTotal.States }; db.Manager_ManagerTotal.InsertOnSubmit(newManagerTotal); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectManagerTotalMenuId, managerTotal.ProjectId, null, managerTotal.ManagerTotalId, managerTotal.CompileDate); }
/// <summary> /// 添加工程现场环境与职业健康月报 /// </summary> /// <param name="health"></param> public static void AddHealth(Model.Manager_Health health) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Health newHealth = new Model.Manager_Health { HealthId = health.HealthId, ProjectId = health.ProjectId, HealthCode = health.HealthCode, HealthName = health.HealthName, FileContent = health.FileContent, CompileMan = health.CompileMan, CompileDate = health.CompileDate, States = health.States }; db.Manager_Health.InsertOnSubmit(newHealth); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.HealthMenuId, health.ProjectId, null, health.HealthId, health.CompileDate); }
/// <summary> /// 增加月报告应急预案信息 /// </summary> /// <param name="checkSort">月报告应急预案实体</param> public static void AddEmergencySort(Model.Manager_EmergencySortC checkSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_EmergencySortC)); Model.Manager_EmergencySortC newEmergencySort = new Model.Manager_EmergencySortC { EmergencySortId = newKeyID, MonthReportId = checkSort.MonthReportId, SortIndex = checkSort.SortIndex, EmergencyName = checkSort.EmergencyName, ModefyPerson = checkSort.ModefyPerson, ReleaseDate = checkSort.ReleaseDate, StateRef = checkSort.StateRef }; db.Manager_EmergencySortC.InsertOnSubmit(newEmergencySort); db.SubmitChanges(); }
/// <summary> /// 修改安全技术交底 /// </summary> /// <param name="hSETechnical"></param> public static void UpdateHSETechnical(Model.License_HSETechnical hseTechnical) { Model.SUBHSSEDB db = Funs.DB; Model.License_HSETechnical newHSETechnical = db.License_HSETechnical.FirstOrDefault(e => e.HSETechnicalId == hseTechnical.HSETechnicalId); if (newHSETechnical != null) { //newHSETechnical.ProjectId = hseTechnical.ProjectId; newHSETechnical.HSETechnicalCode = hseTechnical.HSETechnicalCode; newHSETechnical.HSETechnicalDate = hseTechnical.HSETechnicalDate; newHSETechnical.UnitId = hseTechnical.UnitId; newHSETechnical.TeamGroupId = hseTechnical.TeamGroupId; newHSETechnical.WorkContents = hseTechnical.WorkContents; newHSETechnical.Address = hseTechnical.Address; newHSETechnical.CompileMan = hseTechnical.CompileMan; newHSETechnical.CompileDate = hseTechnical.CompileDate; newHSETechnical.States = hseTechnical.States; db.SubmitChanges(); } }
/// <summary> /// 添加安全文件 /// </summary> /// <param name="SafeReport">安全文件实体</param> public static void AddSafeReport(Model.Manager_SafeReport SafeReport) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_SafeReport newSafeReport = new Model.Manager_SafeReport { SafeReportId = SafeReport.SafeReportId, SafeReportCode = SafeReport.SafeReportCode, SafeReportName = SafeReport.SafeReportName, SupSafeReportId = SafeReport.SupSafeReportId, Requirement = SafeReport.Requirement, RequestTime = SafeReport.RequestTime, CompileManId = SafeReport.CompileManId, CompileTime = SafeReport.CompileTime, IsEndLever = SafeReport.IsEndLever, States = SafeReport.States }; db.Manager_SafeReport.InsertOnSubmit(newSafeReport); db.SubmitChanges(); }
/// <summary> /// 根据主键删除企业安全管理资料考核项目 /// </summary> /// <param name="SafetyDataCheckItemId"></param> public static void DeleteSafetyDataCheckProjectByProjectId(string projectId) { Model.SUBHSSEDB db = Funs.DB; var SafetyDataCheckProject = from x in db.SafetyData_SafetyDataCheckProject where x.ProjectId == projectId select x; if (SafetyDataCheckProject.Count() > 0) { foreach (var item in SafetyDataCheckProject) { var safetyDataCheckItem = from x in db.SafetyData_SafetyDataCheckItem where x.SafetyDataCheckProjectId == item.SafetyDataCheckProjectId select x; if (safetyDataCheckItem.Count() > 0) { db.SafetyData_SafetyDataCheckItem.DeleteAllOnSubmit(safetyDataCheckItem); } } db.SafetyData_SafetyDataCheckProject.DeleteAllOnSubmit(SafetyDataCheckProject); db.SubmitChanges(); } }
/// <summary> /// 增加开工前检查明细信息 /// </summary> /// <param name="checkWorkDetail"></param> public static void AddCheckWorkDetail(Model.Check_CheckWorkDetail checkWorkDetail) { Model.SUBHSSEDB db = Funs.DB; Model.Check_CheckWorkDetail newCheckWorkDetail = new Model.Check_CheckWorkDetail { CheckWorkDetailId = checkWorkDetail.CheckWorkDetailId, CheckWorkId = checkWorkDetail.CheckWorkId, CheckItem = checkWorkDetail.CheckItem, CheckResult = checkWorkDetail.CheckResult, CheckOpinion = checkWorkDetail.CheckOpinion, CheckStation = checkWorkDetail.CheckStation, HandleResult = checkWorkDetail.HandleResult, CheckContent = checkWorkDetail.CheckContent, WorkArea = checkWorkDetail.WorkArea, SortIndex = checkWorkDetail.SortIndex, }; db.Check_CheckWorkDetail.InsertOnSubmit(newCheckWorkDetail); db.SubmitChanges(); }