Beispiel #1
0
        public void AddPilot(Pilot pilots)
        {
            this.Pilots.Add(pilots);

        }
Beispiel #2
0
        private void ReadPilots()
        {

            pilots.Clear();


            StreamReader file = new StreamReader(path + "Databases\\Pilots.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;
                }

                Pilot pilot = new Pilot(DateTime.Parse(apart[0]), apart[1], apart[2], gender);

                pilots.Add(pilot);

            }

            file.Close();


        }