Ejemplo n.º 1
0
        public IActionResult Confirm(int id)
        {
            if (reservationService.GetReservationById(id) == null)
            {
                return(RedirectToAction("NotFound"));
            }

            reservationService.ConfirmReservation(id);

            FlightBooking reservation = reservationService.GetReservationById(id);

            ReservationConfirmViewModel model = new ReservationConfirmViewModel()
            {
                DepartureCity   = reservation.Flight.LeavingFrom,
                DestinationCity = reservation.Flight.GoingTo,
                Name            = reservation.FirstName + " " + reservation.Surname
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public IActionResult Confirm(Guid id)
        {
            if (reservationService.GetReservationById(id) == null)
            {
                return(RedirectToAction("NotFound"));
            }

            reservationService.ConfirmReservation(id);

            Reservation reservation = reservationService.GetReservationById(id);

            ReservationConfirmViewModel model = new ReservationConfirmViewModel()
            {
                DepartureCity   = reservation.Flight.DepartureCity,
                DestinationCity = reservation.Flight.DestinationCity,
                Name            = reservation.FirstName + " " + reservation.LastName
            };

            return(View(model));
        }