Exemple #1
0
        public string DisplayVehiclelicensePlateNumbers(bool i_DispalyAlllicensePlateNumbers, ClientsOfGarage.eStatuesOfVehicle i_StatuesOfVehicle)
        {
            StringBuilder displayLicensePlateNumbers = new StringBuilder();

            if ((int)i_StatuesOfVehicle < 1 || (int)i_StatuesOfVehicle > 4)
            {
                throw new ArgumentException();
            }

            foreach (KeyValuePair <string, Vehicle> vehicle in r_Vehicles)
            {
                if (i_DispalyAlllicensePlateNumbers == true)
                {
                    displayLicensePlateNumbers.Append(string.Format("{0}{1}", vehicle.Key, Environment.NewLine));
                }
                else if (vehicle.Value.ClientsOfGarage.VehicleStatus == i_StatuesOfVehicle)
                {
                    displayLicensePlateNumbers.Append(string.Format("{0}{1}", vehicle.Key, Environment.NewLine));
                }
            }

            if (displayLicensePlateNumbers.Length == 0)
            {
                if (i_DispalyAlllicensePlateNumbers == true)
                {
                    displayLicensePlateNumbers.Append("There are no vehicles in the garage.");
                }
                else
                {
                    displayLicensePlateNumbers.Append("There are no vehicles in the garage that you selected.");
                }
            }

            return(displayLicensePlateNumbers.ToString());
        }
Exemple #2
0
 public void ChangeStatusOfVehicle(string i_LicensePlateNumber, ClientsOfGarage.eStatuesOfVehicle i_NewVehicleStatus)
 {
     r_Vehicles[i_LicensePlateNumber].ClientsOfGarage.VehicleStatus = i_NewVehicleStatus;
 }