public static bool ChangeStatusOfVehicleIfExists(string i_LiecenceID, eVeichileStatus i_VehicleStatus) { bool isExist = false; if (IsLicenceIDExistInGarage(i_LiecenceID)) { isExist = true; if (GetIndexOfByLiecenceID(i_LiecenceID) != -1) { Customers.ElementAt(GetIndexOfByLiecenceID(i_LiecenceID)).Status = i_VehicleStatus; } } return(isExist); }
public static string GetAllfileredLiecenceByVehicleStatus(eVeichileStatus i_VehicleStatus) { StringBuilder sb = new StringBuilder(); if (Vehicles != null) { foreach (Customer customer in Customers) { if (customer.Status == i_VehicleStatus) { sb.AppendLine(customer.LicenceIDOfCar); } } if (string.IsNullOrEmpty(sb.ToString())) { sb.AppendLine("There Are No Vehicles With That Status"); } } return(sb.ToString()); }