Example #1
0
        /// <summary>
        /// 更新处理意见
        /// </summary>
        /// <param name="upFlowOperate"></param>
        public static void UpdateFlowOperateOpinion(Model.ProjectData_FlowOperate flowOperate)
        {
            Model.SUBHSSEDB db            = Funs.DB;
            var             upFlowOperate = from x in db.ProjectData_FlowOperate
                                            where x.MenuId == flowOperate.MenuId && x.DataId == flowOperate.DataId && (x.IsClosed == false || !x.IsClosed.HasValue)
                                            select x;

            if (upFlowOperate.Count() > 0)
            {
                foreach (var item in upFlowOperate)
                {
                    item.OperaterId   = flowOperate.OperaterId;
                    item.OperaterTime = flowOperate.OperaterTime;
                    item.State        = flowOperate.State;
                    item.Opinion      = flowOperate.Opinion;
                    item.IsClosed     = flowOperate.IsClosed;
                    Funs.DB.SubmitChanges();
                }
            }
            else
            {
                Model.ProjectData_FlowOperate newFlowOperate = new Model.ProjectData_FlowOperate
                {
                    MenuId       = flowOperate.MenuId,
                    DataId       = flowOperate.DataId,
                    OperaterId   = flowOperate.OperaterId,
                    OperaterTime = flowOperate.OperaterTime,
                    State        = flowOperate.State,
                    Opinion      = flowOperate.Opinion,
                    IsClosed     = flowOperate.IsClosed
                };
                AddProjectData_FlowOperate(newFlowOperate);
            }
        }
Example #2
0
 /// <summary>
 /// 获取最后一条未办理的意见
 /// </summary>
 /// <param name="upFlowOperate"></param>
 public static Model.ProjectData_FlowOperate GetFlowOperateOpinion(string menuId, string dataId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     return((from x in db.ProjectData_FlowOperate
             where x.MenuId == menuId && x.DataId == dataId && (x.IsClosed == false || !x.IsClosed.HasValue)
             select x).FirstOrDefault());
 }
Example #3
0
 /// <summary>
 /// 根据项目单位Id删除一个项目单位信息
 /// </summary>
 /// <param name="projectUnitId"></param>
 public static void DeleteProjectProjectUnitById(string projectUnitId)
 {
     Model.SUBHSSEDB           db             = Funs.DB;
     Model.Project_ProjectUnit delProjectUnit = db.Project_ProjectUnit.FirstOrDefault(e => e.ProjectUnitId == projectUnitId);
     if (delProjectUnit != null)
     {
         db.Project_ProjectUnit.DeleteOnSubmit(delProjectUnit);
         db.SubmitChanges();
     }
 }
Example #4
0
 /// <summary>
 /// 删除标准规范类别
 /// </summary>
 /// <param name="typeId"></param>
 public static void DeleteHSSEStandardListType(string typeId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Base_HSSEStandardListType hSSEStandardListType = db.Base_HSSEStandardListType.FirstOrDefault(e => e.TypeId == typeId);
     if (hSSEStandardListType != null)
     {
         db.Base_HSSEStandardListType.DeleteOnSubmit(hSSEStandardListType);
         db.SubmitChanges();
     }
 }
Example #5
0
 /// <summary>
 /// 删除交流类型
 /// </summary>
 /// <param name="contentTypeId"></param>
 public static void DeleteContentType(string contentTypeId)
 {
     Model.SUBHSSEDB            db          = Funs.DB;
     Model.Exchange_ContentType contentType = db.Exchange_ContentType.FirstOrDefault(e => e.ContentTypeId == contentTypeId);
     if (contentType != null)
     {
         db.Exchange_ContentType.DeleteOnSubmit(contentType);
         db.SubmitChanges();
     }
 }
Example #6
0
 /// <summary>
 /// 删除项目单据流程
 /// </summary>
 /// <param name="flowSetId"></param>
 public static void DeleteFlowSetByFlowSetId(string flowSetId)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.ProjectData_FlowOperate flowSet = db.ProjectData_FlowOperate.FirstOrDefault(e => e.FlowOperateId == flowSetId);
     if (flowSet != null)
     {
         db.ProjectData_FlowOperate.DeleteOnSubmit(flowSet);
         db.SubmitChanges();
     }
 }
Example #7
0
        /// <summary>
        /// 删除流程根据单据主键ID
        /// </summary>
        /// <param name="flowSetId"></param>
        public static void DeleteFlowSetByDataId(string dataId)
        {
            Model.SUBHSSEDB db       = Funs.DB;
            var             flowSets = from x in db.ProjectData_FlowOperate where x.DataId == dataId select x;

            if (flowSets.Count() > 0)
            {
                db.ProjectData_FlowOperate.DeleteAllOnSubmit(flowSets);
                db.SubmitChanges();
            }
        }
