/// <summary> /// 查询用户所有的权限角色 /// 仅包括简单信息 /// </summary> public object QueryPerssionRolesOfUser(string user) { return(from item in PermissionRoleService.QueryPerssionRolesOfUser(Guid.Parse(user)) select new { id = item.Key, name = item.Value }); }
private void BindUserRole() { var userRoles = PermissionRoleService.QueryPerssionRolesOfUser(Guid.Parse(Request.QueryString["EmployeeId"])).ToDictionary(item => item.Key); foreach (PermissionRoleView item in PermissionRoleService.QueryPermissionRoles(this.CurrentCompany.CompanyId).Where(linq => linq.Valid)) { var controlItem = new ListItem(item.Name, item.Id.ToString()); if (userRoles.ContainsKey(item.Id)) { controlItem.Selected = true; } this.chklUserRole.Items.Add(controlItem); } }