Example #1
0
        private static void CarDetails()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            foreach (var item in carManager.GetCarDetailDtos().Data)
            {
                if (carManager.GetCarDetailDtos().Success == true)
                {
                    Console.WriteLine(item.CarName + "--->" + item.BrandName + "--->" + item.ColorName + "--->" + item.DailyPrice);
                }
            }
        }
Example #2
0
        static void Main(string[] args)
        {   //productTest();
            //colorTest();
            //brandTest();

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

            //foreach (var car in carManager.GetAll())
            //{
            //    Console.WriteLine(car.CarName);
            //}

            CarManager carManager = new CarManager(new EfCarDal());
            var        result     = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.CarName + "//" + car.BrandName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #3
0
        private static void CarTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            carManager.Add(new Car
            {
                BrandID     = 1,
                CarName     = "HONDA",
                ColorID     = 1,
                DailyPrice  = 40000,
                Description = "Honda",
                ModelYear   = 2000
            });
            carManager.Delete(new Car
            {
                CarID = 14
            });
            var result = carManager.GetAll();

            foreach (var car in result.Data)
            {
                Console.WriteLine(car.CarName);
            }
            carManager.GetById(14);
            var resultt = carManager.GetCarDetailDtos();

            foreach (var car in resultt.Data)
            {
                Console.WriteLine(car.CarName + " " + car.BrandName + " " + car.ColorName);
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            CarManager carManager = new CarManager(new EfCarDal());

            var result = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var item in result.Data)
                {
                    Console.WriteLine("-------------------------------");
                    Console.WriteLine(" Araba ismi : " + item.Name);
                    Console.WriteLine(" Renk       : " + item.ColorName);
                    Console.WriteLine(" Marka      : " + item.BrandName);
                    Console.WriteLine(" Fiyat      : " + item.DailyPrice);
                    Console.WriteLine(" Modeli     : " + item.ModelYear);
                    Console.WriteLine(" Açıklama   : " + item.Description);
                    Console.WriteLine("");
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #5
0
 private static void CarDetailDtoView(CarManager carManager)
 {
     foreach (var car in carManager.GetCarDetailDtos().Data)
     {
         Console.WriteLine(car.CarId + "-" + car.CarName + "-" + car.ColorName + "-" + car.ModelYear + "-" + car.DailyPrice);
         Console.WriteLine("-------------------------------------------------");
     }
 }
Example #6
0
        private static void ManagerTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());
            var        result     = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.CarName + "/" + car.BrandName + "/" + car.BrandName);
                }
            }

            else
            {
                Console.WriteLine(result.Message);
            }

            foreach (var car in carManager.GetCarDetailDtos().Data)
            {
                Console.WriteLine(car.CarName + "/" + car.BrandName);
            }

            CustomerManager customerManager = new CustomerManager(new EfCustomerDal());
            UserManager     userManager     = new UserManager(new EfUserDal());
            RentalManager   rentalManager   = new RentalManager(new EfRentalDal());

            Rental rentalAdd = new Rental
            {
                CarId      = 1,
                CustomerId = 1,
                RentDate   = DateTime.Now,
                ReturnDate = new DateTime(2021, 03, 03)
            };

            Console.WriteLine(rentalManager.Add(rentalAdd).Message);

            User user = new User
            {
                FirstName = "Ezgi",
                LastName  = "Akar",
                Email     = "*****@*****.**",
                Password  = "******",
                UserId    = 1
            };
        }
