Exemple #1
0
        static void Main(string[] args)
        {
            StudentCollection studentCollection1 = new StudentCollection();

            studentCollection1.CollectionName = "Students1";

            StudentCollection studentCollection2 = new StudentCollection();

            studentCollection2.CollectionName = "Students2";

            Student[] students1 = new Student[]
            {
                new Student(new Person("Alina", "Ivanchuk", new DateTime(2001, 2, 7)), Education.Bachelor, 302),
                new Student(new Person("Serhiy", "Melnyk", new DateTime(1999, 12, 1)), Education.Bachelor, 302),
                new Student(new Person("Andriy", "Andriev", new DateTime(1998, 1, 13)), Education.Bachelor, 322)
            };

            Student[] students2 = new Student[]
            {
                new Student(new Person("Vasyl", "Koval", new DateTime(1999, 2, 12)), Education.Bachelor, 302),
                new Student(new Person("Olha", "Kovinko", new DateTime(1999, 5, 20)), Education.Bachelor, 322),
                new Student(new Person("Petro", "Petrov", new DateTime(2001, 1, 3)), Education.Bachelor, 322)
            };

            studentCollection1.AddStudents(students1);
            studentCollection2.AddStudents(students2);

            Journal journal1 = new Journal();
            Journal journal2 = new Journal();

            studentCollection1.StudentCountChange     += journal1.ProcessStudentCountChange;
            studentCollection2.StudentReferenceChange += journal2.ProcessStudentReferenceChange;

            studentCollection2.StudentCountChange     += journal2.ProcessStudentCountChange;
            studentCollection2.StudentReferenceChange += journal2.ProcessStudentReferenceChange;

            studentCollection1[1] = new Student(new Person("Volodymyr", "Schevchenko", new DateTime(1999, 2, 25)), Education.Bachelor, 312);
            studentCollection2[1] = new Student(new Person("Iryna", "Sokil", new DateTime(1999, 10, 2)), Education.Bachelor, 322);

            studentCollection1.AddStudents(new Student[] { new Student(new Person("Roman", "Karpiv", new DateTime(2000, 1, 16)), Education.Bachelor, 312) });
            studentCollection2.AddStudents(new Student[] { new Student(new Person("Kyrylo", "Kaplenko", new DateTime(2001, 12, 30)), Education.Bachelor, 312) });

            studentCollection1.Remove(0);
            studentCollection2.Remove(0);

            Console.WriteLine(journal1.ToString());
            Console.WriteLine();
            Console.WriteLine(journal2.ToString());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            StudentCollection studentCollection1 = new StudentCollection();

            studentCollection1.CollectionName = "Students1";

            StudentCollection studentCollection2 = new StudentCollection();

            studentCollection2.CollectionName = "Students2";

            Student[] students1 = new Student[]
            {
                new Student(new Person("Serhiy", "Pityk", new DateTime(2000, 3, 27)), Education.Bachelor, 312),
                new Student(new Person("Artem", "Shtefanesa", new DateTime(1999, 2, 10)), Education.Bachelor, 312),
                new Student(new Person("Margarita", "Boiko", new DateTime(2000, 3, 23)), Education.Bachelor, 302)
            };

            Student[] students2 = new Student[]
            {
                new Student(new Person("Ksenia", "Dolgan", new DateTime(1999, 12, 1)), Education.Bachelor, 302),
                new Student(new Person("Irina", "Zhizhiyan", new DateTime(2000, 5, 25)), Education.Bachelor, 302),
                new Student(new Person("Elisabet", "Moiseenko", new DateTime(2000, 7, 3)), Education.Bachelor, 312)
            };

            studentCollection1.AddStudents(students1);
            studentCollection2.AddStudents(students2);

            Journal journal1 = new Journal();
            Journal journal2 = new Journal();

            studentCollection1.StudentCountChange     += journal1.ProcessStudentCountChange;
            studentCollection2.StudentReferenceChange += journal2.ProcessStudentReferenceChange;

            studentCollection2.StudentCountChange     += journal2.ProcessStudentCountChange;
            studentCollection2.StudentReferenceChange += journal2.ProcessStudentReferenceChange;

            studentCollection1[1] = new Student(new Person("Vladislav", "Garvasiuk", new DateTime(2000, 5, 15)), Education.Bachelor, 302);
            studentCollection2[1] = new Student(new Person("Serhiy", "Kosovchich", new DateTime(2000, 8, 9)), Education.Bachelor, 312);

            studentCollection1.AddStudents(new Student[] { new Student(new Person("Andriy", "Drobot", new DateTime(2000, 10, 6)), Education.Bachelor, 302) });
            studentCollection2.AddStudents(new Student[] { new Student(new Person("Kristyan", "Morarash", new DateTime(2000, 2, 20)), Education.Bachelor, 312) });

            studentCollection1.Remove(0);
            studentCollection2.Remove(0);

            Console.WriteLine(journal1.ToString());
            Console.WriteLine();
            Console.WriteLine(journal2.ToString());
        }
