Exemple #1
0
 public void removeCarFromParking()
 {
     Console.WriteLine("Enter the Id of the car you want to remove from parking:");
     foreach (var car in parking.getAllCars())
     {
         Console.WriteLine(car.Id);
     }
     try
     {
         int id          = Convert.ToInt32(Console.ReadLine());
         Car carToRemove = parking.getAllCars().Find(x => x.Id == id);
         if (carToRemove != null)
         {
             if (carToRemove.Balance <= 0)
             {
                 addFundsMessage(carToRemove);
             }
         }
         else
         {
             throw new Exception();
         }
     }catch (Exception)
     {
         Console.WriteLine("The car was not found");
     }
 }