Exemplo n.º 1
0
        public static void Display(ref List <Course> courses, int dashes, string topMessage, int selection)
        {
            string input;

            DisplayTop(topMessage, dashes);

            DisplayEvaluations(courses, selection);

            OptionMenu.DisplayCourseOptions(dashes);

            HelperMethods.PromptUser("Enter a command: ");
            input = HelperMethods.GetUserSelection();

            ParseMethods.ParseCourseInput(input, ref courses, dashes, topMessage, selection);
        }
Exemplo n.º 2
0
        public static void ParseUserInput(char c, int selection, string input, ref List <Course> courses, string topMessage, int dashes)
        {
            GetCourseSelection(ref c, ref selection, input);

            if (Char.IsDigit(c) && selection >= 0)
            {
                if (selection < 0 || selection >= courses.Count)
                {
                    Error.PrintMessage("Incorrect input, try again..");
                    HelperMethods.PromptUser("Enter a command: ");
                    input = HelperMethods.GetUserSelection();
                    ParseUserInput(c, selection, input, ref courses, topMessage, dashes);
                }
                Console.Clear();
                topMessage = courses[selection].Code;
                CourseMenu.Display(ref courses, dashes, topMessage, selection);
            }
            else
            {
                ParseMethods.ParseMainInput(input, ref courses, dashes, topMessage);
            }
        }