Exemple #1
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)));
        }
Exemple #2
0
        public MemoryStream GetAccountPayroll(string firstName, string lastName, decimal sSN, DateTime?minDate, DateTime?maxDate, decimal employeeNumber, out int resultCount, int pageNumber = 1, int pageSize = 50)
        {
            string       excelTemplate = GetExcelTemplate(ReportType.AccountPayroll);
            var          templateFile  = new FileInfo(excelTemplate);
            ExcelPackage package       = new ExcelPackage(templateFile, true);

            GenerateAccountPayrollReportExcel(
                package,
                _accountPayrollRepository.GetAll(firstName, lastName, sSN, minDate, maxDate, employeeNumber, out resultCount, pageNumber, pageSize)
                .ToList());

            var stream = new MemoryStream(package.GetAsByteArray());

            return(stream);
        }