Example #1
0
        public MyStaffListViewModel(
            IEnumerable <SupervisorDelegateDetail> supervisorDelegateDetails,
            CentreCustomPrompts centreCustomPrompts,
            string?searchString,
            string sortBy,
            string sortDirection,
            int page
            ) : base(searchString, page, false, sortBy, sortDirection, searchLabel: "Search administrators")
        {
            CentreCustomPrompts = centreCustomPrompts;
            var sortedItems = GenericSortingHelper.SortAllItems(
                supervisorDelegateDetails.AsQueryable(),
                sortBy,
                sortDirection
                );
            var searchedItems = GenericSearchHelper.SearchItems(sortedItems, SearchString).ToList();

            MatchingSearchResults = searchedItems.Count;
            SetTotalPages();
            var paginatedItems = GetItemsOnCurrentPage(searchedItems);

            SuperviseDelegateDetails = paginatedItems;
        }
Example #2
0
 public AllStaffListViewModel(IEnumerable <SupervisorDelegateDetail> supervisorDelegates, CentreCustomPrompts centreCustomPrompts)
 {
     SupervisorDelegateDetails = supervisorDelegates;
     CentreCustomPrompts       = centreCustomPrompts;
 }