Exemplo n.º 1
0
 //-----------------------------------------------------------------//
 public void ChangeVehicleState(string i_LicenseNumber, InformationOfVehicle.eVehicleStateInGarage i_NewState)
 {
     try
     {
         InformationOfVehicle vehicleInformation = this.CheckForLicensePlate(i_LicenseNumber);
         vehicleInformation.State = i_NewState;
     }
     catch (ArgumentException exception)
     {
         throw exception;
     }
 }
Exemplo n.º 2
0
        //-----------------------------------------------------------------//
        public string GetLicensePlatesByState(InformationOfVehicle.eVehicleStateInGarage i_State)
        {
            StringBuilder KeyString = new StringBuilder();
            int           index     = 0;

            foreach (KeyValuePair <string, InformationOfVehicle> currentKey in this.m_VehiclesInTheGarage)
            {
                if (i_State == InformationOfVehicle.eVehicleStateInGarage.Default || currentKey.Value.State == i_State)
                {
                    ++index;
                    KeyString.Append(index.ToString() + ". ");
                    KeyString.AppendLine(currentKey.Key);
                }
            }

            return(KeyString.ToString());
        }