public static void TrainerMenu(List <Person> members, List <Admin> admins, List <Trainer> trainers, List <Student> students)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"\nWould you like to:\n");
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("[1] See all students of the Academy\n" +
                              "[2] See all subjects of the Academy\n" +
                              "[3] See all subjects of a particular student\n" +
                              "[4] Go back to login menu\n" +
                              "[5] Exit AcademyApp");

            Console.ForegroundColor = ConsoleColor.White;

            int chosenOption = int.Parse(Console.ReadLine());

            switch (chosenOption)
            {
            case 1:

                DisplayAllStudents(students);
                TrainerMenu(members, admins, trainers, students);
                break;

            case 2:
                SubjectsInfo(students);
                TrainerMenu(members, admins, trainers, students);

                break;

            case 3:
                DisplayChosenStudentInfo(students);
                TrainerMenu(members, admins, trainers, students);

                break;

            case 4:
                LoginMenu.MainMenuLogin(members, admins, trainers, students);
                break;

            case 5:
                Console.Clear();
                Console.WriteLine($"\nUntil next time trainer! Thank you for using AcademyApp.");
                LoginMenu.PressAnyKey();
                LoginMenu.MainMenuLogin(members, admins, trainers, students);

                break;

            default:
                Console.Clear();
                Console.WriteLine($"\nNo such option. Please try again.");
                LoginMenu.PressAnyKey();
                TrainerMenu(members, admins, trainers, students);
                break;
            }
        }
Ejemplo n.º 2
0
        public static void AdminMenu(List <Person> members, List <Admin> admins, List <Trainer> trainers, List <Student> students, Person loggedInAdmin)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine($"\nWould you like to:\n");
            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("[1] Add an Academy member\n" +
                              "[2] Remove an Academy member\n" +
                              "[3] Go back to login menu\n" +
                              "[4] Exit AcademyApp");

            Console.ForegroundColor = ConsoleColor.White;

            int chosenOption = int.Parse(Console.ReadLine());

            switch (chosenOption)
            {
            case 1:
                AddAMember(members, admins, trainers, students, (Admin)loggedInAdmin);
                AdminMenu(members, admins, trainers, students, loggedInAdmin);
                break;

            case 2:
                RemoveAMember(members, admins, trainers, students, (Admin)loggedInAdmin);
                AdminMenu(members, admins, trainers, students, loggedInAdmin);
                break;

            case 3:
                LoginMenu.MainMenuLogin(members, admins, trainers, students);
                break;

            case 4:
                Console.Clear();
                Console.WriteLine($"\nUntil next time admin!");
                LoginMenu.PressAnyKey();
                LoginMenu.MainMenuLogin(members, admins, trainers, students);
                break;

            default:
                Console.Clear();
                Console.WriteLine($"\nNo such option. Please try again.");
                LoginMenu.PressAnyKey();
                AdminMenu(members, admins, trainers, students, loggedInAdmin);
                break;
            }
        }