Пример #1
0
        public void ChangeVehicleStatus(string i_LicensePlateNumber, eStatusInGarage i_DesiredVehicleStatus)
        {
            Vehicle vehicleToChange = SearchVehicle(i_LicensePlateNumber);

            if (vehicleToChange == null)
            {
                throw new VehicleNotInGarageException();
            }
            RemoveVehicleFromCurStatusList(vehicleToChange);
            AddVehicleToStatusList(vehicleToChange, i_DesiredVehicleStatus);
        }
Пример #2
0
        internal void CheckVehicleStatus()
        {
            string licensePlateNumber = GetLicensePlateNumber();

            try
            {
                eStatusInGarage vehicleState = this.m_MyGarage.GetStatusByLicensePlateNumber(licensePlateNumber);
                ChatBot.PrintStatus(vehicleState, licensePlateNumber);
            }
            catch (VehicleNotInGarageException e)
            {
                ChatBot.PrintLicensePlateNotFoundMessage(licensePlateNumber);
            }
        }
Пример #3
0
        private void AddVehicleToStatusList(Vehicle i_VehicleToAdd, eStatusInGarage newVehicleStatus)
        {
            switch (newVehicleStatus)
            {
            case eStatusInGarage.Treatment:
                this.m_TreatmentVehiclesInGarage.Add(i_VehicleToAdd.LicensePlateNumber, i_VehicleToAdd);
                break;

            case eStatusInGarage.Fixed:
                this.m_FixedVehiclesInGarage.Add(i_VehicleToAdd.LicensePlateNumber, i_VehicleToAdd);
                break;

            case eStatusInGarage.Payed:
                this.m_PayedVehiclesInGarage.Add(i_VehicleToAdd.LicensePlateNumber, i_VehicleToAdd);
                break;
            }
        }
Пример #4
0
 internal static void PrintStatus(eStatusInGarage vehicleState, string licensePlateNumber)
 {
     Console.WriteLine(string.Format("The status of car number {0} is {1} ", licensePlateNumber, vehicleState));
 }