// static int indexMainMenu = 0; static void Main(string[] args) { CarManager carManager = new CarManager(new EfCarDal()); //CarTest(carManager); Console.WriteLine("***EF Database'de olan arabalar CarDetailsDto'ya göre gösterildi***"); //CarGetAll(carManager); Console.WriteLine(carManager.GetAll().Message); Console.WriteLine("\n***BrandId'a göre ve ColorId'ye göre getirme****"); Console.WriteLine("*color'a göre"); //CarGetByColorId(carManager); Console.WriteLine(carManager.GetCarsByColorId(1).Message); Console.WriteLine("*brand'a göre"); //CarGetByBrandId(carManager); Console.WriteLine(carManager.GetCarsByBrandId(1).Message); BrandManager brandManager = new BrandManager(new EfBrandDal()); //BrandAddTest(brandManager); Console.WriteLine("\n***Marka Listesi***"); GetBrands(brandManager); Console.WriteLine(brandManager.GetAll().Message); ColorManager colorManager = new ColorManager(new EfColorDal()); //ColorAddTest(colorManager); Console.WriteLine("\n***Renk Listesi***"); GetColors(colorManager); Console.WriteLine(colorManager.GetAll().Message); Console.WriteLine("\n***Kullanıcılar Oluşturuldu***"); UserManager userManager = new UserManager(new EfUserDal()); //UsersTest(userManager); Console.WriteLine(userManager.GetAll().Message); Console.WriteLine("\n***Müşteriler Oluşturuldu***"); CustomerManager customerManager = new CustomerManager(new EfCustomerDal()); //CustomersTest(customerManager); Console.WriteLine(customerManager.GetAll().Message); Console.WriteLine("\n***Kiralama Oluşturuldu***"); RentalManager rentalManager = new RentalManager(new EfRentalDal()); RentalsTest(rentalManager); foreach (var rental in rentalManager.GetAllRentalDetail().Data) { Console.WriteLine("rentalid:" + rental.RentalId + " - car description:" + rental.CarName + " - company name:" + rental.CustomerName + " - rentdate:" + rental.RentDate + " - returndate:" + rental.ReturnDate); } }
private static void ListRental(RentalManager rentalManager) { Console.Clear(); foreach (var rental in rentalManager.GetAllRentalDetail().Data) { var table = new ConsoleTable("Kiralama Id", "Musteri Adi", "Musteri Soyadi", "Arac Markasi", "Arac Modeli", "Açıklama", "Kiralama Tarihi", "Teslim Tarihi"); table.AddRow(rental.RentalId, rental.CustomerFirstName, rental.CustomerLastName, rental.CarBrand, rental.CarModel, rental.CarDescription , rental.RentDate, rental.ReturnDate); table.Write(); } }
private static void GetAllRentalDetail() { RentalManager rentalManager = new RentalManager(new EfRentalDal()); var result = rentalManager.GetAllRentalDetail(); foreach (var rental in result.Data) { Console.WriteLine(rental.FirstName + " " + rental.LastName + " " + rental.Email + " " + rental.FirstName + " " + rental.LastName); } Console.WriteLine(result.Message); }
private static void RentalTest() { RentalManager rentalManager = new RentalManager(new EfRentalDal()); var result = rentalManager.GetAllRentalDetail(); if (result.Success) { foreach (var rental in result.Data) { Console.WriteLine(rental.FirstName + "/" + rental.LastName + "/" + rental.CarName + "/" + rental.DailyPrice + "/" + rental.RentDate + "/" + rental.ReturnDate + "/"); } } else { Console.WriteLine(result.Message); } }