Beispiel #1
0
        public string GetVehicleDetails(string i_LicenseNumber)
        {
            VehicleInGarage DemandVehicle = IsExistsInGarage(i_LicenseNumber);

            if (DemandVehicle == null)
            {
                throw new MissingVehicleException(i_LicenseNumber);
            }

            return(DemandVehicle.ToString());
        }
        public override string ToString()
        {
            StringBuilder clientCardStr = new StringBuilder();

            clientCardStr.AppendLine(VehicleInGarage.ToString());
            clientCardStr.AppendLine(string.Format("Owner name: {0}", Owner));
            clientCardStr.AppendLine(string.Format("Owner phone number: {0}", OwnerPhoneNumber));
            clientCardStr.AppendLine(string.Format("Status: {0}", Status.ToString()));

            return(clientCardStr.ToString());
        }
 public string ShowVehicleDetails(string i_LicenseNumber)
 {
     if (CheckIfLicenseNumberInGarage(i_LicenseNumber))
     {
         m_CurrentVehicleInGarage = m_VehiclesInGarage[i_LicenseNumber];
         return(m_CurrentVehicleInGarage.ToString());
     }
     else
     {
         throw new ArgumentException("The License number not found in the garage.");
     }
 }
Beispiel #4
0
        public string GetVehicleDetails()
        {
            string details = null;

            if (m_CurrentVehicleInGarage != null)
            {
                details = m_CurrentVehicleInGarage.ToString();
            }
            else
            {
                throw new ArgumentException("No vehicle was set!");
            }

            return(details);
        }