/// <summary> /// 项目图片信息保存方法 /// </summary> /// <param name="picture">图片信息</param> public static void SaveProjectPicture(Model.PictureItem picture) { Model.InformationProject_Picture newPicture = new Model.InformationProject_Picture { PictureId = picture.PictureId, ProjectId = picture.ProjectId, Title = picture.Title, ContentDef = picture.ContentDef, PictureType = picture.PictureTypeId, UploadDate = System.DateTime.Now, States = Const.State_2, CompileMan = picture.CompileManId, }; if (string.IsNullOrEmpty(newPicture.PictureId)) { newPicture.PictureId = SQLHelper.GetNewID(); PictureService.AddPicture(newPicture); } else { PictureService.UpdatePicture(newPicture); } CommonService.btnSaveData(newPicture.ProjectId, Const.ProjectPictureMenuId, newPicture.PictureId, newPicture.CompileMan, true, newPicture.Title, "../InformationProject/PictureView.aspx?PictureId={0}"); //// 保存附件 APIUpLoadFileService.SaveAttachUrl(Const.ProjectPictureMenuId, newPicture.PictureId, picture.AttachUrl, "0"); }
/// <summary> /// 获取HSE日志信息 /// </summary> /// <param name="projectId"></param> /// <param name="userId"></param> /// <param name="diaryDate"></param> /// <returns></returns> public static Model.HSEDiaryItem getHSEDiary(string projectId, string userId, string diaryDate) { DateTime?getDiaryDate = Funs.GetNewDateTime(diaryDate); Model.HSEDiaryItem getItem = new Model.HSEDiaryItem(); if (getDiaryDate.HasValue && !string.IsNullOrEmpty(projectId) && !string.IsNullOrEmpty(userId)) { var getFlowOperteList = ReturnFlowOperteList(projectId, userId, getDiaryDate.Value); getItem.ProjectId = projectId; getItem.UserId = userId; getItem.UserName = UserService.GetUserNameByUserId(userId); getItem.DiaryDate = diaryDate; getItem.HSEDiaryId = SQLHelper.GetNewID(); getItem.Value1 = getValues1(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value2 = getValues2(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value3 = getValues3(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value4 = getValues4(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value5 = getValues5(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value6 = getValues6(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value7 = getValues7(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value8 = getValues8(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value9 = getValues9(getFlowOperteList, projectId, userId, getDiaryDate.Value); getItem.Value10 = getValues10(getFlowOperteList, projectId, userId, getDiaryDate.Value); var getInfo = Funs.DB.Project_HSEDiary.FirstOrDefault(x => x.UserId == userId && x.DiaryDate == getDiaryDate); if (getInfo != null) { getItem.HSEDiaryId = getInfo.HSEDiaryId; getItem.DailySummary = getInfo.DailySummary; getItem.TomorrowPlan = getInfo.TomorrowPlan; } } return(getItem); }
/// <summary> /// 项目地图信息保存方法 /// </summary> /// <param name="projectMap">地图信息</param> public static void SaveProjectMap(Model.PictureItem projectMap) { Model.InformationProject_ProjectMap newProjectMap = new Model.InformationProject_ProjectMap { ProjectMapId = projectMap.PictureId, ProjectId = projectMap.ProjectId, Title = projectMap.Title, ContentDef = projectMap.ContentDef, MapType = projectMap.PictureTypeId, UploadDate = System.DateTime.Now, CompileMan = projectMap.CompileManId, }; if (string.IsNullOrEmpty(newProjectMap.ProjectMapId)) { newProjectMap.ProjectMapId = SQLHelper.GetNewID(); ProjectMapService.AddProjectMap(newProjectMap); } else { ProjectMapService.UpdateProjectMap(newProjectMap); } //// 保存附件 APIUpLoadFileService.SaveAttachUrl(Const.ProjectProjectMapMenuId, newProjectMap.ProjectMapId, projectMap.AttachUrl, "0"); }
/// <summary> /// 增加月报告HSE检查情况信息 /// </summary> /// <param name="checkSort">月报告HSE检查情况实体</param> public static void AddCheckSort(Model.Manager_CheckSort checkSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_CheckSort)); Model.Manager_CheckSort newCheckSort = new Model.Manager_CheckSort { CheckSortId = newKeyID, MonthReportId = checkSort.MonthReportId, CheckNumber01 = checkSort.CheckNumber01, CheckNumber02 = checkSort.CheckNumber02, CheckNumber03 = checkSort.CheckNumber03, CheckNumber04 = checkSort.CheckNumber04, CheckNumber11 = checkSort.CheckNumber11, CheckNumber12 = checkSort.CheckNumber12, CheckNumber13 = checkSort.CheckNumber13, CheckNumber14 = checkSort.CheckNumber14, CheckNumber21 = checkSort.CheckNumber21, CheckNumber22 = checkSort.CheckNumber22, CheckNumber23 = checkSort.CheckNumber23, CheckNumber24 = checkSort.CheckNumber24, CheckNumber31 = checkSort.CheckNumber31, CheckNumber32 = checkSort.CheckNumber32, CheckNumber33 = checkSort.CheckNumber33, CheckNumber34 = checkSort.CheckNumber34 }; db.Manager_CheckSort.InsertOnSubmit(newCheckSort); db.SubmitChanges(); }
/// <summary> /// 保存HSE日志 /// </summary> /// <param name="item"></param> public static void SaveHSEDiary(Model.HSEDiaryItem item) { DeleteHSEDiary(item.HSEDiaryId); using (Model.SUBHSSEDB db = new Model.SUBHSSEDB(Funs.ConnString)) { Model.Project_HSEDiary newHSEDiary = new Model.Project_HSEDiary { HSEDiaryId = item.HSEDiaryId, ProjectId = item.ProjectId, DiaryDate = Funs.GetNewDateTime(item.DiaryDate), UserId = item.UserId, DailySummary = item.DailySummary, TomorrowPlan = item.TomorrowPlan, Value1 = item.Value1, Value2 = item.Value2, Value3 = item.Value3, Value4 = item.Value4, Value5 = item.Value5, Value6 = item.Value6, Value7 = item.Value7, Value8 = item.Value8, Value9 = item.Value9, Value10 = item.Value10, }; if (string.IsNullOrEmpty(newHSEDiary.HSEDiaryId)) { newHSEDiary.HSEDiaryId = SQLHelper.GetNewID(); } db.Project_HSEDiary.InsertOnSubmit(newHSEDiary); db.SubmitChanges(); } }
/// <summary> /// 增加人员信息 /// </summary> /// <param name="user">人员实体</param> public static void AddUser(Model.Sys_User user) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Sys_User)); Model.Sys_User newUser = new Model.Sys_User { UserId = newKeyID, Account = user.Account, UserName = user.UserName, UserCode = user.UserCode, Password = user.Password, UnitId = user.UnitId, RoleId = user.RoleId, IsPost = user.IsPost, IdentityCard = user.IdentityCard, IsPosts = true, IsReplies = true, IsDeletePosts = true, PageSize = 10, IsOffice = user.IsOffice, Telephone = user.Telephone, DataSources = user.DataSources, SignatureUrl = user.SignatureUrl, DepartId = user.DepartId, }; db.Sys_User.InsertOnSubmit(newUser); db.SubmitChanges(); }
/// <summary> /// 增加月报告HSE检查情况信息 /// </summary> /// <param name="hseSort">月报告HSE检查情况实体</param> public static void AddHseSort(Model.Manager_HseCost hseSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_HseCost)); Model.Manager_HseCost newHseSort = new Model.Manager_HseCost { HseCostId = newKeyID, MonthReportId = hseSort.MonthReportId, HseNumber01 = hseSort.HseNumber01, HseNumber02 = hseSort.HseNumber02, HseNumber03 = hseSort.HseNumber03, HseNumber04 = hseSort.HseNumber04, HseNumber05 = hseSort.HseNumber05, HseNumber06 = hseSort.HseNumber06, HseNumber07 = hseSort.HseNumber07, HseNumber08 = hseSort.HseNumber08, HseNumber09 = hseSort.HseNumber09, HseNumber00 = hseSort.HseNumber00, HseNumber10 = hseSort.HseNumber10, HseNumber11 = hseSort.HseNumber11, SpecialNumber = hseSort.SpecialNumber }; db.Manager_HseCost.InsertOnSubmit(newHseSort); db.SubmitChanges(); }
/// <summary> /// 增加教育培训明细信息 /// </summary> /// <param name="trainDetail">教育培训明细信息实体</param> public static void AddTrainDetail(Model.EduTrain_TrainRecordDetail trainDetail) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.EduTrain_TrainRecordDetail)); Model.EduTrain_TrainRecordDetail newTrainDetail = new Model.EduTrain_TrainRecordDetail { TrainDetailId = newKeyID, TrainingId = trainDetail.TrainingId, PersonId = trainDetail.PersonId, CheckScore = trainDetail.CheckScore, CheckResult = trainDetail.CheckResult }; db.EduTrain_TrainRecordDetail.InsertOnSubmit(newTrainDetail); db.SubmitChanges(); var rainRecord = EduTrain_TrainRecordService.GetTrainingByTrainingId(trainDetail.TrainingId); if (rainRecord != null) { rainRecord.TrainPersonNum += 1; EduTrain_TrainRecordService.UpdateTraining(rainRecord); } ///// 培训考试 通过 更新卡号 if (newTrainDetail.CheckResult) { var getPerson = PersonService.GetPersonById(trainDetail.PersonId); if (getPerson != null && string.IsNullOrEmpty(getPerson.CardNo)) { getPerson.CardNo = SQLHelper.RunProcNewId("SpGetNewNumber", "SitePerson_Person", "CardNo", rainRecord.ProjectId, UnitService.GetUnitCodeByUnitId(getPerson.UnitId)); } } }
/// <summary> /// 根据TestRecord生成一条补考记录 /// </summary> /// <param name="testRecord"></param> public static string getResitTestRecord(Model.Training_TestRecord getTestRecord) { Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord { TestRecordId = SQLHelper.GetNewID(), ProjectId = getTestRecord.ProjectId, TestPlanId = getTestRecord.TestPlanId, TestManId = getTestRecord.TestManId, TestType = getTestRecord.TestType, TemporaryUser = getTestRecord.TemporaryUser, Duration = getTestRecord.Duration, // TestStartTime = DateTime.Now, }; Funs.DB.Training_TestRecord.InsertOnSubmit(newTestRecord); Funs.SubmitChanges(); var getTestPlan = Funs.DB.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId); var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId); if (getTestPlan != null && person != null) { CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person); } return(newTestRecord.TestRecordId); }
/// <summary> /// 增加月报告HSE奖惩情况信息 /// </summary> /// <param name="incentiveSort">月报告HSE奖惩情况实体</param> public static void AddIncentiveSort(Model.Manager_IncentiveSort incentiveSort) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_IncentiveSort)); Model.Manager_IncentiveSort newIncentiveSort = new Model.Manager_IncentiveSort { IncentiveSortId = newKeyID, MonthReportId = incentiveSort.MonthReportId, IncentiveNumber01 = incentiveSort.IncentiveNumber01, IncentiveNumber02 = incentiveSort.IncentiveNumber02, IncentiveNumber03 = incentiveSort.IncentiveNumber03, IncentiveNumber04 = incentiveSort.IncentiveNumber04, IncentiveNumber05 = incentiveSort.IncentiveNumber05, IncentiveNumber06 = incentiveSort.IncentiveNumber06, IncentiveNumber07 = incentiveSort.IncentiveNumber07, IncentiveNumber11 = incentiveSort.IncentiveNumber11, IncentiveNumber12 = incentiveSort.IncentiveNumber12, IncentiveNumber13 = incentiveSort.IncentiveNumber13, IncentiveNumber14 = incentiveSort.IncentiveNumber14, IncentiveNumber15 = incentiveSort.IncentiveNumber15, IncentiveNumber16 = incentiveSort.IncentiveNumber16, IncentiveNumber17 = incentiveSort.IncentiveNumber17 }; db.Manager_IncentiveSort.InsertOnSubmit(newIncentiveSort); db.SubmitChanges(); }
/// <summary> /// 新增 考试教材类型 明细 /// </summary> public static void AddTrainingTestPlanTraining(List <Model.TestPlanTrainingItem> TestPlanItems, string testPlanId) { using (Model.SUBHSSEDB db = new Model.SUBHSSEDB(Funs.ConnString)) { foreach (var item in TestPlanItems) { var trainingType = db.Training_TestTraining.FirstOrDefault(e => e.TrainingId == item.TrainingTypeId); if (trainingType != null) { Model.Training_TestPlanTraining newPlanItem = new Model.Training_TestPlanTraining { TestPlanTrainingId = SQLHelper.GetNewID(), TestPlanId = testPlanId, TrainingId = item.TrainingTypeId, TestType1Count = item.TestType1Count, TestType2Count = item.TestType2Count, TestType3Count = item.TestType3Count, }; db.Training_TestPlanTraining.InsertOnSubmit(newPlanItem); db.SubmitChanges(); } } } }
/// <summary> /// 保存作业票-流程审核 /// </summary> /// <param name="flowOperate">流程审核集合</param> /// <returns></returns> public static void SaveFlowOperate(Model.FlowOperateItem flowOperate) { var getFlowOperate = LicensePublicService.GetFlowOperateById(flowOperate.FlowOperateId); if (getFlowOperate != null) { getFlowOperate.OperaterId = flowOperate.OperaterId; getFlowOperate.OperaterTime = System.DateTime.Now; getFlowOperate.IsAgree = flowOperate.IsAgree; getFlowOperate.Opinion = flowOperate.Opinion; getFlowOperate.IsClosed = flowOperate.IsAgree;///同意时,当前流程关闭;不同意则返回申请人。 LicensePublicService.UpdateFlowOperate(getFlowOperate); Model.License_FlowOperateItem newFlowOperateItem = new Model.License_FlowOperateItem { FlowOperateItemId = SQLHelper.GetNewID(), FlowOperateId = getFlowOperate.FlowOperateId, OperaterId = getFlowOperate.OperaterId, OperaterTime = getFlowOperate.OperaterTime, IsAgree = getFlowOperate.IsAgree, Opinion = getFlowOperate.Opinion, }; LicensePublicService.AddFlowOperateItem(newFlowOperateItem); } }
/// <summary> /// 保存附件 /// </summary> /// <param name="source"></param> /// <param name="attachUrl"></param> /// <param name="menuId"></param> /// <param name="toKeyId"></param> public static void SaveAttachUrl(string source, string attachUrl, string menuId, string toKeyId) { using (Model.SUBHSSEDB db = new Model.SUBHSSEDB(Funs.ConnString)) { List <Model.AttachFile> sour = (from x in db.AttachFile where x.MenuId == menuId && x.ToKeyId == toKeyId select x).ToList(); if (sour.Count() == 0) { Model.AttachFile att = new Model.AttachFile { AttachFileId = SQLHelper.GetNewID(), ToKeyId = toKeyId, AttachSource = source.ToString(), AttachUrl = attachUrl, MenuId = menuId, //AttachPath= attachPath, }; db.AttachFile.InsertOnSubmit(att); db.SubmitChanges(); } else { Model.AttachFile att = db.AttachFile.FirstOrDefault(x => x.MenuId == menuId && x.AttachFileId == sour.First().AttachFileId); if (att != null) { att.ToKeyId = toKeyId; att.AttachSource = source.ToString(); att.AttachUrl = attachUrl; att.MenuId = menuId; db.SubmitChanges(); } } //if (!string.IsNullOrEmpty(toKeyId)) //{ // List<string> getattachUrlItems = Funs.GetStrListByStr(attachUrl, ','); // foreach (var item in getattachUrlItems) // { // Model.AttachFileItem newItem = new Model.AttachFileItem // { // AttachFileItemId = SQLHelper.GetNewID(), // ToKeyId = toKeyId, // AttachUrl = item, // }; // db.AttachFileItem.InsertOnSubmit(newItem); // db.SubmitChanges(); // } //} //else //{ // var getItems = from x in db.AttachFileItem where x.ToKeyId == toKeyId select x; // if (getItems.Count() > 0) // { // db.AttachFileItem.DeleteAllOnSubmit(getItems); // db.SubmitChanges(); // } //} } }
/// <summary> /// 保存Check_IncentiveNotice /// </summary> /// <param name="newItem">奖励通知单</param> /// <returns></returns> public static void SaveIncentiveNotice(Model.IncentiveNoticeItem newItem) { Model.SUBHSSEDB db = Funs.DB; Model.Check_IncentiveNotice newIncentiveNotice = new Model.Check_IncentiveNotice { IncentiveNoticeId = newItem.IncentiveNoticeId, IncentiveNoticeCode = newItem.IncentiveNoticeCode, ProjectId = newItem.ProjectId, IncentiveDate = Funs.GetNewDateTime(newItem.IncentiveDate), UnitId = newItem.UnitId, PersonId = newItem.PersonId, RewardType = newItem.RewardTypeId, BasicItem = newItem.BasicItem, IncentiveMoney = newItem.IncentiveMoney, Currency = newItem.Currency, TitleReward = newItem.TitleReward, MattleReward = newItem.MattleReward, SignMan = newItem.SignManId, ApproveMan = newItem.ApproveManId, FileContents = System.Web.HttpUtility.HtmlEncode(newItem.FileContents), CompileMan = newItem.CompileManId, AttachUrl = newItem.AttachUrl, States = Const.State_2, }; if (!string.IsNullOrEmpty(newItem.TeamGroupId)) { newIncentiveNotice.TeamGroupId = newItem.TeamGroupId; } if (newItem.States != "1") { newIncentiveNotice.States = Const.State_0; } var updateIncentiveNotice = Funs.DB.Check_IncentiveNotice.FirstOrDefault(x => x.IncentiveNoticeId == newItem.IncentiveNoticeId); if (updateIncentiveNotice == null) { newIncentiveNotice.CompileDate = DateTime.Now; newIncentiveNotice.IncentiveNoticeId = SQLHelper.GetNewID(); newIncentiveNotice.IncentiveNoticeCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectIncentiveNoticeMenuId, newIncentiveNotice.ProjectId, newIncentiveNotice.UnitId); IncentiveNoticeService.AddIncentiveNotice(newIncentiveNotice); } else { IncentiveNoticeService.UpdateIncentiveNotice(newIncentiveNotice); } if (newIncentiveNotice.States == "1") { CommonService.btnSaveData(newIncentiveNotice.ProjectId, Const.ProjectIncentiveNoticeMenuId, newIncentiveNotice.IncentiveNoticeId, newIncentiveNotice.CompileMan, true, newIncentiveNotice.IncentiveNoticeCode, "../Check/IncentiveNoticeView.aspx?IncentiveNoticeId={0}"); } }
/// <summary> /// 添加其他工作情况 /// </summary> /// <param name="otherWork"></param> public static void AddOtherWork(Model.Manager_Month_OtherWorkC otherWork) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Month_OtherWorkC newOtherWork = new Model.Manager_Month_OtherWorkC { OtherWorkId = SQLHelper.GetNewID(typeof(Model.Manager_Month_OtherWorkC)), MonthReportId = otherWork.MonthReportId, WorkContentDes = otherWork.WorkContentDes, SortIndex = otherWork.SortIndex }; db.Manager_Month_OtherWorkC.InsertOnSubmit(newOtherWork); db.SubmitChanges(); }
/// <summary> /// 添加其他HSE工作计划 /// </summary> /// <param name="otherWorkPlan"></param> public static void AddOtherWorkPlan(Model.Manager_Month_OtherWorkPlanC otherWorkPlan) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Month_OtherWorkPlanC newP = new Model.Manager_Month_OtherWorkPlanC { OtherWorkPlanId = SQLHelper.GetNewID(typeof(Model.Manager_Month_OtherWorkPlanC)), MonthReportId = otherWorkPlan.MonthReportId, WorkContent = otherWorkPlan.WorkContent, SortIndex = otherWorkPlan.SortIndex }; db.Manager_Month_OtherWorkPlanC.InsertOnSubmit(newP); db.SubmitChanges(); }
/// <summary> /// 添加HSE现场其他管理情况信息 /// </summary> /// <param name="otherManagement"></param> public static void AddOtherManagement(Model.Manager_Month_OtherManagementC otherManagement) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Month_OtherManagementC newOtherManagement = new Model.Manager_Month_OtherManagementC { OtherManagementId = SQLHelper.GetNewID(typeof(Model.Manager_Month_OtherManagementC)), MonthReportId = otherManagement.MonthReportId, ManagementDes = otherManagement.ManagementDes, SortIndex = otherManagement.SortIndex }; db.Manager_Month_OtherManagementC.InsertOnSubmit(newOtherManagement); db.SubmitChanges(); }
/// <summary> /// 根据通知生成一般来文 /// </summary> public static void CreateReceiveFile(Model.InformationProject_Notice notice) { var getProjects = Funs.GetStrListByStr(notice.AccessProjectId, ','); string unitId = CommonService.GetIsThisUnitId(); var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == notice.NoticeId); foreach (var item in getProjects) { Model.InformationProject_ReceiveFileManager newFile = new Model.InformationProject_ReceiveFileManager { ReceiveFileManagerId = SQLHelper.GetNewID(), ProjectId = item, ReceiveFileCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ReceiveFileManagerMenuId, item, unitId), ReceiveFileName = notice.NoticeTitle, Version = "V1.0", FileUnitId = unitId, FileCode = notice.NoticeCode, FilePageNum = 1, GetFileDate = DateTime.Now, SendPersonId = notice.CompileMan, MainContent = notice.MainContent, }; if (!string.IsNullOrEmpty(notice.ProjectId)) { newFile.FileType = "0"; } else { newFile.FileType = "1"; } var getPUnits = Funs.DB.Project_ProjectUnit.Where(x => x.ProjectId == item); foreach (var uItem in getPUnits) { if (string.IsNullOrEmpty(newFile.UnitIds)) { newFile.UnitIds = uItem.UnitId; } else { newFile.UnitIds += "," + uItem.UnitId; } } newFile.States = Const.State_2; ReceiveFileManagerService.AddReceiveFileManager(newFile); if (getAtt != null && !string.IsNullOrEmpty(getAtt.AttachUrl)) { APIUpLoadFileService.SaveAttachUrl(Const.ReceiveFileManagerMenuId, newFile.ReceiveFileManagerId, getAtt.AttachUrl, "0"); } CommonService.btnSaveData(item, Const.ReceiveFileManagerMenuId, newFile.ReceiveFileManagerId, newFile.SendPersonId, true, newFile.ReceiveFileName, "../InformationProject/ReceiveFileManagerView.aspx?ReceiveFileManagerId={0}"); } }
/// <summary> /// 添加管理绩效数据统计 /// </summary> /// <param name="item"></param> public static void AddAccidentDesciptionItem(Model.Manager_Month_AccidentDesciptionItemC item) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Month_AccidentDesciptionItemC newItem = new Model.Manager_Month_AccidentDesciptionItemC { AccidentDesItemId = SQLHelper.GetNewID(typeof(Model.Manager_Month_AccidentDesciptionItemC)), MonthReportId = item.MonthReportId, Matter = item.Matter, Datas = item.Datas, SortIndex = item.SortIndex }; db.Manager_Month_AccidentDesciptionItemC.InsertOnSubmit(newItem); db.SubmitChanges(); }
/// <summary> /// 添加附件存储信息 /// </summary> /// <param name="workArea"></param> public static void AddAttachFile(Model.AttachFile attachFile) { string newKeyID = SQLHelper.GetNewID(typeof(Model.AttachFile)); Model.AttachFile newAttachFile = new Model.AttachFile(); newAttachFile.AttachFileId = newKeyID; newAttachFile.ToKeyId = attachFile.ToKeyId; newAttachFile.AttachSource = attachFile.AttachSource; newAttachFile.AttachUrl = attachFile.AttachUrl; newAttachFile.MenuId = attachFile.MenuId; db.AttachFile.InsertOnSubmit(newAttachFile); db.SubmitChanges(); }
/// <summary> /// 增加费用明细信息 /// </summary> /// <param name="pauseNotice">费用明细实体</param> public static void AddCostDetail(string costSmallDetailId, string costType, decimal costMoney, string costDef) { Model.SUBHSSEDB db = Funs.DB; Model.CostGoods_CostSmallDetailItem newCostSmallDetailItem = new Model.CostGoods_CostSmallDetailItem { CostSmallDetailItemId = SQLHelper.GetNewID(typeof(Model.CostGoods_CostSmallDetailItem)), CostSmallDetailId = costSmallDetailId, CostType = costType, CostMoney = costMoney, CostDef = costDef }; db.CostGoods_CostSmallDetailItem.InsertOnSubmit(newCostSmallDetailItem); db.SubmitChanges(); }
/// <summary> /// 增加标准规范项信息 /// </summary> /// <param name="lawRegulationSelectedItem">标准规范项实体</param> public static void AddConstructionStandardSelectedItem(Model.InformationProject_ConstructionStandardSelectedItem constructionStandardSelectedItem) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.InformationProject_ConstructionStandardSelectedItem)); Model.InformationProject_ConstructionStandardSelectedItem newLawRegulationSelectedItem = new Model.InformationProject_ConstructionStandardSelectedItem { ConstructionStandardSelectedItemId = newKeyID, ConstructionStandardIdentifyId = constructionStandardSelectedItem.ConstructionStandardIdentifyId, StandardId = constructionStandardSelectedItem.StandardId }; db.InformationProject_ConstructionStandardSelectedItem.InsertOnSubmit(newLawRegulationSelectedItem); db.SubmitChanges(); }
/// <summary> /// 增加费用汇总明细信息 /// </summary> /// <param name="pauseNotice">费用汇总明细实体</param> public static void AddCostStatisticDetail(Model.TC_CostStatisticDetail detail) { Model.SUBHSSEDB db = Funs.DB; string CostStatisticDetailId = SQLHelper.GetNewID(typeof(Model.TC_CostStatisticDetail)); Model.TC_CostStatisticDetail newtc_CostDetail = new Model.TC_CostStatisticDetail { CostStatisticDetailId = CostStatisticDetailId, CostStatisticCode = detail.CostStatisticCode, UnitId = detail.UnitId, A1 = detail.A1, YA1 = detail.YA1, PA1 = detail.PA1, A2 = detail.A2, YA2 = detail.YA2, PA2 = detail.PA2, A3 = detail.A3, YA3 = detail.YA3, PA3 = detail.PA3, A4 = detail.A4, YA4 = detail.YA4, PA4 = detail.PA4, A5 = detail.A5, YA5 = detail.YA5, PA5 = detail.PA5, A6 = detail.A6, YA6 = detail.YA6, PA6 = detail.PA6, A = detail.A, YA = detail.YA, PA = detail.PA, B1 = detail.B1, YB1 = detail.YB1, PB1 = detail.PB1, B2 = detail.B2, YB2 = detail.YB2, PB2 = detail.PB2, B3 = detail.B3, YB3 = detail.YB3, PB3 = detail.PB3, B = detail.B, YB = detail.YB, PB = detail.PB, AB = detail.AB, YAB = detail.YAB, PAB = detail.PAB }; db.TC_CostStatisticDetail.InsertOnSubmit(newtc_CostDetail); db.SubmitChanges(); }
/// <summary> /// 增加费用明细信息 /// </summary> /// <param name="pauseNotice">费用明细实体</param> public static void AddCostDetail(string expenseId, string costType, decimal costMoney, string costDef) { Model.SUBHSSEDB db = Funs.DB; Model.CostGoods_ExpenseDetail newExpenseDetail = new Model.CostGoods_ExpenseDetail { ExpenseDetailId = SQLHelper.GetNewID(typeof(Model.CostGoods_ExpenseDetail)), ExpenseId = expenseId, CostType = costType, CostMoney = costMoney, CostDef = costDef }; db.CostGoods_ExpenseDetail.InsertOnSubmit(newExpenseDetail); db.SubmitChanges(); }
/// <summary> /// 保存Solution_ConstructSolution /// </summary> /// <param name="newItem">施工方案</param> /// <returns></returns> public static void SaveConstructSolution(Model.ConstructSolutionItem newItem) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_ConstructSolution newConstructSolution = new Model.Solution_ConstructSolution { ConstructSolutionId = newItem.ConstructSolutionId, ProjectId = newItem.ProjectId, ConstructSolutionCode = newItem.ConstructSolutionCode, ConstructSolutionName = newItem.ConstructSolutionName, VersionNo = newItem.VersionNo, UnitId = newItem.UnitId, InvestigateType = newItem.InvestigateType, SolutinType = newItem.SolutinTypeId, FileContents = System.Web.HttpUtility.HtmlEncode(newItem.FileContents), CompileMan = newItem.CompileManId, CompileManName = UserService.GetUserNameByUserId(newItem.CompileManId), States = Const.State_2, }; if (newItem.States != "1") { newConstructSolution.States = Const.State_0; } var updateConstructSolution = Funs.DB.Solution_ConstructSolution.FirstOrDefault(x => x.ConstructSolutionId == newItem.ConstructSolutionId); if (updateConstructSolution == null) { newConstructSolution.CompileDate = DateTime.Now; newConstructSolution.ConstructSolutionId = SQLHelper.GetNewID(); newConstructSolution.ConstructSolutionCode = CodeRecordsService.ReturnCodeByMenuIdProjectId(Const.ProjectConstructSolutionMenuId, newConstructSolution.ProjectId, newConstructSolution.UnitId); ConstructSolutionService.AddConstructSolution(newConstructSolution); } else { ConstructSolutionService.UpdateConstructSolution(newConstructSolution); } if (newConstructSolution.States == "1") { CommonService.btnSaveData(newConstructSolution.ProjectId, Const.ProjectConstructSolutionMenuId, newConstructSolution.ConstructSolutionId, newConstructSolution.CompileMan, true, newConstructSolution.CompileManName, "../Solution/ConstructSolutionView.aspx?ConstructSolutionId={0}"); } if (!string.IsNullOrEmpty(newItem.AttachUrl)) { ////保存附件 UploadFileService.SaveAttachUrl(UploadFileService.GetSourceByAttachUrl(newItem.AttachUrl, 10, null), newItem.AttachUrl, Const.ProjectConstructSolutionMenuId, newConstructSolution.ConstructSolutionId); } else { CommonService.DeleteAttachFileById(newConstructSolution.ConstructSolutionId); } }
/// <summary> /// 添加菜单是否启用记录表 /// </summary> /// <param name="menuUsed"></param> public static void AddMenuUsed(Model.Sys_MenuUsed menuUsed) { Model.SUBHSSEDB db = Funs.DB; Model.Sys_MenuUsed newMenuUsed = new Model.Sys_MenuUsed { MenuUsedId = SQLHelper.GetNewID(typeof(Model.Sys_MenuUsed)), MenuId = menuUsed.MenuId, MenuType = menuUsed.MenuType, IsUsed = menuUsed.IsUsed, ModifyDate = System.DateTime.Now }; db.Sys_MenuUsed.InsertOnSubmit(newMenuUsed); db.SubmitChanges(); }
/// <summary> /// 增加人员出入场信息 /// </summary> /// <param name="PersonInOut">人员实体</param> public static void AddPersonInOut(Model.SitePerson_PersonInOut PersonInOut) { Model.SUBHSSEDB db = Funs.DB; Model.SitePerson_PersonInOut newPersonInOut = new Model.SitePerson_PersonInOut { PersonInOutId = SQLHelper.GetNewID(typeof(Model.SitePerson_PersonInOut)), ProjectId = PersonInOut.ProjectId, UnitId = PersonInOut.UnitId, PersonId = PersonInOut.PersonId, IsIn = PersonInOut.IsIn, ChangeTime = PersonInOut.ChangeTime }; db.SitePerson_PersonInOut.InsertOnSubmit(newPersonInOut); db.SubmitChanges(); }
/// <summary> /// 增加违规记录汇总表信息 /// </summary> /// <param name="violationRecordD">违规记录汇总表实体</param> public static void AddViolationRecordD(Model.Manager_ViolationRecordD violationRecordD) { Model.SUBHSSEDB db = Funs.DB; string newKeyID = SQLHelper.GetNewID(typeof(Model.Manager_ViolationRecordD)); Model.Manager_ViolationRecordD newViolationRecordD = new Model.Manager_ViolationRecordD { ViolationRecordId = newKeyID, MonthReportId = violationRecordD.MonthReportId, FileContents = violationRecordD.FileContents }; db.Manager_ViolationRecordD.InsertOnSubmit(newViolationRecordD); db.SubmitChanges(); }
/// <summary> /// 添加-安全措施 /// </summary> /// <param name="licenseItem"></param> public static void AddLicenseItem(Model.License_LicenseItem licenseItem) { Model.SUBHSSEDB db = Funs.DB; Model.License_LicenseItem newLicenseItem = new Model.License_LicenseItem { LicenseItemId = SQLHelper.GetNewID(), DataId = licenseItem.DataId, SortIndex = licenseItem.SortIndex, SafetyMeasures = licenseItem.SafetyMeasures, IsUsed = licenseItem.IsUsed, ConfirmManId = licenseItem.ConfirmManId, }; db.License_LicenseItem.InsertOnSubmit(newLicenseItem); db.SubmitChanges(); }
/// <summary> /// 添加分包商HSE费用投入 /// </summary> /// <param name="newSubExpense"></param> public static void AddSubExpense(Model.Manager_Month_SubExpenseC subExpense) { Model.SUBHSSEDB db = Funs.DB; Model.Manager_Month_SubExpenseC newSubExpense = new Model.Manager_Month_SubExpenseC { SubExpenseId = SQLHelper.GetNewID(typeof(Model.Manager_Month_SubExpenseC)), MonthReportId = subExpense.MonthReportId, SubUnit = subExpense.SubUnit, CostMonth = subExpense.CostMonth, CostYear = subExpense.CostYear, SortIndex = subExpense.SortIndex }; db.Manager_Month_SubExpenseC.InsertOnSubmit(newSubExpense); db.SubmitChanges(); }