示例#1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            Manifest Main = new Manifest();
            this.Main = new Manifest();
            Marionette = new Plane(true, 3000);
            this.Marionette = new Plane(true, 3000);

            FileRead readWrite = new FileRead();
            this.readWrite = new FileRead();
            readWrite.FileReader();
            int seatsToSubtract = readWrite.PassManifest.Count();
            readWrite.seatsToSubtract(Marionette.Airplane320);

            NumOfSeats.Text = Marionette.Airplane320.Count.ToString();
            PlaneName.Text = this.PlaneNames;
            FlightInformation.Text = this.FlightInfo;

            foreach (Seat chair in Marionette.Airplane320)
            {
                ListOfAvailableSeats.Items.Add(chair);

            }


            Marionette.PurchaseSeat(Marionette.Airplane320);
            string seatID = Marionette.assignToPerson();
            Passenger person = new Passenger(PassengerName.Text, Age.Text, Email.Text, seatID);
            Main.AddPassengerToManifest(person);
            readWrite.FileWriter(person);

            PassengerName.Text = "";
            Age.Text = "";
            Email.Text = "";
        }
        private void PassengerManifest_Loaded(object sender, RoutedEventArgs e)
        {
            Manifest Main = new Manifest();

            FileRead readWrite = new FileRead();

            readWrite.FileReader();




            foreach (Passenger id in readWrite.PassManifest)
            {
                PeopleList.Items.Add("Name: " + id.Name + "    Age: " + id.Age + "    Email: " + id.Email + "    Seat: " + id.SeatID);
            }
        }
示例#3
0
        private void FlightPlan2_Loaded(object sender, RoutedEventArgs e)
        {
            Manifest Main = new Manifest();

            Marionette = new Plane(true, 3000);


            FileRead readWrite = new FileRead();

            readWrite.FileReader();
            int seatsToSubtract = readWrite.PassManifest.Count();
            readWrite.seatsToSubtract(Marionette.Airplane320);

            NumOfSeats.Text = Marionette.Airplane320.Count.ToString();
            PlaneName.Text = this.PlaneNames;
            FlightInformation.Text = this.FlightInfo;

            foreach (Seat chair in Marionette.Airplane320)
            {
                ListOfAvailableSeats.Items.Add(chair);

            }
        }