Ejemplo n.º 1
0
        public static void NavigateMainMenu()
        {
            do
            {
                char input = ' ';
                try
                {
                    input = Console.ReadLine()[0];
                }
                catch (IndexOutOfRangeException)
                {
                    Console.Clear();
                    Console.WriteLine("Please enter a valid menu choice");
                }
                switch (input)
                {
                case '1':

                    Console.Clear();
                    Mainmenu.garaget.PrintAllVehicles();
                    PrintMainMenu();
                    break;

                case '2':
                    Console.Clear();
                    Mainmenu.garaget.PrintVehicleTypes();
                    PrintMainMenu();
                    break;

                case '3':
                    Console.Clear();
                    Mainmenu.ParkOrUnpark();
                    PrintMainMenu();
                    break;

                case '4':
                    Console.Clear();
                    Mainmenu.garaget.DefaultParking();
                    Console.WriteLine("10 Vehicles have been parked in the garage");
                    PrintMainMenu();
                    break;

                case '5':
                    break;

                case '6':
                    break;

                case '0':
                    Environment.Exit(0);
                    break;

                default:
                    break;
                }
            } while (true);
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     Mainmenu.SetupGarage();
     Mainmenu.PrintMainMenu();
     Mainmenu.NavigateMainMenu();
 }