示例#1
0
 private void UpdateSortDirection(string sortColumn, string sortDirection, IPagingState pagingState)
 {
     if (pagingState.SortColumn == sortColumn)
     {
         pagingState.SortDirection = sortDirection;
     }
     else
     {
         pagingState.SortColumn    = sortColumn;
         pagingState.SortDirection = SortOrder.Asc;
     }
 }
示例#2
0
        private async Task <PaginatedList <ApplicationSummaryItem> > GetPageApplications(string reviewStatus, IPagingState pagingState)
        {
            var withdrawalApplicationsRequest = new WithdrawalApplicationsRequest
                                                (
                null,
                reviewStatus,
                pagingState.SortColumn.ToString(),
                pagingState.SortDirection == SortOrder.Asc ? 1 : 0,
                pagingState.ItemsPerPage,
                pagingState.PageIndex,
                DefaultPageSetSize
                                                );

            var response = await _applyApiClient.GetWithdrawalApplications(withdrawalApplicationsRequest);

            return(response);
        }
示例#3
0
        private async Task <ApplicationsViewModel> AddApplicationsViewModelValues(ApplicationsViewModel viewModel, string reviewStatus, IPagingState pagingState)
        {
            viewModel.ReviewStatus  = reviewStatus;
            viewModel.ItemsPerPage  = pagingState.ItemsPerPage;
            viewModel.SortColumn    = pagingState.SortColumn;
            viewModel.SortDirection = pagingState.SortDirection;
            viewModel.PaginatedList = await GetPageApplications(viewModel.ReviewStatus, pagingState);

            switch (reviewStatus)
            {
            case ApplicationReviewStatus.New:
                viewModel.ChangePageAction         = nameof(ChangePageNewApplications);
                viewModel.ChangeItemsPerPageAction = nameof(ChangeApplicationsPerPageNewApplications);
                viewModel.SortColumnAction         = nameof(SortNewApplications);
                viewModel.Title = "New";
                break;

            case ApplicationReviewStatus.InProgress:
                viewModel.ChangePageAction         = nameof(ChangePageInProgressApplications);
                viewModel.ChangeItemsPerPageAction = nameof(ChangeApplicationsPerPageInProgressApplications);
                viewModel.SortColumnAction         = nameof(SortInProgressApplications);
                viewModel.Title = "In progress";
                break;

            case ApplicationReviewStatus.HasFeedback:
                viewModel.ChangePageAction         = nameof(ChangePageFeedbackApplications);
                viewModel.ChangeItemsPerPageAction = nameof(ChangeApplicationsPerPageFeedbackApplications);
                viewModel.SortColumnAction         = nameof(SortFeedbackApplications);
                viewModel.Title = "Feedback";
                break;

            case ApplicationReviewStatus.Approved:
                viewModel.ChangePageAction         = nameof(ChangePageApprovedApplications);
                viewModel.ChangeItemsPerPageAction = nameof(ChangeApplicationsPerPageApprovedApplications);
                viewModel.SortColumnAction         = nameof(SortApprovedApplications);
                viewModel.Title = "Approved";
                break;
            }

            viewModel.Fragment = ApplicationReviewHelpers.ApplicationFragment(reviewStatus);

            return(viewModel);
        }
 public PrevLink(IPagingState state) : base(state)
 {
 }
示例#5
0
 public Pager(IServiceProvider services, IPagingState state)
 {
     //_Config = config;
     _State    = state;
     _Services = services;
 }
 public NextLink(IPagingState state) : base(state)
 {
 }
示例#7
0
 public Link(IPagingState state /*, IPagingConfig config*/)
 {
     //_Config = config;
     _State = state;
 }
 public NavLink(IPagingState state) : base(state)
 {
 }