Exemplo n.º 1
0
        public async Task <IActionResult> GetTotalQtyByFilters([FromQuery] ProductEntryFiltersViewModel filtersVM)
        {
            try
            {
                var filtersDto = _mapper.Map <ProductEntryFiltersViewModel, ProductEntryFiltersDto>(filtersVM);
                int qty        = await _productEntryUseCases.GetTotalQtyByFilters(filtersDto);

                return(Ok(qty));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> GetByFiltersPageAndQty([FromQuery] ProductEntryFiltersViewModel filtersVM, int skip, int qty)
        {
            try
            {
                var filtersDto = _mapper.Map <ProductEntryFiltersViewModel, ProductEntryFiltersDto>(filtersVM);
                IEnumerable <ProductEntryDto> productEntriesDto = await _productEntryUseCases.GetFilteredByPageAndQty(filtersDto, skip, qty);

                IEnumerable <ProductEntryViewModel> productEntriesVM = _mapper.Map <IEnumerable <ProductEntryDto>, IEnumerable <ProductEntryViewModel> >(productEntriesDto);
                return(Ok(productEntriesVM));
            }
            catch (Exception e)
            {
                throw e;
            }
        }