Ejemplo n.º 1
0
 public List<Rent> GetRentForCar(Car car)
 {
     List<Rent> rentForCar = new List<Rent>();
     AdminForCars adminForCars = new AdminForCars();
     if ((object) car == null)
         return rentForCar;
     foreach (var rent in _rents)
     {
         if (rent.Car == car)
             rentForCar.Add(rent);
         if (car.Name == "(none)")
         {
             bool isItInvalid = true;
             foreach (var carAgain in adminForCars.Cars)
             {
                 if (rent.Car == carAgain)
                 {
                     isItInvalid = false;
                     break;
                 }
             }
             if (isItInvalid)
             {
                 rentForCar.Add(rent);
             }
         }
     }
     return rentForCar;
 }
Ejemplo n.º 2
0
 public List<Car> GetCars()
 {
     AdminForCars adminForCars = new AdminForCars();
     List<Car> cars = adminForCars.Cars;
     Car car = new Car("(none)", "");
     cars.Insert(0, car);
     return cars;
 }
Ejemplo n.º 3
0
 public AdminPanel()
 {
     InitializeComponent();
     _adminForCars = new AdminForCars();
     _adminForRent = new AdminForRent();
 }