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); } }
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); } }