Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e_FirstMenu"></param>
        /// <returns></returns>
        private static bool actionForFirstMenu(E_FirstMenu e_FirstMenu)
        {
            Console.WriteLine("=============================================");
            bool result = true;

            switch (e_FirstMenu)
            {
            case E_FirstMenu.Exit_system:
                result = false;
                break;

            case E_FirstMenu.Add_a_vehicle:
                ///calling adding a vehicle method
                addAVehicle();
                break;

            case E_FirstMenu.Show_vehicles_by_license_plate:
                ///calling showCarsByLicencePlate method
                showCarsByLicencePlate();
                break;

            case E_FirstMenu.Show_vehicles_by_license_plate_with_filter:
                ///calling showCarsByLicencePlateWithFilter method
                showCarsByLicencePlateWithFilter();
                break;

            case E_FirstMenu.Change_car_state:
                ///calling changeCarState method
                changeCarState();
                break;

            case E_FirstMenu.Add_air_to_vehicle_wheels:
                ///calling addAirToVehileWheels method
                addAirToVehileWheels();
                break;

            case E_FirstMenu.Add_energy_to_vehicle:
                ///calling addEnergyToVhicle method
                addEnergyToVhicle();
                break;

            case E_FirstMenu.Show_vehicle_full_details:
                ///calling showVehicleFullDetails method
                showVehicleFullDetails();
                break;

            case E_FirstMenu.Clear_the_screen:
                ///clear the screen
                Console.Clear();
                break;

            default:
                result = false;
                break;
            }
            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// The getFirstMenuResponse method
        /// </summary>
        /// <returns></returns>
        private static E_FirstMenu getFirstMenuResponse()
        {
            ///create a new show and Entering a value from user and repeat menu if invalid after printing a message.
            E_FirstMenu userResponse = E_FirstMenu.Exit_system;

            try
            {
                userResponse = Utils.Parsers.ParseFirstMenu("Enter menu item:");
            }
            catch (FormatException ex)
            {
                Console.WriteLine(ex.Message);
                userResponse = Utils.Parsers.ParseFirstMenu("Enter menu item:");
            }
            return(userResponse);
        }