public async Task <IActionResult> Edit(int id) { this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); var activityToEdit = await this.activitiesService.GetViewModelByIdAsync <ActivityEditViewModel>(id); return(this.View(activityToEdit)); }
public async Task <IActionResult> Edit(int id) { this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); var restaurantToEdit = await this.restaurantsService.GetViewModelByIdAsync <RestaurantEditViewModel>(id); return(this.View(restaurantToEdit)); }
public async Task <IActionResult> Search() { var fromDestination = int.Parse(this.Request.Query["FromDestinationId"]); var toDestination = int.Parse(this.Request.Query["ToDestinationId"]); var date = DateTime.TryParse(this.Request.Query["DateOfDeparture"], out DateTime dateOfDeparture); var count = this.tripsService.Count(); this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); TripSearchViewModel searchResultViewModel = await this.destinationsService.GetSearchResultAsync(fromDestination, toDestination, dateOfDeparture); return(this.PartialView("_SearchResultPartial", searchResultViewModel)); }
public IActionResult Index(int?page) { var pageNumber = page ?? 1; this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); var trips = this.tripsService.GetTripPosts <TripDetailsViewModel>(); var viewModel = new TripListViewModel() { Trips = trips.ToPagedList(pageNumber, GlobalConstants.ItemsPerPage), SearchQuery = new TripSearchInputModel(), }; return(this.View(viewModel)); }
public IActionResult Create() { this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); return(this.View()); }
public async Task <IActionResult> Index(TripSearchInputModel model) { model.DateOfDeparture = DateTime.Now; this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); return(this.View()); }
public async Task <IActionResult> Index(SearchInputModel searchInputModel) { this.HttpContext.Session.SetString("SessionsTest", "Test"); this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService); return(this.View()); }