Beispiel #1
0
        // Displays the application menu and prompts the user for selection.
        internal static int Prompt()
        {
            Console.WriteLine("--------------------------------------------------");
            Console.WriteLine("            Select One of the Following           ");
            Console.WriteLine("--------------------------------------------------");

            Display();
            int option = 0;

            option = UserScreen.Prompt("Please select an option (1-" + (_options.Length.ToString()) + "): ",
                                       (int)1, (int)4);

            return(option);
        }
        // Case 2: Prompts user for Week, Day, and Routine and edits routine.


        static void EditSelection()
        {
            Console.Clear();
            Console.WriteLine("-----------------------------------");
            Console.WriteLine("            Edit Workout           ");
            Console.WriteLine("-----------------------------------");

            bool done = false;

            do
            {
                int    weekSelection    = UserScreen.Prompt("Which week do you want to edit? ", 1, 12);
                int    daySelection     = UserScreen.Prompt("Which day do you want to edit? ", 1, 7);
                string workoutSelection = UserScreen.Prompt("What workout will you do? ");
                //+"" is the same as converting an INT to a STRING
                _editedTrainingRoutine.Add(new TrainingRoutine {
                    Week = weekSelection + "", Day = daySelection + "", Workout = workoutSelection
                });
                done = UserScreen.Continue("Edit another routine? Press y/n ");
            } while(!done);

            Console.Clear();
        }