Exemple #3
0
        static void Main(string[] args)
        {
            StudentCollection stud_ob1 = new StudentCollection();
            StudentCollection stud_ob2 = new StudentCollection();
            Journal           ob1      = new Journal();
            Journal           ob2      = new Journal();


            stud_ob1.StudentCountChanged     += ob1.Stud_StudentCountChanged;
            stud_ob1.StudentReferenceChanged += ob1.Stud_StudentReferenceChanged;

            stud_ob1.StudentCountChanged     += ob2.Stud_StudentCountChanged;
            stud_ob1.StudentReferenceChanged += ob2.Stud_StudentReferenceChanged;

            stud_ob2.StudentCountChanged     += ob2.Stud_StudentCountChanged;
            stud_ob2.StudentReferenceChanged += ob2.Stud_StudentReferenceChanged;

            Student stud1 = new Student();

            stud1._DateStudent = new Person("CCCC", "uuu", new DateTime(1997, 5, 21));
            stud1._Education   = Education.SecondEducation;
            stud1._NamberGrup  = 402;
            Examp Ex1 = new Examp("Matan", 3, new DateTime(2017, 12, 11));
            Examp Ex2 = new Examp("Programing", 5, new DateTime(2017, 12, 24));
            Test  Ts1 = new Test("DiscritLogic", true);
            Test  Ts2 = new Test("MatLogic", true);
            Test  Ts3 = new Test("Algebra", false);

            stud1._InformatoinExamp.Add(Ex1);
            stud1._InformatoinExamp.Add(Ex2);

            stud1._InformationTest.Add(Ts1);
            stud1._InformationTest.Add(Ts2);
            stud1._InformationTest.Add(Ts3);

            stud_ob1.AddStudent(stud1);

            stud_ob1.AddDefault(10);

            stud_ob1.Remove(1);
            stud_ob1.Remove(3);

            stud_ob1[1] = stud1;


            stud1 = new Student();
            stud1._DateStudent = new Person("CCCC", "uuu", new DateTime(1997, 5, 21));
            stud1._Education   = Education.SecondEducation;
            stud1._NamberGrup  = 402;
            Ex1 = new Examp("Matan", 3, new DateTime(2017, 12, 11));
            Ex2 = new Examp("Programing", 5, new DateTime(2017, 12, 24));
            Ts1 = new Test("DiscritLogic", true);
            Ts2 = new Test("MatLogic", true);
            Ts3 = new Test("Algebra", false);

            stud1._InformatoinExamp.Add(Ex1);
            stud1._InformatoinExamp.Add(Ex2);

            stud1._InformationTest.Add(Ts1);
            stud1._InformationTest.Add(Ts2);
            stud1._InformationTest.Add(Ts3);

            stud_ob2.AddStudent(stud1);

            stud_ob2.AddDefault(7);

            stud_ob2.Remove(2);
            stud_ob2.Remove(5);

            stud_ob2[2] = stud1;

            Console.WriteLine("----------------------------------1");
            Console.WriteLine(ob1.ToString());
            Console.WriteLine("----------------------------------2");
            Console.WriteLine(ob2.ToString());


            Console.ReadLine();
        }