public string UpdateVehicleState(string i_LicenseNumber, string i_StringNewVehicleState) { Vehicle vehicle = SearchVehicle(i_LicenseNumber); if (vehicle != null) { vehicle.VehicleStatus = Vehicle.GetVehicleState(i_StringNewVehicleState); return("Vehicle state was updated successfully"); } else { return("Vehicle was not found"); } }
public string DisplayVehiclesLicenses(string i_VehicleState) { if (m_GarageVehicles.Count == 0) { return("There are no existing vehicles"); } else { StringBuilder vehicleLicenses = new StringBuilder(); Vehicle.eVehicleState vehicleState = Vehicle.GetVehicleState(i_VehicleState); foreach (Vehicle vehicle in m_GarageVehicles) { if (vehicle.VehicleStatus == vehicleState) { vehicleLicenses.Append(vehicle.LicenseNumber + "\n"); } } return(vehicleLicenses.ToString()); } }