Example #8
0
 /// <summary>
 /// 修改交流类型信息
 /// </summary>
 /// <param name="contentTypeId"></param>
 /// <param name="contentTypeName"></param>
 /// <param name="def"></param>
 public static void UpdateContentType(Model.Exchange_ContentType contentType)
 {
     Model.SUBHSSEDB            db             = Funs.DB;
     Model.Exchange_ContentType newContentType = db.Exchange_ContentType.FirstOrDefault(e => e.ContentTypeId == contentType.ContentTypeId);
     if (newContentType != null)
     {
         newContentType.ContentTypeCode = contentType.ContentTypeCode;
         newContentType.ContentTypeName = contentType.ContentTypeName;
         db.SubmitChanges();
     }
 }
Example #9
0
 /// <summary>
 /// 修改标准规范类别信息
 /// </summary>
 /// <param name="typeId"></param>
 /// <param name="hSSEStandardListTypeName"></param>
 /// <param name="def"></param>
 public static void UpdateHSSEStandardListType(string typeId, string typeCode, string typeName, string remark)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.Base_HSSEStandardListType hSSEStandardListType = db.Base_HSSEStandardListType.FirstOrDefault(e => e.TypeId == typeId);
     if (hSSEStandardListType != null)
     {
         hSSEStandardListType.TypeCode = typeCode;
         hSSEStandardListType.TypeName = typeName;
         hSSEStandardListType.Remark   = remark;
         db.SubmitChanges();
     }
 }
Example #10
0
 /// <summary>
 /// 修改标准规范 是否采用
 /// </summary>
 /// <param name="lawRegulationList"></param>
 public static void UpdateHSSEStandardsListIsPass(Model.Law_HSSEStandardsList standardsList)
 {
     Model.SUBHSSEDB             db = Funs.DB;
     Model.Law_HSSEStandardsList newHSSEStandardsList = db.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == standardsList.StandardId);
     if (newHSSEStandardsList != null)
     {
         newHSSEStandardsList.AuditMan  = standardsList.AuditMan;
         newHSSEStandardsList.AuditDate = standardsList.AuditDate;
         newHSSEStandardsList.IsPass    = standardsList.IsPass;
         db.SubmitChanges();
     }
 }
Example #11
0
        /// <summary>
        /// 增加交流类型
        /// </summary>
        /// <param name="contentTypeName"></param>
        /// <param name="def"></param>
        public static void AddContentType(Model.Exchange_ContentType contentType)
        {
            Model.SUBHSSEDB            db             = Funs.DB;
            Model.Exchange_ContentType newContentType = new Model.Exchange_ContentType
            {
                ContentTypeId   = contentType.ContentTypeId,
                ContentTypeCode = contentType.ContentTypeCode,
                ContentTypeName = contentType.ContentTypeName
            };

            db.Exchange_ContentType.InsertOnSubmit(newContentType);
            db.SubmitChanges();
        }
Example #12
0
        /// <summary>
        /// 增加标准规范类别
        /// </summary>
        /// <param name="hSSEStandardListTypeName"></param>
        /// <param name="def"></param>
        public static void AddHSSEStandardListType(Model.Base_HSSEStandardListType hSSEStandardListType)
        {
            Model.SUBHSSEDB db = Funs.DB;
            Model.Base_HSSEStandardListType newHSSEStandardListType = new Model.Base_HSSEStandardListType
            {
                TypeId   = hSSEStandardListType.TypeId,
                TypeCode = hSSEStandardListType.TypeCode,
                TypeName = hSSEStandardListType.TypeName,
                Remark   = hSSEStandardListType.Remark
            };

            db.Base_HSSEStandardListType.InsertOnSubmit(newHSSEStandardListType);
            db.SubmitChanges();
        }
Example #13
0
 /// <summary>
 ///修改项目单位信息
 /// </summary>
 /// <param name="projectUnit"></param>
 public static void UpdateProjectUnit(Model.Project_ProjectUnit projectUnit)
 {
     Model.SUBHSSEDB           db             = Funs.DB;
     Model.Project_ProjectUnit newProjectUnit = db.Project_ProjectUnit.FirstOrDefault(e => e.ProjectUnitId == projectUnit.ProjectUnitId);
     if (newProjectUnit != null)
     {
         newProjectUnit.UnitType      = projectUnit.UnitType;
         newProjectUnit.InTime        = projectUnit.InTime;
         newProjectUnit.OutTime       = projectUnit.OutTime;
         newProjectUnit.PlanCostA     = projectUnit.PlanCostA;
         newProjectUnit.PlanCostB     = projectUnit.PlanCostB;
         newProjectUnit.ContractRange = projectUnit.ContractRange;
         db.SubmitChanges();
     }
 }
