示例#1
0
 public FrmProuctRole(DEFolder2 Folder, DEFolder2 Product)
 {
     this.plRole     = new PLRole();
     this.hsTable    = new Hashtable();
     this.hsOldTable = new Hashtable();
     this.selusers   = new ArrayList();
     this.InitializeComponent();
     this.folder  = Folder;
     this.product = Product;
     if (this.folder != null)
     {
         try {
             this.tvwRole.ImageList      = ClientData.MyImageList.imageList;
             this.lvwTeam.SmallImageList = ClientData.MyImageList.imageList;
             ClientData.MyImageList.GetIconIndex("ICO_RSP_ROLE");
             this.allRoleList      = this.plRole.GetAllRoles();
             this.allRoleGroupList = this.plRole.GetAllRoleGroups();
             this.hsTable          = (PLProductFolder.RemotingAgent as IProductFolder).GetProductRolesAndMembers(this.folder.Oid);
             this.roles            = (PLProductFolder.RemotingAgent as IProductFolder).GetAllProductRolesInclueParents(this.folder.Oid, Guid.Empty);
             foreach (Guid guid in this.hsTable.Keys)
             {
                 ArrayList list = new ArrayList();
                 foreach (Guid guid2 in this.hsTable[guid] as ArrayList)
                 {
                     list.Add(guid2);
                 }
                 this.hsOldTable.Add(guid, list);
             }
             this.RefreshRoleNode();
         } catch {
             base.Close();
             throw;
         }
     }
 }
示例#2
0
 public FrmProuctRole()
 {
     this.plRole     = new PLRole();
     this.hsTable    = new Hashtable();
     this.hsOldTable = new Hashtable();
     this.selusers   = new ArrayList();
     this.InitializeComponent();
 }
示例#3
0
        private void FillRolesOfOneGroup(DERoleGroup deRoleGroup)
        {
            this.lvwRole.Items.Clear();
            int          iconIndex = ClientData.MyImageList.GetIconIndex("ICO_FDL_CLOSE");
            ListViewItem item      = new ListViewItem("返回上一层", iconIndex)
            {
                Tag = "返回上一层"
            };

            this.lvwRole.Items.Add(item);
            int       imageIndex         = ClientData.MyImageList.GetIconIndex("ICO_RSP_ROLE");
            ArrayList allRolesInOneGroup = new PLRole().GetAllRolesInOneGroup(deRoleGroup.Oid);
            ArrayList members            = null;

            if ((this.deAdminRole != null) && (this.deAdminRole.ParentAdminRole != Guid.Empty))
            {
                try {
                    members = new PLAdminRole().GetMembers(this.deAdminRole.Oid, "Role");
                } catch (PLMException exception) {
                    MessageBoxPLM.Show(exception.Message, "管理角色模型", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                    return;
                }
            }
            if ((allRolesInOneGroup != null) && (allRolesInOneGroup.Count > 0))
            {
                foreach (DERole role3 in allRolesInOneGroup)
                {
                    if (members != null)
                    {
                        bool flag = false;
                        foreach (DERole role4 in members)
                        {
                            if (role4.Oid == role3.Oid)
                            {
                                flag = true;
                                break;
                            }
                        }
                        if (!flag)
                        {
                            continue;
                        }
                    }
                    try {
                        ListViewItem item2 = new ListViewItem(role3.Name, imageIndex);
                        switch (role3.Status)
                        {
                        case 'D':
                            item2.SubItems.Add("删除");
                            break;

                        case 'F':
                            item2.SubItems.Add("冻结");
                            break;

                        case 'S':
                            item2.SubItems.Add("系统");
                            break;

                        case 'A':
                            item2.SubItems.Add("可用");
                            break;
                        }
                        string text = "通用角色";
                        switch (role3.RoleType)
                        {
                        case "P":
                            text = "项目角色";
                            break;

                        case "C":
                            text = "通用角色";
                            break;

                        case "S":
                            text = "产品共享区角色";
                            break;

                        default:
                            text = "通用角色";
                            break;
                        }
                        item2.SubItems.Add(text);
                        if (role3.Status.Equals('S'))
                        {
                            item2.SubItems.Add("");
                            item2.SubItems.Add("");
                        }
                        else
                        {
                            item2.SubItems.Add(role3.Creator);
                            item2.SubItems.Add(role3.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"));
                        }
                        item2.SubItems.Add(role3.Description);
                        item2.Tag = role3;
                        this.lvwRole.Items.Add(item2);
                    } catch {
                    }
                }
            }
            this.currentRoleGroup = deRoleGroup;
        }