/// <summary> /// 增加移动端首页 /// </summary> /// <returns></returns> public static void AddPageData(Wx_PageData PageData) { SUBHSSEDB db = Funs.DB; Wx_PageData newPageData = new Wx_PageData { PageDataId = PageData.PageDataId, ProjectId = PageData.ProjectId, CreatDate = DateTime.Now, CreatManId = PageData.CreatManId, SafeHours = PageData.SafeHours, SitePersonNum = PageData.SitePersonNum, SpecialEquipmentNum = PageData.SpecialEquipmentNum, EntryTrainingNum = PageData.EntryTrainingNum, HiddenDangerNum = PageData.HiddenDangerNum, RectificationNum = PageData.RectificationNum, RiskI = PageData.RiskI, RiskII = PageData.RiskII, RiskIII = PageData.RiskIII, RiskIV = PageData.RiskIV, RiskV = PageData.RiskV, }; db.Wx_PageData.InsertOnSubmit(newPageData); db.SubmitChanges(); }
/// <summary> /// 增加项目单位信息 /// </summary> /// <returns></returns> public static void AddProjectUnit(Project_ProjectUnit projectUnit) { SUBHSSEDB db = Funs.DB; Project_ProjectUnit newProjectUnit = new Project_ProjectUnit { ProjectUnitId = SQLHelper.GetNewID(typeof(Model.Project_ProjectUnit)), ProjectId = projectUnit.ProjectId, UnitId = projectUnit.UnitId, UnitType = projectUnit.UnitType, InTime = projectUnit.InTime, OutTime = projectUnit.OutTime, PlanCostA = projectUnit.PlanCostA, PlanCostB = projectUnit.PlanCostB, ContractRange = projectUnit.ContractRange }; db.Project_ProjectUnit.InsertOnSubmit(newProjectUnit); db.SubmitChanges(); }
/// <summary> ///修改移动端首页 /// </summary> /// <param name="PageData"></param> public static void UpdatePageData(Wx_PageData PageData) { SUBHSSEDB db = Funs.DB; Wx_PageData newPageData = db.Wx_PageData.FirstOrDefault(e => e.PageDataId == PageData.PageDataId); if (newPageData != null) { newPageData.SafeHours = PageData.SafeHours; newPageData.SitePersonNum = PageData.SitePersonNum; newPageData.SpecialEquipmentNum = PageData.SpecialEquipmentNum; newPageData.EntryTrainingNum = PageData.EntryTrainingNum; newPageData.HiddenDangerNum = PageData.HiddenDangerNum; newPageData.RectificationNum = PageData.RectificationNum; newPageData.RiskI = PageData.RiskI; newPageData.RiskII = PageData.RiskII; newPageData.RiskIII = PageData.RiskIII; newPageData.RiskIV = PageData.RiskIV; newPageData.RiskV = PageData.RiskV; db.SubmitChanges(); } }
/// <summary> ///修改项目信息 /// </summary> /// <param name="project"></param> public static void UpdateProject(Model.Base_Project project) { SUBHSSEDB db = Funs.DB; Base_Project newProject = db.Base_Project.FirstOrDefault(e => e.ProjectId == project.ProjectId); if (newProject != null) { newProject.ProjectCode = project.ProjectCode; newProject.ProjectName = project.ProjectName; newProject.StartDate = project.StartDate; newProject.EndDate = project.EndDate; newProject.ProjectAddress = project.ProjectAddress; newProject.ShortName = project.ShortName; newProject.ContractNo = project.ContractNo; newProject.WorkRange = project.WorkRange; newProject.Duration = project.Duration; newProject.ProjectType = project.ProjectType; newProject.PostCode = project.PostCode; newProject.Remark = project.Remark; newProject.ProjectState = project.ProjectState; newProject.IsUpTotalMonth = project.IsUpTotalMonth; newProject.UnitId = project.UnitId; newProject.ProjectMainPerson = project.ProjectMainPerson; newProject.ProjectLiaisonPerson = project.ProjectLiaisonPerson; newProject.IsForeign = project.IsForeign; newProject.FromProjectId = project.FromProjectId; newProject.MapCoordinates = project.MapCoordinates; db.SubmitChanges(); if (newProject.ProjectType != "5") { ////根据项目信息生成企业安全管理资料计划总表 BLL.SafetyDataPlanService.GetSafetyDataPlanByProjectInfo(newProject.ProjectId, string.Empty, null, null); } } }