예제 #1
0
 public VehicleDetailsProvider(Garage i_Garage)
 {
     this.m_Garage = i_Garage;
     Console.Clear();
     Console.WriteLine("You have chosen to get a vehicle details");
     Console.WriteLine("Please enter the license number of the vehicle to show its details");
     this.m_LicenseNumber = ValidateUserInput.GetLicensePlateFromUser();
     Console.Clear();
     getVehicleDetails();
 }
예제 #2
0
        public void InflateTires()
        {
            m_UserDisplay.ClearAndDisplayMessage("You have chosen to Inflate a vehicle tires to maximum");
            m_UserDisplay.DisplayMessage("Please enter the license number of the vehicle you want to inflate air to");
            string licensePlate = ValidateUserInput.GetLicensePlateFromUser();

            try
            {
                m_Garage.FillAirToMaximum(licensePlate);
                m_UserDisplay.ClearAndDisplayMessage(string.Format("{0} Wheels pumped to Maximum!", licensePlate));
            }
            catch (Exception exception)
            {
                m_UserDisplay.ClearAndDisplayMessage(exception.Message);
            }
            finally
            {
                m_UserDisplay.PressAnyKeyToContinue();
            }
        }
예제 #3
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();
            }
        }
예제 #4
0
        public InflateTires(UserInterface i_UserInterface)
        {
            m_UserInterface = i_UserInterface;
            Console.Clear();
            Console.WriteLine("You have chosen to Inflate a vehicle tires to maximum");
            Console.WriteLine("Please enter the license number of the vehicle you want to inflate air to");
            string licensePlate = ValidateUserInput.GetLicensePlateFromUser();

            try
            {
                m_UserInterface.Garage.FillAirToMaximum(licensePlate);
                Console.Clear();
                Console.WriteLine(String.Format("{0} Wheels pumped to Maximum!", licensePlate));
                Messages.PressAnyKeyToContinue();
            }
            catch (Exception exepetion)
            {
                Console.Clear();
                Console.WriteLine(exepetion.Message);
                Messages.PressAnyKeyToContinue();
            }
        }
예제 #5
0
 public string GetLicenseNumberForChangingStatus()
 {
     m_UserDisplay.DisplayMessage("Please enter the license number of the vehicle whose status you would like to change");
     return(ValidateUserInput.GetLicensePlateFromUser());
 }
예제 #6
0
 private string getLicensePlateNumber()
 {
     m_UserDisplay.ClearAndDisplayMessage("Please enter the license number of the vehicle you want to add");
     return(ValidateUserInput.GetLicensePlateFromUser());
 }