Example #7
0
        private static void CarDtoTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());
            var        result     = carManager.GetCarDetailDtos();

            if (result.Success)
            {
                foreach (var car in carManager.GetCarDetailDtos().Data)
                {
                    Console.WriteLine(car.CarName + " " + car.BrandName + " " + car.ColorName + " " + car.DailyPrice);
                    Console.WriteLine(result.Message);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #8
0
        private static void TestingDtos()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            foreach (var car in carManager.GetCarDetailDtos().Data)
            {
                Console.WriteLine(car.DailyPrice + "/" + car.BrandName + "/" + car.CarName + "/" + car.ColorName);
            }
        }
Example #9
0
        private static void CarTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            foreach (var car in carManager.GetAll())
            {
                Console.WriteLine(car.Description);
            }

            Console.WriteLine("-----------");
            Console.WriteLine("CAR UPDATED");
            Console.WriteLine("-----------");

            //carManager.Update(new Car { Id = 1, BrandId = 1, ColorId = 3, ModelYear = 2019, DailyPrice = 150, CarName = "Clio", Description = "Renault Clio Otomatik Siyah 2019" });
            foreach (var car in carManager.GetAll())
            {
                Console.WriteLine(car.Description);
            }

            Console.WriteLine("-----------");
            Console.WriteLine("CAR DELETED");
            Console.WriteLine("-----------");

            //carManager.Delete(new Car { Id = 1, BrandId = 1, ColorId = 3, ModelYear = 2019, DailyPrice = 150, CarName = "Clio", Description = "Renault Clio Otomatik Siyah 2019" });
            foreach (var car in carManager.GetAll())
            {
                Console.WriteLine(car.Description);
            }

            Console.WriteLine("-----------");
            Console.WriteLine("CAR GetByBrandId");
            Console.WriteLine("-----------");

            foreach (var car in carManager.GetCarsByBrandId(3))// GetById returns a List type. That's why we should use foreach to visit all object in the List.
            {
                Console.WriteLine(car.Description);
            }

            Console.WriteLine("-----------");
            Console.WriteLine("CAR GetByColorId");
            Console.WriteLine("-----------");

            foreach (var car in carManager.GetCarsByColorId(3))// GetById returns a List type. That's why we should use foreach to visit all object in the List.
            {
                Console.WriteLine(car.Description);
            }

            Console.WriteLine("-----------");
            Console.WriteLine("CAR DETAILS");
            Console.WriteLine("-----------");
            foreach (var car in carManager.GetCarDetailDtos()) //Joined tables.
            {
                Console.WriteLine(car.CarName + " / " + car.BrandName + " / " + car.ColorName + " / " + car.DailyPrice);
            }
        }
Example #10
0
        //private static void ColorTest()
        //{
        //    ColorManager colorManager = new ColorManager(new EfColorDal());
        //    foreach (var color in colorManager.GetAll().Data)
        //    {
        //        Console.WriteLine("Color Name:{0} Color Id:{1} ", color.ColorName, color.ColorId);
        //    }
        //}

        private static void CarDtoTest()
        {
            Console.WriteLine("ID\tBrandId\tGünlük Kirası\tAçıklama\n");
            CarManager carManager = new CarManager(new EfCarDal());

            foreach (var carDetail in carManager.GetCarDetailDtos().Data)
            {
                Console.WriteLine("Araç Adı: " + carDetail.CarName + "\t" + " Marka: " + carDetail.BrandName + "\t" + "Renk: " +
                                  carDetail.ColorName + "\t" + "Günlük Ücret: " + carDetail.DailyPrice);
            }
        }
Example #11
0
        private static void CarTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            foreach (var car in carManager.GetCarDetailDtos().Data)
            {
                Console.WriteLine(car.CarName + "/" + car.ColorName + "/" + car.BrandName + "/" + car.DailyPrice);
            }
            //carManager.Add(new Car { BrandId = 1, ColorId = 4, DailyPrice = 1500, Description = "Mercedes", ModelYear = 2020 });
            //carManager.Update(new Car { Id = 5 , BrandId = 1, ColorId = 4, DailyPrice = 350, Description = "Mercedes", ModelYear = 2020 });
        }
Example #12
0
        private static void CarAdd()
        {
            CarManager carManager = new CarManager(new EfCarDal());
            var        result     = carManager.GetCarDetailDtos();

            if (result.Success)
            {
                foreach (var car in result.Data)
                {
                    System.Console.WriteLine(car.BrandName);
                }
            }
        }
