Example #1
0
        public ActionResult ExportAccountPayrollAsExcel(AccountPayrollFilterViewModel filter)
        {
            var pagingInfo = new PagingInfo()
            {
                PageNumber = -1
            };

            MemoryStream stream =
                _exportingService
                .GetAccountPayroll(filter.FirstName, filter.LastName, filter.SSN, filter.MinDate, filter.MaxDate, filter.EmployeeNumber, out int resultCount, pagingInfo.PageNumber);

            return(File(stream, Constants.ExcelFilesMimeType, Constants.AccountPayrollTemplateExcelFileName));
        }
Example #2
0
        public ActionResult ExportAccountPayrollAsPdf(AccountPayrollFilterViewModel filter)
        {
            var pagingInfo = new PagingInfo()
            {
                PageNumber = -1
            };

            var entities =
                _accountPayrollRepository
                .GetAll(filter.FirstName, filter.LastName, filter.SSN, filter.MinDate, filter.MaxDate, filter.EmployeeNumber, out int resultCount, pagingInfo.PageNumber)
                .ToList();

            return(new Rotativa.AspNetCore.ViewAsPdf(entities.ToMappedPagedList <AccountPayroll, AccountPayrollViewModel>(pagingInfo))
            {
                FileName = $"AccountPayroll.pdf"
            });
        }
Example #3
0
        public IActionResult Index(int pageNumber = 1, AccountPayrollFilterViewModel filter = default(AccountPayrollFilterViewModel))
        {
            var pagingInfo = new PagingInfo()
            {
                PageNumber = pageNumber
            };

            var results =
                _accountPayrollRepository
                .GetAll(filter.FirstName, filter.LastName, filter.SSN, filter.MinDate, filter.MaxDate, filter.EmployeeNumber, out int resultCount, pageNumber,
                        AppSettings.PageSize)
                .ToList();

            pagingInfo.Total        = resultCount;
            ViewBag.FilterViewModel = filter;
            return(View(results.ToMappedPagedList <AccountPayroll, AccountPayrollViewModel>(pagingInfo)));
        }