Exemplo n.º 1
0
        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();

        }
Exemplo n.º 2
0
        public void BuySeat(Passenger currentPassenger, Seat chosenSeat)
        {
            if (chosenSeat != null)
            {
                currentPassenger.ChosenSeat = chosenSeat;
                chosenSeat = null;
            }
            else
            {
                Console.WriteLine("that seat is already pearchesd");
            }

        }
Exemplo n.º 3
0
        public Itinerary(string origin, string destination,AirPlane airplane,Passenger passenger,Seat seat)
        {
            this.OriginationCity = origin;
            this.DestinationCity = destination;
            this.Plane = airplane;
            this.Traveler = passenger;
            this.AssignedSeat = seat;
            List<object> passengerItinerary = new List<object>();
            passengerItinerary.Add(Traveler);
            passengerItinerary.Add(AssignedSeat);
            passengerItinerary.Add(OriginationCity);
            passengerItinerary.Add(DestinationCity);
            passengerItinerary.Add(Plane);

        }
Exemplo n.º 4
0
 public Passenger CreateNewPassenger(string Name)
 {
     Passenger newPassenger = new Passenger(Name, _seat);
     return newPassenger;
 }
Exemplo n.º 5
0
 public void BuySeat(Passenger currentPassenger, Seat chosenSeat)
 {
     currentPassenger.ChosenSeat = chosenSeat;
 }