private static void presentTheNumbersofVehiclesInGarageByStatus(Ex03.GarageLogic.GarageManager i_GarageManager) { string stringStatusFilterType = getEnumStringFromEnumValues(typeof(Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus)); Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus vehicleStatusFilterType = (Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus)System.Enum.Parse(typeof(Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus), stringStatusFilterType); List <string> arrayOfVehiclesNumbersByFilter = i_GarageManager.GenerateVehiclesNumbersListByFilterType(vehicleStatusFilterType); auxPresentTheNumbersOfTheVehiclesinVehicleList(arrayOfVehiclesNumbersByFilter, vehicleStatusFilterType); }
public List <string> GenerateVehiclesNumbersListByFilterType(Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus i_FilterType) { List <string> vehiclesNumbersListByFilter = new List <string>(); foreach (KeyValuePair <string, VehicleInTreatmentDetails> currentVehicleInTreatment in m_VehiclesInGarageByNumber) { if (currentVehicleInTreatment.Value.VehicleInTreatmentStatus == i_FilterType) { vehiclesNumbersListByFilter.Add(currentVehicleInTreatment.Key); } } return(vehiclesNumbersListByFilter); }
private static void auxPresentTheNumbersOfTheVehiclesinVehicleList(List <string> i_VehiclesNumbersListByFilter, Ex03.GarageLogic.GarageManager.eVehicleInGarageStatus i_VehicleStatusFilterType) { if (i_VehiclesNumbersListByFilter.Count == 0) { System.Console.WriteLine("There are no vehicles in this status - " + i_VehicleStatusFilterType); } else { System.Console.WriteLine("Here are all the vehicles in the status - " + i_VehicleStatusFilterType); foreach (string vehicleNumber in i_VehiclesNumbersListByFilter) { System.Console.WriteLine(vehicleNumber); } } }