Ejemplo n.º 1
0
        public void AddFuelPerLicenseID()
        {
            string licenseID      = null;
            int    attempts       = 0;
            int    gasType        = 0;
            float  amountToAdd    = 0;
            bool   isVehiclefound = false;

            m_ConsoleUtils.PrintInsertLicseneIDQuestion(ref licenseID, attempts);
            try
            {
                m_ConsoleUtils.PrintHowManyLitersToFillAndGasType(ref amountToAdd, ref gasType);
                isVehiclefound = m_GarageManager.ChargeOrFuelVehicle(amountToAdd, licenseID, gasType);
                m_ConsoleUtils.PrintGasIsFilled(isVehiclefound, licenseID);
            }
            catch (ArgumentException)
            {
                m_ConsoleUtils.PrintSomethingWentWrong();
            }
            catch (ValueOutOfRangeException ex)
            {
                m_ConsoleUtils.PrintExceptionError(ex.Message);
            }
            catch (FormatException)
            {
                m_ConsoleUtils.PrintMessgeNotExistInMenu();
            }
        }