Example #13
0
        static void Main(string[] args)
        {
            CarManager carManager = new CarManager(new EfCarDal());
            var        result     = carManager.GetCarDetailDtos();

            if (result.Success)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.BrandName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #14
0
        private static void CarCrud()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            //Car car1 = new Car
            //{
            //    /* Id = 2,*/ // identity yapıldı
            //    BrandId = 6,
            //    ColorId = 7,
            //    ModelYear = 1800,
            //    DailyPrice = 3000,
            //    Description = "Elektrikli",
            //    CarName = "Ferrai"

            //};
            // carManager.Add(car1);
            // carManager.Delete(new Car { Id=1});
            //carManager.Update(new Car { Id = 1, BrandId = 3, ColorId = 4, DailyPrice = 1800, Description = "İyi Araba", CarName = "Bugatti" ,ModelYear=1993});

            Console.WriteLine("-----Car GetAll-----");
            foreach (var item in carManager.GetAll())
            {
                Console.WriteLine("ID : " + item.Id + " BrandID : " + " " + item.BrandId + " " + "ColorID : " + " " + item.ColorId + " " + "Model Year : " + item.ModelYear + " " + "Daily Price : " + " " + item.DailyPrice + " " + "Description : " + item.Description);
            }


            Console.WriteLine("------Car GetById------");

            var carById = carManager.GetById(1003);

            Console.WriteLine("ID : " + carById.Id + " BrandID : " + " " + carById.BrandId + " " + "ColorID : " + " " + carById.ColorId + " " + "Model Year : " + carById.ModelYear + " " + "Daily Price : " + " " + carById.DailyPrice + " " + "Description : " + carById.Description);

            Console.WriteLine("-----Car GetByDailyPrice----- ");
            foreach (var item in carManager.GetByDailyPrice(150, 3001))
            {
                Console.WriteLine("ID : " + item.Id + " BrandID : " + " " + item.BrandId + " " + "ColorID : " + " " + item.ColorId + " " + "Model Year : " + item.ModelYear + " " + "Daily Price : " + " " + item.DailyPrice + " " + "Description : " + item.Description);
            }

            Console.WriteLine("-----Car DetailsDto----- ");


            foreach (var item in carManager.GetCarDetailDtos())
            {
                Console.WriteLine(item.Id + " " + item.CarName + " " + item.BrandName + " " + item.ColorName + " " + item.DailyPrice);
            }
        }
Example #15
0
        private static void GetAllTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            var result = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.CarName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #16
0
        private static void GetCarDetails()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            var result = carManager.GetCarDetailDtos();

            if (result.Success)
            {
                foreach (var item in result.Data)
                {
                    Console.WriteLine("Model Year : " + item.ModelYear + " Brand Name : " + item.BrandName + " Color Name : " + item.ColorName + " Daily Price : " + item.DailyPrice);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
            
        }
Example #17
0
        private static void CarTest()
        {
            CarManager car = new CarManager(new EfCarDal());

            //car.Update(new Car()
            //{
            //    CarId = 5,
            //    CarName = "kia",
            //    BrandId = 4,
            //    ColorId = 5,
            //    DailyPrice = 330,
            //    Description = "BENZİN",
            //    ModelYear = "1940"
            //});

            foreach (var cars in car.GetCarDetailDtos().Data)
            {
                Console.WriteLine(cars.CarName + " " + cars.BrandName + " " + cars.ColorName + " " + cars.DailyPrice);
            }
        }
Example #18
0
        private static void CarTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            //carManager.Add(new Car {BrandId=1, ColorId=1, ModelYear="2021", Descriptions="Manuel dizel", DailyPrice = 500 } );

            //carManager.Update(new Car { Id = 1003, BrandId = 2, ColorId = 3, ModelYear = "1990", Descriptions = "Manuel dizel", DailyPrice = 600});

            var result = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.Descriptions + "/" + car.BrandName + "/" + car.ColorName + "/" + car.DailyPrice);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }
        }
Example #19
0
        private static void CarTest()
        {
            CarManager carManager = new CarManager(new EfCarDal());

            carManager.Add(new Car {
                Id = 5, BrandId = 1, ColorId = 130, DailyPrice = 2500, Description = "Benz"
            });
            carManager.Update(new Car {
                Id = 4, BrandId = 2, ColorId = 130, ModelYear = 2019, DailyPrice = 1800, Description = "divo"
            });
            carManager.Delete(new Car {
                Id = 5
            });

            foreach (var car in carManager.GetAll().Data)
            {
                Console.WriteLine("Car Id {0} / Brand Id {1} / Color Id {2} / Daily Price {3}  / Description {4}", car.Id, car.BrandId, car.ColorId, car.DailyPrice, car.Description);
            }

            foreach (var car in carManager.GetCarDetailDtos().Data)
            {
                Console.WriteLine(car.BrandName + "/" + car.Description + "/" + car.ColorName + "/" + car.DailyPrice);
            }
        }
