Exemplo n.º 1
0
        public async Task <IActionResult> ClosedApplications(int page = 1)
        {
            var statusCounts = await _applyApiClient.GetFinancialApplicationsStatusCounts();

            var applications = await _applyApiClient.GetClosedFinancialApplications();

            var paginatedApplications = new PaginatedList <RoatpFinancialSummaryItem>(applications, applications.Count, page, int.MaxValue);

            var viewmodel = new RoatpFinancialDashboardViewModel {
                Applications = paginatedApplications, StatusCounts = statusCounts
            };

            return(View("~/Views/Roatp/Apply/Financial/ClosedApplications.cshtml", viewmodel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> ClosedApplications([StringTrim] string searchTerm, string sortColumn, string sortOrder, int page = 1)
        {
            ValidateSearchTerm(searchTerm);

            var applications = await _applyApiClient.GetClosedFinancialApplications(ModelState.IsValid?searchTerm : null, sortColumn, sortOrder);

            var statusCounts = await _applyApiClient.GetFinancialApplicationsStatusCounts(ModelState.IsValid?searchTerm : null);

            var viewmodel = new RoatpFinancialDashboardViewModel
            {
                Applications = new PaginatedList <RoatpFinancialSummaryItem>(applications, applications.Count, page, int.MaxValue),
                StatusCounts = statusCounts,
                SelectedTab  = nameof(ClosedApplications),
                SearchTerm   = searchTerm,
                SortColumn   = sortColumn,
                SortOrder    = sortOrder
            };

            return(View("~/Views/Roatp/Apply/Financial/ClosedApplications.cshtml", viewmodel));
        }