コード例 #1
0
ファイル: FileReadWrite.cs プロジェクト: Nephithys/Airline
        public void FileWriter(Passenger pass)
        {
            List<Passenger> readAgain = this.PassManifest;
            readAgain.Add(pass);
            string listOfPassengers = JsonConvert.SerializeObject(readAgain, Formatting.Indented);
            File.WriteAllText("../../manifest.json", listOfPassengers);

        }
コード例 #2
0
ファイル: FlightPlan3.xaml.cs プロジェクト: Nephithys/Airline
        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 = "";


        }
コード例 #3
0
ファイル: Manifest.cs プロジェクト: Nephithys/Airline
 public void AddPassengerToManifest(Passenger pass)
 {
     PassManifest.Add(pass);
 }
コード例 #4
0
 public void AddPassengerToManifest(Passenger pass)
 {
     PassManifest.Add(pass);
 }