コード例 #1
0
ファイル: S_T_WBSStructInfo.cs プロジェクト: tianzhifeng/EPC
 /// <summary>
 /// 验证WBS结构下是否可增加角色
 /// </summary>
 /// <param name="roleDefine">岗位角色定义</param>
 /// <returns>boolean值</returns>
 public bool ValidateRoleDefine(S_D_RoleDefine roleDefine)
 {
     if (this.S_T_WBSStructRole.FirstOrDefault(d => d.WBSStructID == this.ID &&
                                               d.RoleCode == roleDefine.RoleCode) == null)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
コード例 #2
0
ファイル: S_T_WBSStructInfo.cs プロジェクト: tianzhifeng/EPC
        /// <summary>
        /// 增加角色定义
        /// </summary>
        /// <param name="roleDefine">角色定义对象</param>
        public void AddRoleInfo(S_D_RoleDefine roleDefine)
        {
            if (this.S_T_WBSStructRole.FirstOrDefault(d => d.RoleCode == roleDefine.RoleCode) != null)
            {
                return;
            }
            var roleInfo = new S_T_WBSStructRole();

            roleInfo.ID           = FormulaHelper.CreateGuid();
            roleInfo.RoleCode     = roleDefine.RoleCode;
            roleInfo.RoleName     = roleDefine.RoleName;
            roleInfo.RoleRelation = roleDefine.RoleRelation;
            roleInfo.RoleType     = roleDefine.RoleType;
            roleInfo.SychProject  = false.ToString();
            roleInfo.SychWBS      = false.ToString();
            roleInfo.Multi        = true.ToString();
            roleInfo.SortIndex    = this.S_T_WBSStructRole.Count + 1;
            this.S_T_WBSStructRole.Add(roleInfo);
        }
コード例 #3
0
        void addRbsDt(UserInfo userInfo, DataTable rbsDt, DataRow wbsRow, S_D_RoleDefine roleDefine)
        {
            if (userInfo == null)
            {
                return;
            }
            var rbsNewRow = rbsDt.NewRow();

            rbsNewRow["WBSID"]   = wbsRow["ID"];
            rbsNewRow["WBSCode"] = wbsRow["Code"];
            rbsNewRow["WBSType"] = wbsRow["WBSType"];
            if (wbsRow["WBSType"].ToString() == WBSNodeType.Major.ToString())
            {
                rbsNewRow["MajorValue"] = wbsRow["WBSValue"];
            }
            rbsNewRow["ProjectInfoID"] = wbsRow["ProjectInfoID"];
            rbsNewRow["RoleCode"]      = roleDefine.RoleCode;
            rbsNewRow["RoleName"]      = roleDefine.RoleName;
            rbsNewRow["UserID"]        = userInfo.UserID;
            rbsNewRow["UserName"]      = userInfo.UserName;
            rbsNewRow["UserDeptID"]    = userInfo.UserOrgID;
            rbsNewRow["UserDeptName"]  = userInfo.UserOrgName;
            rbsDt.Rows.Add(rbsNewRow);
        }
コード例 #4
0
 /// <summary>
 /// 为空间设置项目角色的权限
 /// </summary>
 /// <param name="roleDefine">项目角色定义对象</param>
 /// <param name="authType">权限级别(默认完全控制)</param>
 /// <param name="dynValue">动态值类别(默认为全部)</param>
 /// <param name="includeChildren">子节点是否继承</param>
 public void SetProjectRole(S_D_RoleDefine roleDefine, string authType, bool includeChildren = true)
 {
     this.SetProjectRole(roleDefine.RoleCode, authType, includeChildren);
 }