internal static void ShowFuelGasVehicleMenu(GarageLogic i_MyGarage)
        {
            Console.Clear();
            Console.WriteLine("Please enter vehicle license plate");

            string licensePlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(licensePlateNumber))
            {
                Vehicle userCar = i_MyGarage.GetVehicleByLicensePlate(licensePlateNumber);
                if (userCar.Engine is GasEngine == false)
                {
                    Console.Clear();
                    Console.WriteLine("This vehicle is not Gasoline vehicle ");
                }
                else
                {
                    GasEngine userEngine      = (GasEngine)userCar.Engine;
                    float     validFuelAmount = getValidFuelAmountOfValidFuelType(userEngine);
                    userEngine.FillUpGas(validFuelAmount, userEngine.GasType);
                    Console.WriteLine("Fueling...");
                    Thread.Sleep(2000);
                    Console.Clear();
                }
            }
            else
            {
                Console.Clear();
                Console.WriteLine("This vehicle is not found in our garage ");
            }
        }
Esempio n. 2
0
        internal static void ShowChargeElectricVehicleMenu(GarageLogic i_MyGarage)
        {
            Console.Clear();
            Console.WriteLine("Please enter vehicle license plate");

            string licensePlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(licensePlateNumber))
            {
                Vehicle userCar = i_MyGarage.GetVehicleByLicensePlate(licensePlateNumber);
                if (userCar.Engine is ElectricEngine == false)
                {
                    Console.Clear();
                    Console.WriteLine("This vehicle is not and electric vehicle ");
                }
                else
                {
                    ElectricEngine userEngine           = (ElectricEngine)userCar.Engine;
                    float          validMinutesToCharge = getValidMinutesToCharge(userEngine);
                    userEngine.ChargeBattery(validMinutesToCharge);
                    Console.WriteLine("Charging...");
                    Thread.Sleep(2000);
                    Console.Clear();
                }
            }

            else
            {
                Console.Clear();
                Console.WriteLine("This vehicle is not found in our garage ");
            }

            Thread.Sleep(2000);
        }
Esempio n. 3
0
        internal static void ShowInsertVehicleToGarageMenu(GarageLogic i_MyGarage)
        {
            Console.Clear();
            Console.WriteLine("Please enter vehicle license plate");
            string licensePlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(licensePlateNumber))
            {
                Console.Clear();
                Console.WriteLine("The vehicle is already exists");
                i_MyGarage.SetStatusInVehicle(licensePlateNumber, Record.eVehicleStatus.inRepair);
            }
            else
            {
                Console.WriteLine("Please insert your name:");
                string ownerName = Console.ReadLine();
                Console.WriteLine("Please insert your phone number:");
                string ownerPhoneNumber = Console.ReadLine();
                Console.Clear();
                insertNewVehicleToGarage(licensePlateNumber, i_MyGarage, ownerName, ownerPhoneNumber);
                Console.WriteLine("The vehicle was successfully added to the garage.");
            }

            Thread.Sleep(3000);
        }
Esempio n. 4
0
        public static void ShowChangeVehiclesStatusMenu(GarageLogic i_MyGarage)
        {
            Console.WriteLine("Please insert the plate number of the vehicle");
            string ownerPlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(ownerPlateNumber) == false)
            {
                Console.WriteLine("The vehicle isn't in the garage.");
            }
            else
            {
                getUserInputStatusAndChangeIt(i_MyGarage, ownerPlateNumber);
            }
        }
Esempio n. 5
0
        internal static void ShowInflateVehicleTiresMenu(GarageLogic i_MyGarage)
        {
            Console.Clear();
            Console.WriteLine("Please enter vehicle license plate");
            string licensePlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(licensePlateNumber))
            {
                Console.Clear();
                Console.Write("How much air would you like to add ?");
                Vehicle userCar          = i_MyGarage.GetVehicleByLicensePlate(licensePlateNumber);
                float   validAirPressure = getValidAirPressure(userCar);
                userCar.InflateAllTires(validAirPressure);
            }
            else
            {
                Thread.Sleep(3000);
                Console.WriteLine("License plate doesn't exist in our system");
            }
        }
        internal static void ShowShowVehicleDetailsMenu(GarageLogic i_MyGarage)
        {
            Console.Clear();
            Console.WriteLine("Please enter vehicle license plate");

            string licensePlateNumber = Console.ReadLine();

            if (i_MyGarage.CheckIfVehicleIsExists(licensePlateNumber))
            {
                Record vehicleRecord = i_MyGarage.GetRecordByLicensePlate(licensePlateNumber);
                Console.WriteLine(vehicleRecord.ToString());
            }
            else
            {
                Console.Clear();
                Console.WriteLine("This vehicle is not found in our garage ");
            }

            Console.Write("Press ENTER to continue");
            Console.ReadLine();
        }