public void WriteToXml() { this.filePath = @"C:\users\Dan\Documents\FlightDatabase.xml"; seatChart.SeedSeatChart(10); this.itinerary = new Itinerary(); XmlSerializer xmlWriter = new XmlSerializer(seatChart.GetType()); StreamWriter writer = new StreamWriter(filePath); xmlWriter.Serialize(writer, seatChart); }
public ViewItineraryWindow() { InitializeComponent(); Itinerary myItinerary = new Itinerary(myOrigin, myDestination, airPlane, passenger, seat) { originationCity = myOrigin, destinationCity = myDestination, plane = airPlane, traveler = passenger, assignedSeat = seat }; this.DataContext = myItinerary; //passengerManifest.Add(passenger); //Flight myFlight = new Flight(airPlane, 101, myOrigin, myDestination, passengerManifest) {m}; //this.DataContext = myFlight; //PassengerView Passenger = new PassengerView("Adam", null) { Name = "Adam", ChosenSeat = null }; //Origin origin = new Origin("Kanto") { FlightOrigin = "Kanto" }; //this.DataContext = Passenger; //this.DataContext = origin; }
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); }