Esempio n. 1
0
        private static void LoginMenu()
        {
            Console.Clear();

            string name     = GetInputFromUser("Name: ");
            string password = GetInputFromUser("Password: ");

            if (!(BadUiMethods.CheckUsernameAndPassword(name, password)))
            {
                throw new UsernameOrPasswordIncorrect();
            }

            BadUiMethods.StartExamOfUser(name, password);
        }
Esempio n. 2
0
        private static void AdminMenu()
        {
            Admin admin = new Admin();

            Console.Clear();
            string input = GetInputFromUser("Password of Admin : "); // admin

            if (input != "admin")
            {
                return;
            }

            while (true)
            {
                Console.Clear();

                Console.WriteLine("Welcome Admin");

                Console.WriteLine("1) Select Users.");
                Console.WriteLine("2) Start Exam.");
                Console.WriteLine("3) Exit");
                string selection = GetInputFromUser("Input : ");

                switch (selection)
                {
                case "1":
                    BadUiMethods.SelectUsers(admin);
                    break;

                case "2":
                    BadUiMethods.StartExam(admin);
                    break;

                case "3":
                    return;

                default:
                    throw new InvalidInputException("Please provide correct input!");
                }
            }
        }