示例#1
0
        private static void GetAllCarImage()
        {
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            foreach (var carImage in carImageManager.GetAll().Data)
            {
                Console.WriteLine(carImage.Id + "/" + carImage.CarId + "/" + carImage.ImagePath);
            }
        }
示例#2
0
        private static void CarImagesTest()
        {
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            foreach (var carImage in carImageManager.GetAll().Data)
            {
                Console.WriteLine(carImage.CarId);
            }
        }
示例#3
0
        private static void ViewCarImage()
        {
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            foreach (var x in carImageManager.GetImagesOfCar(new Car {
                Id = 2
            }).Data)
            {
                Console.WriteLine(x.ImagePath);
            }
        }
示例#4
0
        static void Main(string[] args)
        {
            EfCarImageDal   efCarImageDal   = new EfCarImageDal();
            CarImageManager carImageManager = new CarImageManager(efCarImageDal);

            CarImage carImage1 = new CarImage()
            {
                CarId = 1,
            };

            //carImageManager.Add(@"..\WebAPI\Images\", carImage1);
        }
示例#5
0
        static void Main(string[] args)
        {
            CarTest();
            RentalTest();
            UserTest();
            CustomerTest();
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            foreach (var carImage in carImageManager.GetAll().Data)
            {
                Console.WriteLine(carImage.CarId + " / " + carImage.CarImageId + " / " + carImage.ImagePath + " / " + carImage.Date);
            }
        }
示例#6
0
 static void Main(string[] args)
 {
     CarTest();
     Console.WriteLine("-----------------------------------");
     ColorTest();
     Console.WriteLine("-----------------------------------");
     BrandTest();
     RentalTest();
     Console.WriteLine("-----------------------------------");
     CustomerTest();
     Console.WriteLine("-----------------------------------");
     UserTest();
     Console.WriteLine("-----------------------------------");
     CustomerAdd();
     CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());
 }
示例#7
0
        static void Main(string[] args)
        {
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            carImageManager.Add(new CarImage
            {
                CarId     = 1,
                Date      = DateTime.Now,
                ImagePath = "eq321312321"
            });

            //CarManager carManager = new CarManager(new EfCarDal());

            //var result = carManager.GetCarDetails();
            //foreach (var car in result.Data)
            //{
            //    Console.WriteLine(car.CarName+"//"+car.ColorName+"//"+car.BrandName);
            //}
            //Console.WriteLine(result.Message);
        }
示例#8
0
        static void Main(string[] args)
        {
            //BrandManager brandManager = new BrandManager(new EfBrandDal());
            //var result = brandManager.GetAll();
            //foreach (var item in result.Data)
            //{
            //    Console.WriteLine(item.BrandName);
            //}


            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());
            var             result          = carImageManager.GetAll().Data;

            foreach (var item in result)
            {
                Console.WriteLine(item.CarId);
            }



            //RentalAdded();

            //RentListGetAll();


            //CustomerAdded();

            //GetCarDetails();

            //AddCarTest();

            //GetByIdTest();

            //GetAllTest();

            //DeleteTest();

            //UpdateTest();
        }
示例#9
0
        static void Main()
        {
            //Login();

            RentalManager rentalManager = new RentalManager(new EfRentalDal());

            Rental rental = new Rental {
                CarId = 6, CustomerId = 6, RentDate = DateTime.Now
            };

            rentalManager.Add(rental);
            //var result = rentalManager.Add(rental);
            //var result = rentalManager.UpdateRenturnDate(1);
            //var result = rentalManager.UpdateRenturnDate(2);
            //Console.WriteLine(result.Message);

            //var result =rentalManager.UpdateRenturnDate(1);
            //Console.WriteLine(result.Message);


            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            CarImage carImage = new CarImage {
                CarId = 3, Date = DateTime.Now, ImagePath = "Dosya Yolu"
            };



            //CarManager carManager = new CarManager(new EfCarDal());


            //var result =rentalManager.GetRentalDetailsById(1).Data;

            //foreach (var item in rentalManager.GetRentalDetailsById(1).Data)
            //{
            //	Console.WriteLine(item.FullName.PadRight(20)+item.Email.PadRight(20)+item.CompanyName.PadRight(10)+item.BrandName.PadRight(10)+item.Description+"  "+item.DailyPrice+"  "+ item.RentDate+"  "+item.ReturnDate);
            //}
        }
示例#10
0
        public static void Main(String[] args)
        {
            //ColorTest();
            //BrandTest();
            // CarTest();
            UserTest();
            //CustomerTest();

            // RentalManager rentalManager = new RentalManager(new EfRentalDal());
            //// rentalManager.Add(new Rental { CarId = 3026, CustomerId = 2, RentDate = "3/5/2021" });
            // rentalManager.Add(new Rental { CarId = 3026, CustomerId = 2, RentDate = "3/6/2021" });

            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());
            //carImageManager.Add(new CarImage
            //{
            //    CarId = 3026,
            //    ImagePath = "fsddgdfgfdgdf",
            //    ImageDate = DateTime.Now


            //}) ;
            //carImageManager.Update(FormFile file new CarImage { Id = 6, CarId = 3029 });
        }
示例#11
0
        static void Main(string[] args)
        {
            CarManager      carManager      = new CarManager(new EfCarDal());
            ColorManager    colorManager    = new ColorManager(new EfColorDal());
            BrandManager    brandManager    = new BrandManager(new EfBrandDal());
            UserManager     userManager     = new UserManager(new EfUserDal());
            CustomerManager customerManager = new CustomerManager(new EfCustomerDal());
            // RentalManager rentalManager = new RentalManager(new EfRentalDal());
            CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());

            // var result = carImageManager.Add(new CarImage{  CarId=1, CarImageDate=new DateTime(), ImagePath="default.jpeg" });
            //Console.WriteLine(result.Message);

            // TestToAdd(carManager,brandManager, colorManager);
            //TestToUpdate(carManager, brandManager, colorManager);
            //TestToDelete(carManager, brandManager, colorManager);

            //List of tables
            //ListOfCar(carManager);
            //ListOfColor(colorManager);
            //ListOfBrand(brandManager);

            //GetCarDetail(carManager);


            //TestToAddUser(userManager);
            //TestToAddCustomer(customerManager);
            //TestToUpdateCustomer(customerManager);
            // TestToDeleteRental(rentalManager);

            //kiralama testinde eğer araba returndate'i null ise araba kiralanamıyor.
            ///TestToAddRental(rentalManager);


            Console.ReadKey();
        }
示例#12
0
 private static void CarImageCRUD()
 {
     CarImageManager carImageManager = new CarImageManager(new EfCarImageDal());
     //carImageManager.Add(new CarImage {Id=1, CarId = 1,ImagePath= "5fcf374755427f1020984ea9.jpg" });
 }
示例#13
0
        public IActionResult UpdateCarImage([FromForm(Name = ("file"))] IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.Add(CarImageManager.CarImageNamefixer(file, carImage));

            return(result.Success ? Ok(result) : BadRequest(result));
        }