public virtual ActionResult EditAircraft(Guid id, AircraftViewModel aircraftViewModel) { var aircraft = Repository.Get<AircraftMDS>(id); this.Validate(aircraftViewModel, string.Empty); if (!ModelState.IsValid) { var viewModel = Mapper.Map<AircraftMDS, AircraftViewModel>(aircraft); return View(Views.EditAircraft, viewModel); } Mapper.Map<AircraftViewModel, AircraftMDS>(aircraftViewModel, aircraft); return RedirectToAction(MVC.FlightPrograms.Manage()); }
public virtual ActionResult CreateAircraft(AircraftViewModel aircraftViewModel) { this.Validate(aircraftViewModel, string.Empty); if (!ModelState.IsValid) return View(Views.CreateAircraft, aircraftViewModel); flightProgramsRepository.AddNewAircraftMds(aircraftViewModel.Name); return RedirectToAction(MVC.FlightPrograms.Manage()); }