Example #14
0
        /// <summary>
        /// 删除标准规范信息
        /// </summary>
        /// <param name="EDU_ID"></param>
        public static void DeleteHSSEStandardsList(string standardId)
        {
            Model.SUBHSSEDB             db = Funs.DB;
            Model.Law_HSSEStandardsList hSSEStandardsList = db.Law_HSSEStandardsList.FirstOrDefault(e => e.StandardId == standardId);
            if (hSSEStandardsList != null)
            {
                //if (!string.IsNullOrEmpty(hSSEStandardsList.AttachUrl))
                //{
                //    UploadFileService.DeleteFile(Funs.RootPath, hSSEStandardsList.AttachUrl);
                //}

                ////删除附件表
                // BLL.CommonService.DeleteAttachFileById(hSSEStandardsList.StandardId);

                db.Law_HSSEStandardsList.DeleteOnSubmit(hSSEStandardsList);
                db.SubmitChanges();
            }
        }
Example #15
0
 /// <summary>
 /// 根据项目Id删除一个项目信息
 /// </summary>
 /// <param name="projectId"></param>
 public static void DeleteProject(string projectId)
 {
     Model.SUBHSSEDB    db      = Funs.DB;
     Model.Base_Project project = db.Base_Project.FirstOrDefault(e => e.ProjectId == projectId);
     if (project != null)
     {
         ////删除编码/模板规则表
         BLL.ProjectData_CodeTemplateRuleService.DeleteProjectData_CodeTemplateRule(project.ProjectId);
         ////删除项目安全管理资料计划总表
         BLL.SafetyDataPlanService.DeleteSafetyDataPlanByProjectId(project.ProjectId);
         ////删除E项目安全管理资料计划总表
         BLL.SafetyDataEPlanService.DeleteSafetyDataEPlanByProjectId(project.ProjectId);
         ////删除E项目安全管理
         BLL.SafetyDataEItemService.DeleteSafetyDataEItemByProjectId(project.ProjectId);
         BLL.SafetySystemService.DeleteSafetySystemByProjectid(project.ProjectId);
         db.Base_Project.DeleteOnSubmit(project);
         db.SubmitChanges();
     }
 }
Example #16
0
        /// <summary>
        /// 增加项目单据流程
        /// </summary>
        /// <param name="FlowSetName"></param>
        /// <param name="def"></param>
        public static void AddProjectData_FlowOperate(Model.ProjectData_FlowOperate flowSet)
        {
            Model.SUBHSSEDB db = Funs.DB;
            Model.ProjectData_FlowOperate newFlowOperate = new ProjectData_FlowOperate
            {
                FlowOperateId = SQLHelper.GetNewID(typeof(Model.ProjectData_FlowOperate)),
                MenuId        = flowSet.MenuId,
                DataId        = flowSet.DataId
            };
            int newSortIndex = getFlowSetMaxSortIndexByMenuId(flowSet.MenuId, flowSet.DataId);

            newFlowOperate.SortIndex    = newSortIndex;
            newFlowOperate.OperaterId   = flowSet.OperaterId;
            newFlowOperate.OperaterTime = flowSet.OperaterTime;
            newFlowOperate.State        = flowSet.State;
            newFlowOperate.Opinion      = flowSet.Opinion;
            newFlowOperate.IsClosed     = flowSet.IsClosed;
            db.ProjectData_FlowOperate.InsertOnSubmit(newFlowOperate);
            db.SubmitChanges();
        }
Example #17
0
 /// <summary>
 /// 增加项目信息
 /// </summary>
 /// <returns></returns>
 public static void AddProject(Model.Base_Project project)
 {
     Model.SUBHSSEDB    db         = Funs.DB;
     Model.Base_Project newProject = new Base_Project
     {
         ProjectId            = project.ProjectId,
         ProjectCode          = project.ProjectCode,
         ProjectName          = project.ProjectName,
         StartDate            = project.StartDate,
         EndDate              = project.EndDate,
         ProjectAddress       = project.ProjectAddress,
         ContractNo           = project.ContractNo,
         WorkRange            = project.WorkRange,
         Duration             = project.Duration,
         ShortName            = project.ShortName,
         ProjectType          = project.ProjectType,
         PostCode             = project.PostCode,
         Remark               = project.Remark,
         ProjectState         = project.ProjectState,
         IsUpTotalMonth       = project.IsUpTotalMonth,
         UnitId               = project.UnitId,
         ProjectMainPerson    = project.ProjectMainPerson,
         ProjectLiaisonPerson = project.ProjectLiaisonPerson,
         IsForeign            = project.IsForeign,
         FromProjectId        = project.FromProjectId,
         MapCoordinates       = project.MapCoordinates,
     };
     db.Base_Project.InsertOnSubmit(newProject);
     db.SubmitChanges();
     ////插入编码/模板规则表
     BLL.ProjectData_CodeTemplateRuleService.InertProjectData_CodeTemplateRuleByProjectId(project.ProjectId);
     if (newProject.ProjectType != "5")
     {
         ////根据项目信息生成企业安全管理资料计划总表
         BLL.SafetyDataPlanService.GetSafetyDataPlanByProjectInfo(newProject.ProjectId, string.Empty, null, null);
     }
 }