public IActionResult Index()
        {
            //For testing purposes. Remember to remove this.
            ReservationLocationViewModel rlvm = new ReservationLocationViewModel {
                FormController = "Home", FormAction = "Index", PickupDate = DateTime.Now, ReturnDate = DateTime.Now, StoreLocation = "jkdjkjsjk"
            };

            return(View(rlvm));
        }
        public IActionResult UpdateReservationInitial(ReservationLocationViewModel rlvm)
        {
            if (ModelState.IsValid)
            {
                var rvmToUpdate = GetReservationViewModelFromSession("updatewizard");
                rvmToUpdate.InitialSetup = rlvm;
                SaveObjectToSession(rvmToUpdate, "updatewizard");
                return(RedirectToAction("UpdateReservationVehicle"));
            }

            return(View(rlvm));
        }
        public IActionResult Index(ReservationLocationViewModel lsvm)
        {
            if (ModelState.IsValid)
            {
                var mainReservationModel = new ReservationViewModel {
                    InitialSetup = lsvm
                };
                SaveObjectToSession(mainReservationModel, "reservationwizard");
                return(RedirectToAction("ReservationVehicleSetup"));
            }

            return(View(lsvm));
        }
        public async Task <IActionResult> UpdateCancelReservation(Reservation reservation)
        {
            var reservationOwner = await _userManager.FindByIdAsync(reservation.ApplicationUserId);

            ReservationLocationViewModel rlvm = new ReservationLocationViewModel
            {
                PickupDate    = reservation.PickupDate,
                ReturnDate    = reservation.ReturnDate,
                StoreLocation = reservation.StoreLocation,
            };

            ReservationContactViewModel rcvm = new ReservationContactViewModel
            {
                Email       = reservationOwner.Email,
                FirstName   = reservationOwner.FirstName,
                LastName    = reservationOwner.LastName,
                PhoneNumber = reservationOwner.PhoneNumber,
                TotalCost   = reservation.TotalCost
            };
            ReservationVehicleViewModel rvvm = new ReservationVehicleViewModel
            {
                ReservationVehicle = _vehicleRepository.GetVehicleById(reservation.VehicleId),
                Vehicles           = _vehicleRepository.GetAllAvailableVehicles()
            };
            ReservationViewModel rvm = new ReservationViewModel
            {
                InitialSetup          = rlvm,
                VehicleSetup          = rvvm,
                ReviewAndContactSetup = rcvm,
                CurrentUserId         = reservation.ApplicationUserId,
                ConfirmationNumber    = reservation.ConfirmationNumber
            };

            SaveObjectToSession(rvm, "updatewizard");
            SaveObjectToSession(reservation, "updatecancelwizard");
            return(View(rvm));
        }
 public IViewComponentResult Invoke(ReservationLocationViewModel rlvm)
 {
     return(View(rlvm));
 }