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); }
internal void CheckVehicleStatus() { string licensePlateNumber = GetLicensePlateNumber(); try { eStatusInGarage vehicleState = this.m_MyGarage.GetStatusByLicensePlateNumber(licensePlateNumber); ChatBot.PrintStatus(vehicleState, licensePlateNumber); } catch (VehicleNotInGarageException e) { ChatBot.PrintLicensePlateNotFoundMessage(licensePlateNumber); } }
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; } }
internal static void PrintStatus(eStatusInGarage vehicleState, string licensePlateNumber) { Console.WriteLine(string.Format("The status of car number {0} is {1} ", licensePlateNumber, vehicleState)); }