Beispiel #1
0
        public ActionResult Index()
        {
            var input = new PagedAndSortedAndFilteredInput()
            {
                SerialNumber = 123456L
            };
            var output = _barcodeAppService.GetAll(input);

            output = _barcodeAppService.GetAll(input as PagedAndSortedResultRequestDto);
            return(View(output));
        }
        public ActionResult Index(int?page)
        {
            var input = new PagedAndSortedAndFilteredInput()
            {
                CurrentPage = page ?? 0,
            };

            input.SkipCount = input.CurrentPage * input.MaxResultCount;

            var applicationLanguageTexts = _applicationLanguageTextAppService.GetAll(input);

            return(View(applicationLanguageTexts));
        }
Beispiel #3
0
        public PagedResultDto <BarcodeDto> GetAll(PagedAndSortedAndFilteredInput input)
        {
            var query    = _barcodeRepository.GetAllIncluding(barcode => barcode.Customer);
            var barcodes = query
                           .WhereIf(input.SerialNumber.HasValue, barcode => barcode.SerialNumber == input.SerialNumber)
                           .WhereIf(string.IsNullOrWhiteSpace(input.CustomerName) == false, barcode => barcode.Customer.Name == input.CustomerName)
                           .OrderBy(input.Sorting)
                           .PageBy(input)
                           .ToList();
            var count = _barcodeRepository.Count();

            return(new PagedResultDto <BarcodeDto>()
            {
                TotalCount = count, Items = Mapper.Map <List <BarcodeDto> >(barcodes)
            });
        }
        public PagedOutput <ApplicationLanguageTextDto> GetAll(PagedAndSortedAndFilteredInput input)
        {
            var query         = _applicationLanguageTextRepository.GetAll();
            var languageTexts = query
                                .OrderBy(input.Sorting)
                                .PageBy(input)
                                .ToList();
            var count = _applicationLanguageTextRepository.Count();

            return(new PagedOutput <ApplicationLanguageTextDto>()
            {
                CurrentPage = input.CurrentPage,
                PageCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(count) / input.MaxResultCount)),
                TotalCount = count,
                Items = Mapper.Map <List <ApplicationLanguageTextDto> >(languageTexts)
            });
        }