Ejemplo n.º 1
0
        public async Task <IActionResult> Index(string search, string filter, int page = 1, int ipp = 10)
        {
            ViewData["FilterValue"] = !String.IsNullOrWhiteSpace(filter) ? filter : String.Empty;
            ViewData["SearchValue"] = !String.IsNullOrWhiteSpace(search) ? search : String.Empty;
            ViewData["PageValue"]   = page;
            ViewData["IppValue"]    = ipp;

            var parts = await _partsService.GetPaginatedPartsBySearchParams(search, filter, page, ipp);

            var viewModel = new InventoryIndexViewModel()
            {
                PaginatedParts = _pListMapper.MapToViewModelList <PartViewModel, Part>(parts)
            };

            return(View(viewModel));
        }