Beispiel #1
0
 private void ArrayPrint(Studenti arrayOfStudents)
 {
     if (arrayOfStudents.isEmpty())
     {
         ArrayPreFill(arrayOfStudents);
     }
     arrayOfStudents.PrintAll();
 }
Beispiel #2
0
 private void ArrayPreFill(Studenti arrayOfStudents)
 {
     arrayOfStudents.AddStudent(new Student("Karel", 5, "FEI"));
     arrayOfStudents.AddStudent(new Student("Pepa", 6, "FES"));
     arrayOfStudents.AddStudent(new Student("tonda", 3, "FF"));
     arrayOfStudents.AddStudent(new Student("NIkdo", 2, "FCHT"));
     arrayOfStudents.AddStudent(new Student("někdo", 1, "FEI"));
 }
Beispiel #3
0
        private void ArrayReading(Studenti arrayOfStudents)
        {
            string  jmeno       = Reading.ReadString("Jméno");
            int     cislo       = Reading.ReadInt("Číslo");
            string  fakulta     = Reading.ReadString("Fakulta");
            Student tempStudent = new Student(jmeno, cislo, fakulta);

            arrayOfStudents.AddStudent(tempStudent);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Delegat  delegat         = new Delegat();
            Studenti arrayOfStudents = new Studenti();

            while (true)
            {
                int menuReturnNumber = delegat.MenuDraw();
                switch (menuReturnNumber)
                {
                case 0:
                    Environment.Exit(0);
                    break;

                case 1:
                    delegat.ArrayReading(arrayOfStudents);
                    break;

                case 2:
                    delegat.ArrayPrint(arrayOfStudents);
                    break;

                case 3:
                    delegat.ArraySort(arrayOfStudents, "byNumber");
                    break;

                case 4:
                    delegat.ArraySort(arrayOfStudents, "byName");
                    break;

                case 5:
                    delegat.ArraySort(arrayOfStudents, "byFaculty");
                    break;
                }
            }
        }
Beispiel #5
0
 private void ArraySort(Studenti arrayOfStudents, string value)
 {
     arrayOfStudents.SortAllByValue(value);
 }