// GET: Flights/Create public IActionResult Create() { var model = new Flight { Airplanes = _airplaneRepository.GetComboAirplanes(), Airports = _airportRepository.GetComboAirports() }; return(this.View(model)); }
public FlightViewModel ToFlightViewModel(Flight model) { return(new FlightViewModel { Airplanes = _airplaneRepository.GetComboAirplanes(), Airports = _airportRepository.GetComboAirports(), ArrivalAirport = model.ArrivalAirport, DepartureAirport = model.DepartureAirport, Airplane = model.Airplane, BusinessPrice = model.BusinessPrice, EconomyPrice = model.EconomyPrice, DateTime = model.DateTime, AirplaneId = model.AirplaneId, ArrivalAirportId = model.ArrivalAirportId, DepartureAirportId = model.DepartureAirportId, Id = model.Id, Tickets = model.Tickets }); }