コード例 #1
0
ファイル: Program.cs プロジェクト: hihilla/csharp3
        private static void fillElectricity(GarageLogic.Garage i_Garage)
        {
            Console.WriteLine("Please enter the vehicle licence number");
            string licenceNumber = Console.ReadLine();

            Console.WriteLine("Please enter amount of energy to fill in minutes");
            float amountToFill;
            bool  isElectric = true;

            while (!float.TryParse(Console.ReadLine(), out amountToFill))
            {
                Console.WriteLine("Invalid amount. please insert valid amount.");
            }

            try
            {
                i_Garage.FillEnergyInVehicle(licenceNumber, amountToFill, isElectric);
            }
            catch (Exception ex)
            {
                catchExceptionAndContinue(i_Garage, ex);
            }
        }