Example #20
0
        static void Main(string[] args)
        {
            InputManager    inputManager    = new InputManager();
            BrandManager    brandManager    = new BrandManager(new EfBrandDal());
            CarManager      carManager      = new CarManager(new EfCarDal());
            ColorManager    colorManager    = new ColorManager(new EfColorDal());
            CustomerManager customerManager = new CustomerManager(new EfCustomerDal());
            RentalManager   rentalManager   = new RentalManager(new EfRentalDal());
            UserManager     userManager     = new UserManager(new EfUserDal());

            do
            {
                Console.Clear();
                int operation1 = inputManager.InputTitle();
                int operation2 = inputManager.Inputoperation(operation1);

                switch (operation1)
                {
                case 1:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = brandManager.GetById();

                        Console.WriteLine(Lists.BrandList);
                        Console.WriteLine(result1.Data.Id + "\t\t\t" + result1.Data.BrandName);
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = brandManager.GetAll();

                        Console.WriteLine(Lists.BrandList);
                        foreach (var brand in result2.Data)
                        {
                            Console.WriteLine(brand.Id + "\t\t\t" + brand.BrandName);
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = brandManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = brandManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = brandManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;
                    }
                    break;

                case 2:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = carManager.GetById();

                        Console.WriteLine(Lists.CarList);
                        Console.WriteLine(
                            result1.Data.Id + "\t\t" +
                            result1.Data.BrandId + "\t\t" +
                            result1.Data.ColorId + "\t\t" +
                            result1.Data.ModelYear + "\t\t" +
                            result1.Data.DailyPrice + "\t\t" +
                            result1.Data.Description
                            );
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = carManager.GetAll();

                        Console.WriteLine(Lists.CarList);
                        foreach (var car in result2.Data)
                        {
                            Console.WriteLine(
                                car.Id + "\t\t" +
                                car.BrandId + "\t\t" +
                                car.ColorId + "\t\t" +
                                car.ModelYear + "\t\t" +
                                car.DailyPrice + "\t\t" +
                                car.Description
                                );
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = carManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = carManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = carManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;

                    case 6:
                        var result6 = carManager.GetCarsByBrandId();

                        Console.WriteLine(Lists.CarList);
                        foreach (var car in result6.Data)
                        {
                            Console.WriteLine(
                                car.Id + "\t\t" +
                                car.BrandId + "\t\t" +
                                car.ColorId + "\t\t" +
                                car.ModelYear + "\t\t" +
                                car.DailyPrice + "\t\t" +
                                car.Description
                                );
                        }
                        Console.WriteLine(result6.Message);
                        break;

                    case 7:
                        var result7 = carManager.GetCarsByColorId();

                        Console.WriteLine(Lists.CarList);
                        foreach (var car in result7.Data)
                        {
                            Console.WriteLine(
                                car.Id + "\t\t" +
                                car.BrandId + "\t\t" +
                                car.ColorId + "\t\t" +
                                car.ModelYear + "\t\t" +
                                car.DailyPrice + "\t\t" +
                                car.Description
                                );
                        }
                        Console.WriteLine(result7.Message);
                        break;

                    case 8:
                        var result8 = carManager.GetCarDetailDtos();

                        Console.WriteLine(Lists.CarList);
                        foreach (var car in result8.Data)
                        {
                            Console.WriteLine(
                                car.CarName +
                                "\t\t" + car.BrandName +
                                "\t\t\t" + car.ColorName +
                                "\t\t\t" + car.DailyPrice);
                        }
                        Console.WriteLine(result8.Message);
                        break;
                    }
                    break;

                case 3:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = colorManager.GetById();

                        Console.WriteLine(Lists.ColorList);
                        Console.WriteLine(result1.Data.Id + "\t\t\t" + result1.Data.ColorName);
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = colorManager.GetAll();

                        Console.WriteLine(Lists.ColorList);
                        foreach (var color in result2.Data)
                        {
                            Console.WriteLine(color.Id + "\t\t" + color.ColorName);
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = colorManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = colorManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = colorManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;
                    }
                    break;

                case 4:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = customerManager.GetById();

                        Console.WriteLine(Lists.CustomerList);
                        Console.WriteLine(result1.Data.Id + "\t\t\t"
                                          + result1.Data.UserId + "\t\t\t"
                                          + result1.Data.CompanyName);
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = customerManager.GetAll();

                        Console.WriteLine(Lists.CustomerList);
                        foreach (var customer in result2.Data)
                        {
                            Console.WriteLine(customer.Id + "\t\t\t"
                                              + customer.UserId + "\t\t\t"
                                              + customer.CompanyName);
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = customerManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = customerManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = customerManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;
                    }
                    break;

                case 5:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = rentalManager.GetById();

                        Console.WriteLine(Lists.RentalList);
                        Console.WriteLine(
                            result1.Data.Id + "\t\t\t" +
                            result1.Data.CarId + "\t\t\t" +
                            result1.Data.CustomerId + "\t\t\t" +
                            result1.Data.RentDate + "\t\t" +
                            result1.Data.ReturnDate);
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = rentalManager.GetAll();

                        Console.WriteLine(Lists.RentalList);
                        foreach (var rental in result2.Data)
                        {
                            Console.WriteLine(
                                rental.Id + "\t\t\t" +
                                rental.CarId + "\t\t\t" +
                                rental.CustomerId + "\t\t\t" +
                                rental.RentDate + "\t\t" +
                                rental.ReturnDate);
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = rentalManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = rentalManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = rentalManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;
                    }
                    break;

                case 6:
                    switch (operation2)
                    {
                    case 1:
                        var result1 = userManager.GetById();

                        Console.WriteLine(Lists.UserList);
                        Console.WriteLine(
                            result1.Data.Id + "\t\t\t" +
                            result1.Data.FirstName + "\t\t" +
                            result1.Data.LastName + "\t\t" +
                            result1.Data.Email + "\t\t" +
                            result1.Data.Password);
                        Console.WriteLine(result1.Message);
                        break;

                    case 2:
                        var result2 = userManager.GetAll();

                        Console.WriteLine(Lists.UserList);
                        foreach (var user in result2.Data)
                        {
                            Console.WriteLine(
                                user.Id + "\t\t\t" +
                                user.FirstName + "\t\t" +
                                user.LastName + "\t\t" +
                                user.Email + "\t\t" +
                                user.Password);
                        }
                        Console.WriteLine(result2.Message);
                        break;

                    case 3:
                        var result3 = userManager.Add();
                        Console.WriteLine(result3.Message);
                        break;

                    case 4:
                        var result4 = userManager.Update();
                        Console.WriteLine(result4.Message);
                        break;

                    case 5:
                        var result5 = userManager.Delete();
                        Console.WriteLine(result5.Message);
                        break;
                    }
                    break;
                }

                Console.Write("Devam Etmek İster Misiniz? (e/h)");
            } while(Console.ReadLine() == "e");
        }
