Пример #1
0
        private void refuelVehicle()
        {
            string licenseNumber = r_UI.GetLicenseNumber();

            Fuel.eFuelType fuelType  = r_UI.GetFuelType(Fuel.GetFuelTypeOptions());
            float          fuelToAdd = r_UI.GetEnergyToAdd(k_Fuel);

            try
            {
                r_Garage.RefuelVehicleByLicense(licenseNumber, fuelType, fuelToAdd);
                r_UI.PrintMessage("The refuel succeeded");
            }
            catch (ValueOutOfRangeException ex)
            {
                r_UI.PrintRangeMsgError(ex);
            }
            catch (Exception ex)
            {
                r_UI.PrintMessage(ex.Message);
            }
        }