예제 #1
0
        private static void RentalManagerTest()
        {
            RentalManager rentalManager  = new RentalManager(new EfRentalDal());
            var           result         = rentalManager.GetRentalByCarId(1);
            bool          isAvailableCar = rentalManager.CarIsAvailable(result.Data);

            if (isAvailableCar)
            {
                rentalManager.Add(new Rental
                {
                    CarId      = 1,
                    CustomerId = 1,
                    RentDate   = DateTime.Now,
                    ReturnDate = (DateTime)System.Data.SqlTypes.SqlDateTime.Null
                });
            }
            else
            {
                Console.WriteLine(result.Data.CarId + " Car is not Available ");
            }
        }