示例#1
0
        public static void Main()
        {
            VehicleInitialDetails setup = CreateNewSetup();

            GarageManager gm     = new GarageManager();
            bool          exists = gm.CheckIfVehicleExists("12221C");

            gm.AddNewVehicle(setup);
            exists = gm.CheckIfVehicleExists("12221C");
            gm.ChangeVehicleRepairState("12221C", eRepairState.Fixed);
            gm.FillTyrePressure("12221C");
            gm.RefuelVehicle("12221C", Fuel.eFuelType.Octan98, 30f);
        }
示例#2
0
 public void InsertNewVehicleIntoTheGarage()
 {
     try
     {
         string LicenseID = null;
         int    attempts = 0, vehicleChoice = -1, engineChoice = -1;
         m_ConsoleUtils.PrintCarSelectionAndGetInput(ref vehicleChoice, ref engineChoice, attempts);
         m_ConsoleUtils.PrintInsertLicseneIDQuestion(ref LicenseID, attempts);
         if (m_GarageManager.CheckIfVehicleExists(vehicleChoice, engineChoice, LicenseID))
         {
             m_ConsoleUtils.PrintStatusUpdated();
         }
         else
         {
             GetRequiredDetailsForNewVehicle((eVehicleType)vehicleChoice, (eEngineType)engineChoice, LicenseID);
         }
     }
     catch (ValueOutOfRangeException ex)
     {
         m_ConsoleUtils.PrintExceptionError(ex.Message);
     }
     catch (ArgumentException)
     {
         m_ConsoleUtils.PrintSomethingWentWrong();
     }
     catch (FormatException)
     {
         m_ConsoleUtils.PrintMessgeNotExistInMenu();
     }
 }