Exemplo n.º 1
0
 private void getVehicleDetails()
 {
     try
     {
         m_Garage.IsVehicleInGarageException(m_LicenseNumber);
         Vehicle vehicle = m_Garage.GetVehicleByLicenseNumber(m_LicenseNumber);
         Console.WriteLine(vehicle.ToString());
         Messages.PressAnyKeyToContinue();
     }
     catch (ArgumentException exception)
     {
         Console.Clear();
         Console.WriteLine(exception.Message);
         Messages.PressAnyKeyToContinue();
     }
 }
Exemplo n.º 2
0
        public void printVehicleDetails()
        {
            m_UserDisplay.ClearAndDisplayMessage("You have chosen to get a vehicle details");
            m_UserDisplay.DisplayMessage("Please enter the license number of the vehicle to show its details");

            try
            {
                string licenseNumber = ValidateUserInput.GetLicensePlateFromUser();
                m_Garage.IsVehicleInGarageException(licenseNumber);
                m_UserDisplay.Clear();
                m_UserDisplay.DisplayMessage(m_Garage.GetVehicleByLicenseNumber(licenseNumber).ToString());
            }
            catch (ArgumentException exception)
            {
                m_UserDisplay.displayExceptionMessage(exception);
            }
            finally
            {
                m_UserDisplay.PressAnyKeyToContinue();
            }
        }