コード例 #1
0
        static void Main(string[] args)
        {
            SchoolClass a      = new SchoolClass("a");
            SchoolClass b      = new SchoolClass("b");
            SchoolClass v      = new SchoolClass("v");
            SchoolClass g      = new SchoolClass("g");
            School      school = new School("MG");

            school.AddSchoolClass(a, b, v, g);
            school.DeleteSchoolClass("a");
            School.PrintAllClasses(school);
            Teacher teacher1 = new Teacher("Gogo1");
            Teacher teacher2 = new Teacher("Gogo2");
            Teacher teacher3 = new Teacher("Gogo3");
            Teacher teacher4 = new Teacher("Gogo4");

            school.AddTeacher(teacher1, teacher2, teacher3, teacher4);
            school.DeleteTeacher("Gogo2");
            Subject subject = new Subject("Biology", 14, 14);

            teacher1.AddSubject(subject);
            school.PrintTeachers();
            Student student1 = new Student("Gogo", "Ivanov", 1);
            Student student2 = new Student("Ivan", "Ivanov", 3);
            Student student3 = new Student("Dimitar", "Ivanov", 2);
            Student student4 = new Student("Bojidar", "Ivanov", 4);

            a.AddStudent(student1, student3, student2, student4);
            a.PrintStudents();
        }
コード例 #2
0
        private static void Main()
        {
            var firstDiscipline  = new Discipline("Mathematic", 20, 3, "Some comment for math...");
            var secondDiscipline = new Discipline("Physics", 22, 4);
            var firstTeacher     = new Teacher("Georgi Gerogiev", "Some comment for the teacher...");
            var secondTeacher    = new Teacher("Ivan Ivanov");

            firstTeacher.AddDiscipline(null);

            firstTeacher.GetDisciplines().ForEach(x => System.Console.WriteLine(x.Name));
            firstTeacher.AddDiscipline(secondDiscipline);
            secondTeacher.AddDiscipline(firstDiscipline);
            secondTeacher.AddDiscipline(secondDiscipline);
            var firstStudent       = new Student("Pesho Peshov", 112, "Some comment about the student...");
            var secondStudent      = new Student("Gosho Goshov", 113);
            var exampleSchoolClass = new School("Some unique ID", "Some comment...");

            exampleSchoolClass.AddStudent(firstStudent);
            exampleSchoolClass.AddStudent(secondStudent);
            exampleSchoolClass.AddTeacher(firstTeacher);
            exampleSchoolClass.AddTeacher(secondTeacher);
        }