Пример #1
0
        public IActionResult GetDrawers([FromQuery] DrawerQueryFilter filters)
        {
            var drawers     = _drawerService.GetDrawers(filters);
            var drawersDtos = _mapper.Map <IEnumerable <DrawerDto> >(drawers);

            return(Ok(drawersDtos));
        }
Пример #2
0
        public IEnumerable <DrawerDto> GetDrawers(DrawerQueryFilter filters)
        {
            filters.PageNumber = filters.PageNumber == 0 ? _paginationOptions.DefaultPageNumber : filters.PageNumber;
            filters.PageSize   = filters.PageSize == 0 ? _paginationOptions.DefaultPageSize : filters.PageSize;
            var drawers = _unitOfWork.DrawerRepository.GetAllDrawers(filters.BookSheflId, filters.RowStart, filters.RowEnd, filters.ColStart, filters.ColEnd);

            Debug.WriteLine(filters.RowStart.ToString() + "sdasdasdasd");
            if (filters.BookGroupId != null)
            {
                var books = _unitOfWork.BookRepository.GetBookByBookGroup(filters.BookGroupId);
                drawers = _unitOfWork.DrawerRepository.GetDrawerByListBook(books);
            }

            if (filters.BookSheflId != null && filters.RowStart.ToString() == "0")
            {
                drawers = _unitOfWork.DrawerRepository.GetDrawerByBookShelfId(filters.BookSheflId);
            }
            return(drawers);
        }
Пример #3
0
        public Uri GetDrawerPaginationUri(DrawerQueryFilter filter, string actionUrl)
        {
            string baseUrl = $"{_baseUri}{actionUrl}";

            return(new Uri(baseUrl));
        }