private ProviderUserSearchResultsViewModel GetProviderUsers(string ukprn) { var provider = _providerService.GetProvider(ukprn); var viewModel = new ProviderUserSearchResultsViewModel { SearchViewModel = new ProviderUserSearchViewModel(), ProviderName = $"{provider.TradingName} ({provider.Ukprn})", ProviderUsers = _providerUserProvider.GetProviderUsers(ukprn).ToList() }; return(viewModel); }
public ProviderUserSearchResultsViewModel SearchProviderUsers(ProviderUserSearchViewModel searchViewModel) { var searchParameters = new ProviderUserSearchParameters { Username = searchViewModel.Username, Name = searchViewModel.Name, Email = searchViewModel.Email, AllUnverifiedEmails = searchViewModel.AllUnverifiedEmails }; var providerUsers = _userProfileService.SearchProviderUsers(searchParameters); var viewModel = new ProviderUserSearchResultsViewModel { SearchViewModel = searchViewModel, ProviderUsers = providerUsers.Select(Convert).ToList() }; return(viewModel); }
public ActionResult SearchProviderUsers(ProviderUserSearchResultsViewModel viewModel) { viewModel.SearchViewModel.PerformSearch = true; return(RedirectToRoute(RecruitmentRouteNames.AdminProviderUsers, viewModel.SearchViewModel)); }