Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
 public IActionResult Create()
 {
     this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService);
     return(this.View());
 }
Ejemplo n.º 6
0
 public async Task <IActionResult> Index(TripSearchInputModel model)
 {
     model.DateOfDeparture         = DateTime.Now;
     this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService);
     return(this.View());
 }
Ejemplo n.º 7
0
 public async Task <IActionResult> Index(SearchInputModel searchInputModel)
 {
     this.HttpContext.Session.SetString("SessionsTest", "Test");
     this.ViewData["Destinations"] = SelectListGenerator.GetAllDestinations(this.destinationsService);
     return(this.View());
 }