public RightSetViewModel() { //查询角色 RoleDao roleDao = new RoleDao(); var roleRlt = roleDao.GetRoles(); if (roleRlt.HasError) { MessageAlert.Alert(roleRlt.Msg); } else { Roles = roleRlt.Entities; } //查询所有权限 RightDao rightDao = new RightDao(); var rightRlt = rightDao.GetRights(); if (rightRlt.HasError) { MessageAlert.Alert(rightRlt.Msg); } else { Rights = rightRlt.Entities; } }
public Response <List <RoleResult> > GetRoles() { var result = new Response <List <RoleResult> >(); result.Result = roleDao.GetRoles(); return(result); }
public void GetRolesTest() { var target = new RoleDao(); var roleId = new[] { "role1", "role2" }; ReadOnlyCollection <Role> actual; actual = target.GetRoles(roleId); Assert.AreEqual(2, actual.Count); }
public void GetRolesTest() { var target = new RoleDao(); var roleId = new[] { "role1", "role2" }; ReadOnlyCollection<Role> actual; actual = target.GetRoles(roleId); Assert.AreEqual(2, actual.Count); }
public IList <Role> Search(int tenantId, int operatorId, PagingObject paging, List <SortedField> sortedFields) { return(_roleDao.GetRoles(tenantId, operatorId, paging, sortedFields).Select(role => role.ToBusinessObject()).ToList()); }