Exemple #1
0
 static void PrintTeachers(SchoolClass schoolClass)
 {
     foreach (var teacher in schoolClass.GetTeachers)
     {
         Console.WriteLine("----------");
         Console.WriteLine(teacher.Name + " teaches:");
         foreach (var discipline in teacher.DisciplinesToTeach)
         {
             Console.WriteLine(discipline.Name);
         }
         Console.WriteLine("----------");
     }
 }
Exemple #2
0
        public void RemoveClass(SchoolClass classToRemove)
        {
            bool removed = false;

            foreach (var clas in this.classesInThisSchool)
            {
                if (classToRemove.GetIdentifier == clas.GetIdentifier)
                {
                    this.classesInThisSchool.Remove(clas);
                    removed = true;
                    break;
                }
            }

            if (!removed)
            {
                throw new ArgumentException("No such class exists");
            }
        }
Exemple #3
0
 // Methods
 public void AddClass(SchoolClass classToAdd)
 {
     this.classesInThisSchool.Add(classToAdd);
 }