Esempio n. 1
0
   public Passenger(Passenger passenger)
   {
       this.Birthdate = passenger.Birthdate;
       this.Firstname = passenger.Firstname;
       this.Gender = passenger.Gender;
       this.Name = passenger.Name;
 
   }
Esempio n. 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {


                this.Passenger = new Passenger(udcPassengerData.Birthdate, udcPassengerData.Firstname, udcPassengerData.Lastname, udcPassengerData.GenderUser);

               
            
        }
Esempio n. 3
0
        public frmPassengerManagement(bool isEdit, Passenger passenger):base()
        {
       
            this.Passenger = passenger;

            udcPassengerData.txtFirstname.Text = this.Passenger.Firstname;
            udcPassengerData.txtLastname.Text = this.Passenger.Name;


            udcPassengerData.dtBirthdate.Value = this.Passenger.Birthdate;

            if (this.Passenger.Gender == Gender.Female)
            {
                udcPassengerData.rbFemaleGender.Checked = true;
                udcPassengerData.rbMaleGender.Checked = false;
            }
            else
            {
                udcPassengerData.rbFemaleGender.Checked = false;
                udcPassengerData.rbMaleGender.Checked = true;
            }

        }
Esempio n. 4
0
  public void AddReservation(Passenger passengers)
  {
      this.Reservations.Add(passengers);
 
  }
Esempio n. 5
0
        private void ReadPassengers()
        {

            passengers.Clear();


            StreamReader file = new StreamReader(path + "Databases\\Passengers.txt");

            string lijn;
            while ((lijn = file.ReadLine()) != null)
            {
                string[] apart = lijn.Split('|');
                Gender gender;
                switch (apart[3])
                {
                    case "Male":
                        gender = Gender.Male;
                        break;
                    case "Female":
                        gender = Gender.Female;
                        break;

                    default:
                        gender = Gender.Unknown;
                        break;
                }

                Passenger passenger = new Passenger(DateTime.Parse(apart[0]), apart[1], apart[2], gender);
                passengers.Add(passenger);

            }

            file.Close();


        }