Example #21
0
        private static void AracEkle()
        {
            BrandManager brandManager = new BrandManager(new EfBrandDal());
            Brand        brand1       = new Brand
            {
                Name = "Fiat"
            };
            Brand brand2 = new Brand
            {
                Name = "Ford"
            };
            Brand brand3 = new Brand
            {
                Name = "Toyota"
            };

            brandManager.Add(brand1);
            brandManager.Add(brand2);
            brandManager.Add(brand3);


            ColorManager colorManager = new ColorManager(new EfColorDal());
            Color        color1       = new Color
            {
                Name = "Kırmızı"
            };
            Color color2 = new Color
            {
                Name = "Beyaz"
            };
            Color color3 = new Color
            {
                Name = "Gri"
            };

            colorManager.Add(color1);
            colorManager.Add(color2);
            colorManager.Add(color3);


            CarManager carManager = new CarManager(new EfCarDal());
            Car        car1       = new Car
            {
                BrandId     = 1,
                ColorId     = 1,
                DailyPrice  = 125500,
                Description = "Temiz araç",
                ModelYear   = 2016
            };

            Console.WriteLine(carManager.Add(car1).Message);


            Car car2 = new Car
            {
                BrandId     = 1,
                ColorId     = 2,
                DailyPrice  = 325500,
                Description = "Sahibinden Temiz Araç",
                ModelYear   = 2019
            };

            Console.WriteLine(carManager.Add(car2));

            Car car3 = new Car
            {
                BrandId     = 3,
                ColorId     = 2,
                DailyPrice  = 65500,
                Description = "Hata Kaza Değişen Yok! Sadece 2 parça boyalı geyik çarptı :)",
                ModelYear   = 2009
            };

            Console.WriteLine(carManager.Add(car3).Message);

            //update
            car1.ModelYear = 2015;
            carManager.Update(car1);

            //Delete
            carManager.Delete(car2);

            //List Cars
            var result = carManager.GetCarDetailDtos();

            if (result.Success)
            {
                foreach (var item in result.Data)
                {
                    Console.WriteLine($"Car Name : {item.CarName}, Brand Name : {item.BrandName}, Color Name : {item.ColorName}, Daily Price : {item.DailyPrice.ToString("n2")}");
                }
            }
        }
        static void Main(string[] args)
        {
            //Car car1 = new Car { CarId = 6, BrandId = 1, ColorId = 2, ModelYear = "2021", DailyPrice = 450, Description = "not6" };

            //CarManager carManager = new CarManager(new InMemoryCarDal());
            //Console.WriteLine("---------Kayıt Eklendi-------------");
            //carManager.Add(car1);
            //foreach (var car in carManager.GetAll())
            //{
            //    Console.WriteLine(car.CarId + " " + car.BrandId + " " + car.ColorId + " " + " " + car.ModelYear + " " + car.DailyPrice + " " + car.Description);

            //}
            //Console.WriteLine("---------Silme-------------");
            //carManager.Delete(car1);

            //foreach (var car in carManager.GetAll())
            //{
            //    Console.WriteLine(car.CarId + " " + car.BrandId + " " + car.ColorId + " " + " " + car.ModelYear + " " + car.DailyPrice + " " + car.Description);

            //}
            //Console.WriteLine("---------Guncelleme-------------");

            //Car car2 = new Car { CarId = 3, BrandId = 3, ColorId = 1, ModelYear = "2012", DailyPrice = 225, Description = "Guncelleme işlemi yapıldı" };
            //carManager.Update(car2);
            //foreach (var car in carManager.GetAll())
            //{
            //    Console.WriteLine(car.CarId + " " + car.BrandId + " " + car.ColorId + " " + " " + car.ModelYear + " " + car.DailyPrice + " " + car.Description);

            //}
            //Console.WriteLine("---------Id e göre bilgi getirme-------------");
            //foreach (var car in carManager.GetById(5))
            //{
            //    Console.WriteLine(car.CarId + " " + car.BrandId + " " + car.ColorId + " " + " " + car.ModelYear + " " + car.DailyPrice + " " + car.Description);

            //}
            //Console.WriteLine("---------Car------------");
            //CarManager carManager = new CarManager(new EfCarDal());
            //foreach (var car in carManager.GetAll())
            //{
            //    Console.WriteLine(car.CarId+"-"+car.ColorId+"-"+car.BrandId+"-"+car.ModelYear+"-"+car.DailyPrice+"-"+car.Description);
            //}
            //Console.WriteLine("---------Color------------");
            //ColorManager colorManager = new ColorManager(new EfColorDal());
            //foreach (var color in colorManager.GetAll())
            //{
            //    Console.WriteLine(color.ColorId+"-"+color.Name);
            //}
            //Console.WriteLine("---------Brand------------");
            //BrandManager brandManager = new BrandManager(new EfBrandDal());
            //foreach (var brand in brandManager.GetAll())
            //{
            //    Console.WriteLine(brand.BrandId + "-" + brand.Name);
            //}
            //Console.WriteLine("---------car-colorName-BrandName------------");
            //foreach (var car in carManager.GetCarDetailDtos())
            //{
            //    Console.WriteLine(car.CarId+"-"+car.ColorName+"-"+car.BrandName+"-"+car.DailPrice+"-"+car.Description);
            //}

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

            var result = carManager.GetCarDetailDtos();

            if (result.Success == true)
            {
                foreach (var car in result.Data)
                {
                    Console.WriteLine(car.BrandName + "--" + car.ColorName);
                }
            }
            else
            {
                Console.WriteLine(result.Message);
            }



            RentalManager rentalManager = new RentalManager(new EfRentalDal());
            var           result1       = rentalManager.GetAll();

            if (result1.Success == true)
            {
                foreach (var rental in result1.Data)
                {
                    Console.WriteLine(rental.Id + "---" + rental.CarId + "---" + rental.CustomerId + "---" + rental.RentDate + "---" + rental.ReturnDate);
                }
            }

            var result3 = rentalManager.GetRentalDetailDtos();

            if (result3.Success == true)
            {
                foreach (var ren in result3.Data)
                {
                    Console.WriteLine(ren.CarId + "-" + ren.BrandName + "-" + ren.CarId + "-" + ren.FirsName + "-" + ren.LastName + "-" + ren.CompanyName);
                }
                Console.WriteLine(result3.Message);
            }

            Console.WriteLine("------------------------");
            var result4 = carManager.GetAll(1);

            if (result4.Success == true)
            {
                foreach (var car in result4.Data)
                {
                    Console.WriteLine(car.CarId + "--" + car.ColorId + "--" + car.BrandId + "--" + car.DailyPrice);
                }
            }
            Console.ReadKey();
        }