示例#1
0
        protected internal static void InputToAssignmentList()
        {
            CommandPromptUtils cpUtils = new CommandPromptUtils();

            Console.Write("Please write number of assignments to input: ");
            string input            = Console.ReadLine();
            int    assignmentInputs = 0;

            if (int.TryParse(input, out assignmentInputs))
            {
                for (int i = 1; i <= assignmentInputs; i++)
                {
                    assignments.Add(cpUtils.GetAssignmentDetails());
                }
            }
            else
            {
                InputToAssignmentList();
            }
        }
示例#2
0
        protected internal static void InputToTrainersList()
        {
            CommandPromptUtils cpUtils = new CommandPromptUtils();

            Console.Write("Please write number of trainers to input: ");
            string input         = Console.ReadLine();
            int    trainerInputs = 0;

            if (int.TryParse(input, out trainerInputs))
            {
                for (int i = 1; i <= trainerInputs; i++)
                {
                    trainers.Add(cpUtils.GetTrainerDetails());
                }
            }
            else
            {
                InputToTrainersList();
            }
        }
示例#3
0
        protected internal static void InputToCourseList()
        {
            CommandPromptUtils cpUtils = new CommandPromptUtils();

            Console.Write("Please write number of courses to input: ");
            string input        = Console.ReadLine();
            int    courseInputs = 0;

            if (int.TryParse(input, out courseInputs))
            {
                for (int i = 1; i <= courseInputs; i++)
                {
                    courses.Add(cpUtils.GetCourseDetails());
                }
            }
            else
            {
                InputToCourseList();
            }
        }
示例#4
0
        protected internal static void PrintInputListsMenu()
        {
            Console.WriteLine("Choose Action: ");
            Console.WriteLine("1) Print list Students.");
            Console.WriteLine("2) Print list of Course.");
            Console.WriteLine("3) Print list of Trainer.");
            Console.WriteLine("4) Print list of Assignments.");
            Console.WriteLine("5) Back to Main Menu.");


            ConsoleKeyInfo menuSelection;

            menuSelection = Console.ReadKey(true);

            switch (menuSelection.KeyChar)
            {
            case '1':
                Console.Clear();
                Console.WriteLine("Printing the list of Students.");
                CommandPromptUtils.PrintStudentsList(List.students);
                Console.ReadKey();
                Console.Clear();
                PrintInputListsMenu();
                break;

            case '2':
                Console.Clear();
                Console.WriteLine("Printing the list of Course.");
                CommandPromptUtils.PrintCoursesList(List.courses);
                Console.ReadKey();
                Console.Clear();
                PrintInputListsMenu();
                break;

            case '3':
                Console.Clear();
                Console.WriteLine("Printing the list of Trainer.");
                CommandPromptUtils.PrintTrainersList(List.trainers);
                Console.ReadKey();
                Console.Clear();
                PrintInputListsMenu();
                break;

            case '4':
                Console.Clear();
                Console.WriteLine("Printing the list of Assignments.");
                CommandPromptUtils.PrintAssignmentsList(List.assignments);
                Console.ReadKey();
                Console.Clear();
                PrintInputListsMenu();
                break;

            case '5':
                Console.Clear();
                Console.WriteLine("Back to Main Menu. ");
                Menu();
                Console.ReadKey();
                Console.Clear();
                break;
            }
        }