Ejemplo n.º 1
0
        public ActionResult Edit(long id)
        {
            _itinerarysRepository = new ItinerarysRepository();
            _flightsRepository    = new FlightsRepository();
            ViewBag.flightList    = _flightsRepository.GetFlightsByItinerary(id);

            return(View(_itinerarysRepository.Get(id)));
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Itinerary model)
        {
            if (ModelState.IsValid)
            {
                _itinerarysRepository = new ItinerarysRepository();
                var currentItinerary = _itinerarysRepository.Get(model.ItineraryID);

                model.From        = currentItinerary.From;
                model.To          = currentItinerary.To;
                model.RetStops    = currentItinerary.RetStops;
                model.TripType    = currentItinerary.TripType;
                model.PassengerID = currentItinerary.PassengerID;
                _itinerarysRepository.Update(model);
                ViewBag.SuccessMessage = "The itinerary was updated successfully.";
            }
            _flightsRepository = new FlightsRepository();
            ViewBag.flightList = _flightsRepository.GetFlightsByItinerary(model.ItineraryID);

            return(View(model));
        }