Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //создаём журнал
            IJournalMarks journalMarks = new JournalMarks();

            //создаём массив студентов
            int countStudent = 3;

            IStudent[] students = new Student[countStudent];

            //создаём студентов
            students[0] = new Student("Ilya Popovich", 24, "+380699874563");
            students[1] = new Student("Vasiliy Fedorez", 22, "+380638524697");
            students[2] = new Student("Inna Levchenko", 21, "+380504789632");

            int countSubjects = 3;

            //наполняем оценками предметы
            foreach (Student iteam in students)
            {
                for (int i = 0; i < countSubjects; i++)
                {
                    InitSubject(iteam.Subjects[i]);
                    iteam.Subjects[i].MarkSubjects  = MarkInformer;
                    iteam.Subjects[i].StudentGoNext = SubjectPassedInformer;
                }

                //добавляем студентов в журнал
                journalMarks.AddStudent(iteam);
            }

            //запускаем меню
            JournalMenu.StartMenuJournal(journalMarks);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// метод запускает меню студента
        /// </summary>
        /// <param name="student"></param>
        public static void StartStudentMenu(IJournalMarks journalMarks, IStudent student)
        {
            do
            {
                Clear();

                int    number = 0;
                string data   = null;

                WriteLine("       Student menu: ");
                WriteLine((int)MenuStudent.ChoiceSubject + " - Choice subject,");
                WriteLine((int)MenuStudent.BackMenu + " - Back,");
                do
                {
                    Write("Your choice: ");
                    data = ReadLine();
                } while (!int.TryParse(data, out number));
                WriteLine("--------------------------------");

                Student newStudent = student as Student;

                switch ((MenuStudent)number)
                {
                case MenuStudent.ChoiceSubject:
                    StudentMenu.ChoiceSubject(journalMarks, student);
                    break;

                case MenuStudent.BackMenu:
                    JournalMenu.StartMenuJournal(journalMarks);
                    break;

                default:
                    WriteLine("Error iteam menu...");
                    break;
                }
                WriteLine("Done!");
                ReadKey();//пауза
                Clear();
            } while (true);
        }