public async Task <MoviesWithPagination> GetMovies(int page, int rows, string orderProperty = "Name", string order = "asc") { var orderEnum = SortOrderConverter.GetSortOrderFromString(order); Tuple <IList <MovieDTO>, PaginationInfo> tupleMovieAndPagination = await _service.GetMovies(page, rows, orderProperty, orderEnum); MoviesWithPagination response = new MoviesWithPagination(); response.Movies = PLMapperConfigurer.Mapper.Map <IList <MovieDTO>, List <MoviePL> >(tupleMovieAndPagination.Item1); response.PaginationInfo = tupleMovieAndPagination.Item2; return(response); }
public JsonResult GetPhoneCallsJsonList(bool _search, int page, int rows, string sidx, string sord, string filters) { FilterJqdrid jqgridFilter; HolodDAL.Filtering.Filter filter = null; if (_search) { jqgridFilter = FilterJqdrid.DeserializeJson(filters); filter = PLMapperConfigurer.Mapper.Map <FilterJqdrid, HolodDAL.Filtering.Filter>(jqgridFilter); } PaginationInfo paginationInfo; IList <PhoneCallDTO> phoneCallsDTOList = _phoneCallService.GetPhoneCalls(new FilterWithOperators(filter, new JqgridFilterOperators()), page, rows, sidx, SortOrderConverter.GetSortOrderFromString(sord), out paginationInfo); IList <PhoneCallPL> phoneCallsPLList = PLMapperConfigurer.Mapper.Map <IList <PhoneCallDTO>, IList <PhoneCallPL> >(phoneCallsDTOList); PhoneCallsListForJqgrid result = new PhoneCallsListForJqgrid(paginationInfo, phoneCallsPLList); return(this.Json(result, JsonRequestBehavior.AllowGet)); }