Esempio n. 1
0
        public void RoleRefresh(object sender, EventArgs e)
        {
            this.lvwRole.Items.Clear();
            if (this.deAdminRole == null)
            {
                PLAdminRole role = new PLAdminRole();
                object      adminRoleByUserId = role.GetAdminRoleByUserId(ClientData.LogonUser.Oid);
                if (adminRoleByUserId != null)
                {
                    this.deAdminRole = role.GetAdminRole((adminRoleByUserId as DEAdminRoleGrantUser).AdminRole);
                }
            }
            int iconIndex = ClientData.MyImageList.GetIconIndex("ICO_RSP_ROLE");

            if (this.deAdminRole == null)
            {
                AdminRoleUL.FillAllRoles(this.lvwRole, iconIndex, false, true);
            }
            else if (this.deAdminRole.ParentAdminRole == Guid.Empty)
            {
                AdminRoleUL.FillAllRoles(this.lvwRole, iconIndex, false, true);
            }
            else
            {
                AdminRoleUL.FillAdminRoleRoles(this.lvwRole, iconIndex, this.deAdminRole.Oid, true);
            }
        }
Esempio n. 2
0
        public void LoadRoles()
        {
            this.lvwRole.Columns.Add("名称", 100, HorizontalAlignment.Left);
            this.lvwRole.Columns.Add("状态", 50, HorizontalAlignment.Left);
            this.lvwRole.Columns.Add("创建人", 80, HorizontalAlignment.Left);
            this.lvwRole.Columns.Add("创建时间", 150, HorizontalAlignment.Left);
            this.lvwRole.Columns.Add("描述", 200, HorizontalAlignment.Left);
            PLAdminRole role = new PLAdminRole();
            object      adminRoleByUserId = role.GetAdminRoleByUserId(ClientData.LogonUser.Oid);

            if (adminRoleByUserId != null)
            {
                this.deAdminRole = role.GetAdminRole((adminRoleByUserId as DEAdminRoleGrantUser).AdminRole);
            }
        }