Exemple #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);
            }
        }
Exemple #2
0
 private void lvwRole_ItemActivate(object sender, EventArgs e)
 {
     if (this.lvwRole.SelectedItems.Count > 0)
     {
         if (this.lvwRole.SelectedItems[0].Tag is DERole)
         {
             if (this.PrinSelected != null)
             {
                 this.PrinSelected(this.lvwRole.SelectedItems[0].Tag as DERole);
             }
         }
         else if (this.lvwRole.SelectedItems[0].Tag is DERoleGroup)
         {
             this.FillRolesOfOneGroup((DERoleGroup)this.lvwRole.SelectedItems[0].Tag);
         }
         else if (((this.currentRoleGroup != null) && (this.lvwRole.SelectedItems[0].Tag is string)) && this.lvwRole.SelectedItems[0].Tag.ToString().Equals("返回上一层"))
         {
             int iconIndex = ClientData.MyImageList.GetIconIndex("ICO_RSP_ROLE");
             this.lvwRole.Items.Clear();
             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);
             }
             this.currentRoleGroup = null;
         }
     }
 }