private void changeVehicleStatusInGarage() { Console.Clear(); string licensePlate = licensePlateInput(); VehicleInGarage.eStatus newStatus = printMenuFormatAndReturnUserChoice <VehicleInGarage.eStatus>("Choose new status:"); m_GarageModel.ChangeVehicleStatus(licensePlate, newStatus); Console.WriteLine("Vehicle status changed successfully."); System.Threading.Thread.Sleep(2500); }
public bool ChangeVehicleStatus(string i_LicenseNumber, VehicleInGarage.eStatus i_Status) { bool returnValue = false; if (getVehicleInGarage(i_LicenseNumber, out VehicleInGarage currentVehicleInGarage)) { currentVehicleInGarage.Status = i_Status; returnValue = true; } return(returnValue); }
public List <string> GetListOfVehiclesInGarage(VehicleInGarage.eStatus i_Status) { List <string> list = new List <string>(); foreach (KeyValuePair <string, VehicleInGarage> v in this.r_VehiclesInGarages) { if (v.Value.Status == i_Status) { list.Add(v.Key); } } return(list); }
public List <string> ListOfVehicleLicensePlatesInGarageByStatus(VehicleInGarage.eStatus i_Status) { List <string> LicensePlateList = new List <string>(); foreach (KeyValuePair <int, VehicleInGarage> vehicleToCheck in m_VehicelsList) { if (vehicleToCheck.Value.Status == i_Status) { LicensePlateList.Add(vehicleToCheck.Value.Vehicle.LicensePlate); } } return(LicensePlateList); }
private void vehicleStatusMenuList() { Console.Clear(); VehicleInGarage.eStatus vehicleStatusToShow = printMenuFormatAndReturnUserChoice <VehicleInGarage.eStatus>("Choose status:"); List <string> vehicleListByStatus = m_GarageModel.ListOfVehicleLicensePlatesInGarageByStatus(vehicleStatusToShow); // print the list: if (vehicleListByStatus.Count != 0) { Console.WriteLine(string.Format("{0} vehicles license plates:", Enum.GetName(typeof(VehicleInGarage.eStatus), vehicleStatusToShow))); vehicleListByStatus.ForEach(Console.WriteLine); } else { Console.WriteLine("There are no vehicles with this status at the garage."); } endOfActionMessage(); }
public void ChangeVehicleStatus(string i_LicensePlate, VehicleInGarage.eStatus i_NewStatus) { VehicleInGarage vehicleInGarageToUpdate = FindAndReturnVehicleInGarage(i_LicensePlate); vehicleInGarageToUpdate.Status = i_NewStatus; }