Пример #1
0
        public FileResult ExportAccountPayableAsExcel(VenderWarrentFilterViewModel filter)
        {
            //In order to get all data that match the given filter.
            var pagingInfo = new PagingInfo()
            {
                PageNumber = -1
            };

            MemoryStream stream = _exportingService.GetAccountsPayable(filter.VendorId, filter.Name, filter.Representative, filter.MinPayDate, filter.MaxPayDate, out int resultCount, pagingInfo.PageNumber,
                                                                       AppSettings.PageSize);

            return(File(stream, Constants.ExcelFilesMimeType,
                        Constants.BuildingPermitTemplateExcelFileName));
        }
Пример #2
0
        public IActionResult Index(int pageNumber = 1, VenderWarrentFilterViewModel filter = default(VenderWarrentFilterViewModel))
        {
            var pagingInfo = new PagingInfo()
            {
                PageNumber = pageNumber
            };

            var results =
                _accountPayableRepository
                .GetAll(filter.VendorId, filter.Name, filter.Representative, filter.MinPayDate, filter.MaxPayDate, out int resultCount, pageNumber,
                        AppSettings.PageSize)
                .ToList();

            pagingInfo.Total        = resultCount;
            ViewBag.FilterViewModel = filter;
            return(View(results.ToMappedPagedList <VenderWarrent, VenderWarrentViewModel>(pagingInfo)));
        }
Пример #3
0
        public ActionResult ExportAccountPayableAsPdf(VenderWarrentFilterViewModel filter)
        {
            //In order to get all data that match the given filter.
            var pagingInfo = new PagingInfo()
            {
                PageNumber = -1
            };

            var entities = _accountPayableRepository
                           .GetAll(filter.VendorId, filter.Name, filter.Representative, filter.MinPayDate, filter.MaxPayDate, out int resultCount, pagingInfo.PageNumber,
                                   AppSettings.PageSize)
                           .ToList();

            return(new Rotativa.AspNetCore.ViewAsPdf(entities.ToMappedPagedList <VenderWarrent, VenderWarrentViewModel>(pagingInfo))
            {
                FileName = $"AccountPayabler.pdf"
            });
        }