public ParticipantsReceptionViewModel BuildParticipantSearch(IDisplayPagination pagination, string searchWords) { if (searchWords.IsEmptyString()) { return(new ParticipantsReceptionViewModel()); } var conventionId = Actor.ManagedConvention.ConventionId; var query = Session .Query <Participants_BySearchQuery.Result, Participants_BySearchQuery>() .Include(x => x.ParticipantId) .Include(x => x.ConventionId) .Include(x => x.EventIds) .Statistics(out var stats) .Search(x => x.SearchText, searchWords) .Where(x => x.IsLongTerm || x.ConventionId == conventionId) .OrderBy(x => x.FullName) .Skip(pagination.SkipCount) .Take(pagination.ResultsPerPage) .As <ConventionEngagement>() .ToList(); var wrapperFactory = new Factories.WrapperFactory(Session); var viewModel = new ParticipantsReceptionViewModel { Pagination = DisplayPagination.BuildForView( stats.TotalResults, pagination.SkipCount, pagination.ResultsPerPage), Participants = wrapperFactory.Wrap(query) }; return(viewModel); }
public IActionResult Manage(int page = 0, bool allowHistory = false, int perPage = ResultsPerPage) { var viewModel = Gateway.BuildIndex(DisplayPagination.BuildForGateway(page, perPage), allowHistory); viewModel.AllowHistoryParticipants = allowHistory; return(View(viewModel)); }
public IActionResult ManageSearch(string searchWords, bool allowHistory = false, int page = 0, int perPage = ResultsPerPage) { var viewModel = Gateway.BuildSearchIndex(DisplayPagination.BuildForGateway(page, perPage), allowHistory, searchWords); viewModel.AllowHistoryParticipants = allowHistory; return(View("Manage", viewModel)); }
public IActionResult Manage(EventsManagementViewModel.Filters ActiveFilters, int page = 0, int perPage = ResultsPerPage) { var viewModel = Gateway.BuildIndex(DisplayPagination.BuildForGateway(page, perPage), ActiveFilters); return(View(viewModel)); }
public IActionResult Manage(int page = 0, int perPage = ResultsPerPage, string tab = null) { ViewBag.HelperTab = tab; var viewModel = Gateway.BuildIndex(DisplayPagination.BuildForGateway(page, perPage)); return(View(viewModel)); }
public ConventionManagementViewModel BuildConventionList(IDisplayPagination pagination) { var result = new ConventionManagementViewModel(); var conventions = Session .Query <Convention>() .Include(x => x.DayIds) .Include(x => x.HallIds) .Include(x => x.TicketIds) .Statistics(out var stats) .OrderByDescending(x => x.CreateTimeStamp) .Skip(pagination.SkipCount) .Take(pagination.ResultsPerPage) .ToList(); var wrapperFactory = new WrapperFactory(Session); result.Conventions = wrapperFactory.Wrap(conventions); result.Pagination = DisplayPagination.BuildForView(stats.TotalResults, pagination.SkipCount, pagination.ResultsPerPage); return(result); }
public ParticipantsManagementViewModel BuildSearchIndex(IDisplayPagination pagination, bool allowHistory = false, string searchWords = "") { if (searchWords.IsEmptyString()) { return(new ParticipantsManagementViewModel()); } var query = Session.Query <Participants_BySearchQuery.Result, Participants_BySearchQuery>() .Include(x => x.ParticipantId) .Include(x => x.ConventionId) .Statistics(out var stats) .Search(x => x.SearchText, searchWords).AsQueryable(); if (allowHistory == false) { query = query.Where(x => x.ConventionId == Actor.ManagedConvention.ConventionId); } var results = query .OrderBy(x => x.FullName) .Skip(pagination.SkipCount) .Take(pagination.ResultsPerPage) .As <ConventionEngagement>() .ToList(); var wrapperFactory = new WrapperFactory(Session); var viewModel = new ParticipantsManagementViewModel { Pagination = DisplayPagination.BuildForView( stats.TotalResults, pagination.SkipCount, pagination.ResultsPerPage), Engagements = wrapperFactory.Wrap(results, false), filters = new ParticipantsManagementViewModel.Filters() }; return(viewModel); }
public IActionResult Manage(int page = 0, int perPage = ResultsPerPage) { var conventionViewModel = Gateway.BuildConventionList(DisplayPagination.BuildForGateway(page, perPage)); return(View(conventionViewModel)); }
public IActionResult SearchParticipant(string searchWords, int page, int perPage = 100) { var viewModel = Gateway.BuildParticipantSearch(DisplayPagination.BuildForGateway(page, perPage), searchWords); return(View("_PartialAjaxUserDisplay", viewModel)); }
public IActionResult ManageSearch(string searchWords, int page = 0, int perPage = ResultsPerPage) { var viewModel = Gateway.BuildIndex(DisplayPagination.BuildForGateway(page, perPage), searchWords); return(View("Manage", viewModel)); }