public PageResult<UserRoleDto> SearchUsers(string keyword, Guid? roleId, PageRequest request) { using (var db = base.NewDB()) { var query = from a in db.UserRoleRLs where (roleId == null || roleId == a.RoleId) select a.User; return query.ToRoleDtos() .WhereByKeyword(keyword) .Distinct() .ToPageResult(request) .Build(db); } }
public PartialViewResult List(UserSearchCriteria criteria, PageRequest request) { var service = Ioc.Get<Services.Admin.IUserService>(); var list = service.Search(criteria, request); return AreaPartialView("user/list.cshtml", list); }
public PartialViewResult SearchUsers(string keyword, Guid? roleId, PageRequest request) { var service = Ioc.Get<IRoleService>(); var list = service.SearchUsers(keyword, roleId, request); return AreaPartialView("role/usersList.cshtml", list); }