public Flight(AirPlane airPlane, int flightNumber, Origin origin, Destination destination, List<Passenger> passengerManifest) { this.airPlane = airPlane; this.FlightNumber = flightNumber; this.origin = origin; this.destination = destination; this.PassengerManifest = passengerManifest; }
static void Main(string[] args) { Seat seat = new Seat("1A", 300, false); SeatChart seed = new SeatChart(); seed.AddToList(seed.SeedSeatChart(5)); List<Passenger> flightManifest = new List<Passenger>(); Passenger initPassenger = new Passenger("", seat); flightManifest.Add(initPassenger); //passenger chooses origin/destination //passenger buys ticket //Repeat to fill plane // create seatchart for flight Origin origin = new Origin("Lima,Peru"); Destination destination = new Destination("Bogota,Columbia"); //create flight/airplane AirPlane airplane = new AirPlane(100, 300, true, "schedule"); Flight flight = new Flight(airplane, 4345, origin, destination, flightManifest); // TextWriter writer = new StreamWriter("Manifest.txt", true); writer.Write(seat.getSeatName()); writer.Close(); //Dan.Name = "Dan"; //Seat seat1 = new Seat("A1", 300, true); //Origin Milwaukee = new Origin("Milwaukee"); //Destination SanDiego = new Destination("San Diego"); //AirPlane airplane = new AirPlane(); //Itinerary<object> itinerary = new Itinerary<object>(Milwaukee,SanDiego,airplane,Dan,seat1); //MyFileWriter mf = new MyFileWriter(); //SeatChart seatChart = new SeatChart(); //Passenger Adam = new Passenger("Adam",seat1); //seatChart.populateSeatChart(); //seatChart.BuySeat(Adam); //seatChart.GetAvailableSeats(); //Console.WriteLine(Adam.ChosenSeat.getSeatName()); //mf.WriteToFile(Dan,Milwaukee,SanDiego); }
public void WriteToFile(Passenger P, Origin O, Destination D) { this.p = P; this.o = O; this.d = D; TextWriter tw = new StreamWriter("PassengerManifest.csv", true); tw.Write(string.Format("Passenger:{0}\nOrigin:{1}\nDestination:{2}\n\n", P.Name , O.FlightOrigin,D.ChosenDestination)); Console.WriteLine("Your Itinerary has been Created!"); tw.Close(); }
static void Main(string[] args) { Passenger Dan = new Passenger(); Dan.Name = "Dan"; Seat seat = new Seat("3A", 250); Origin Milwaukee = new Origin("Milwaukee"); Destination SanDiego = new Destination("San Diego"); AirPlane airplane = new AirPlane(); Itinerary<object> itinerary = new Itinerary<object>(Milwaukee,SanDiego,airplane,Dan,seat); MyFileWriter mf = new MyFileWriter(); SeatChart seatChart = new SeatChart(); seatChart.populateSeatChart(); mf.WriteToFile(Dan,Milwaukee,SanDiego); }
public ItineraryView() { this._originCity = new Origin("Kanto"); }