Exemplo n.º 1
0
        private static void RentACarTest()
        {
            CarRentalManager carRentalManager = new CarRentalManager(new EfRentalDal());
            string           _tempCustomer;
            int      _carId, _customerId;
            DateTime _rentDate;
            DateTime?_returnDate;

            Console.Write("Kiralaması Yapılacak Müşteri Id: ");
            _tempCustomer = Console.ReadLine();

            if (_tempCustomer != null)
            {
                Console.Write("Kiralanacak araç Id: ");
                _carId = Convert.ToInt32(Console.ReadLine());
                Console.Write("Kiralama Tarihi [aa/gg/yyyy] : ");
                _rentDate   = Convert.ToDateTime(Console.ReadLine());
                _returnDate = null;
                _customerId = Convert.ToInt32(_tempCustomer);


                Rental rental = new Rental
                {
                    CarId      = _carId,
                    CustomerId = _customerId,
                    RentDate   = _rentDate,
                    ReturnDate = _returnDate
                };

                var result = carRentalManager.Add(rental);
                Console.WriteLine(result.Message);
            }
        }
Exemplo n.º 2
0
        private static void RentACarListTest()
        {
            CarRentalManager carRentalManager = new CarRentalManager(new EfRentalDal());

            Console.WriteLine("Id" + "---" + "Araç Id" + "---" + " Müşteri Id" + "---" + "Kiralama Tarihi" + "---" + "Teslim Tarihi");
            foreach (var car in carRentalManager.GetAll().Data)
            {
                Console.WriteLine(car.Id + "---" + car.CarId + "---" + car.CustomerId + "---" + car.RentDate + "---" + car.ReturnDate);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //CarManager carManager = new CarManager(new EfCarDal());
            //CarDetailTest();

            CarManager       carManager      = new CarManager(new EfCarDal());
            BrandManager     brandManager    = new BrandManager(new EfBrandDal());
            ColorManager     colorManager    = new ColorManager(new EfColorDal());
            UserManager      userManager     = new UserManager(new EfUserDal());
            CustomerManager  customerManager = new CustomerManager(new EfCustomerDal());
            CarRentalManager rentalManager   = new CarRentalManager(new EfCarRentalDal());

            GetAllCarDetails(carManager);
            //FirstOtomation(carManager);
        }