Exemple #1
0
        public ChargingVehicleDetails FillChargingVehicleForm(GarageManagment io_Garage)
        {
            string licenseNumber;
            float  quantityToAdd;

            EnergySource.eTypeOfEnergySource typeOfEnergyChoice = new EnergySource.eTypeOfEnergySource();
            Fuel.eFuelType?typeOfFuelChoice = new Fuel.eFuelType();
            bool           v_VehicleFound;

            printSign("filling Charging Form");

            do
            {
                v_VehicleFound = GetVehicleLicenseNumberCheckForExisiting(io_Garage, out licenseNumber);
                if (v_VehicleFound == false)
                {
                    Console.WriteLine("Vehicle Wasn't Found Try Again");
                }
            }while (v_VehicleFound == false);
            quantityToAdd      = getFloatWithoutAnyCondition("Quantity To Add");
            typeOfEnergyChoice = (EnergySource.eTypeOfEnergySource)PrintAllEnumValuesGetUserChoice(typeOfEnergyChoice, "Fuel Type Choosing");

            if (typeOfEnergyChoice == EnergySource.eTypeOfEnergySource.Fuel)
            {
                typeOfFuelChoice = (Fuel.eFuelType)PrintAllEnumValuesGetUserChoice(typeOfFuelChoice.Value, "Fuel Type Choosing");
            }
            else
            {
                typeOfFuelChoice = null;
            }

            return(new ChargingVehicleDetails(licenseNumber, quantityToAdd, typeOfEnergyChoice, typeOfFuelChoice));
        }
Exemple #2
0
        public bool GetVehicleLicenseNumberCheckForExisiting(GarageManagment i_Garage, out string io_licenseNumber)
        {
            bool v_FoundVehicle = false;

            io_licenseNumber = GetStringWIthoutConditionFromUser("license Number");

            try
            {
                i_Garage.IsVehicleExists(io_licenseNumber);
            }
            catch (ArgumentException ae)
            {
                v_FoundVehicle = true;
                Console.WriteLine(ae.Message);
            }

            return(v_FoundVehicle);
        }