public IActionResult GetPage(int page = 1, int quantity = 10, string sort = null, string searchText = null, string role = null, string agency = null, Entity.AccessRequestStatus status = Entity.AccessRequestStatus.OnHold) { if (page < 1) { page = 1; } if (quantity < 1) { quantity = 1; } if (quantity > 20) { quantity = 20; } var filter = new EModel.AccessRequestFilter(page, quantity, new[] { sort }, searchText, role, agency, status); var result = _pimsAdminService.User.GetAccessRequests(filter); var models = _mapper.Map <Model.AccessRequestModel[]>(result.Items); var paged = new PModel.PageModel <Model.AccessRequestModel>(models, page, quantity, result.Total); return(new JsonResult(paged)); }
public IActionResult GetPage(int page = 1, int quantity = 10, string searchText = null, string role = null, string organization = null, string status = null, string sort = null) { if (page < 1) { page = 1; } if (quantity < 1) { quantity = 1; } if (quantity > 20) { quantity = 20; } var filter = new EModel.AccessRequestFilter(page, quantity, searchText, role, organization, status, new[] { sort }); var result = _pimsService.AccessRequest.Get(filter); var models = _mapper.Map <Model.AccessRequestModel[]>(result.Items); var paged = new PModel.PageModel <Model.AccessRequestModel>(models, page, quantity, result.Total); return(new JsonResult(paged)); }