static void Main(string[] args) { //CarTest(); //CarTest2(); //CarTest3(); //ColorTest(); //BrandTest(); //CarTest4(); //UserTest(); RentalManager rentalManager = new RentalManager(new EfRentalDal()); //Rental rental3 = new Rental //{ // Id = 3, // CarId = 3, // UserId = 3, // RentDate = new DateTime(2021, 2, 18) //}; //rentalManager.Add(rental3); foreach (var rental in rentalManager.GetAllRentalDetails().Data) { Console.WriteLine(rental.FirstName + rental.LastName + rental.CompanyName + rental.Description + rental.BrandName + rental.ColorName + rental.RentDate + rental.ReturnDate); } //rentalManager.Add(rental1); //Console.WriteLine("Kiracı eklendi"); // Console.ReadLine(); }
static void Main(string[] args) { RentalManager rentalManager = new RentalManager(new EfRentalDal()); foreach (var item in rentalManager.GetAllRentalDetails().Data) { Console.WriteLine(item.FirstName + " " + item.LastName + " " + item.RentDate); } rentalManager.Add(new Rental { CustomerId = 1, CarId = 1, RentDate = DateTime.Now }); var message = rentalManager.Add(new Rental { CustomerId = 1, CarId = 1, RentDate = DateTime.Now }).Message; Console.WriteLine(message); }
private static void getAllRentalDetails(RentalManager rentalManager) { var result = rentalManager.GetAllRentalDetails(); if (result.Success) { Console.WriteLine("\n\n---- Detaylı Customer Bilgileri----\n"); foreach (var rentalDetail in result.Data) { Console.WriteLine("\n\n-----------------------------\n"); Console.WriteLine("ıd: " + rentalDetail.Id + "\nUser Id: " + rentalDetail.UserId + "\nCustomer First Name: " + rentalDetail.CustomerFirstName + "\nCustomer Last Name: " + rentalDetail.CustomerLastName + "\nCompany Name: " + rentalDetail.CompanyName + "\nCustomer Email : " + rentalDetail.Email + "\nCar Description: " + rentalDetail.CarDescription + "\nBrand Name: " + rentalDetail.BrandName + "\nModel Year: " + rentalDetail.ModelYear + "\nDaily Price: " + rentalDetail.DailyPrice + "\nRentDate: " + rentalDetail.RentDate + "\nReturn date: " + rentalDetail.ReturnDate); } Console.WriteLine("\n\n\n" + result.Message); } else { Console.WriteLine(result.Message); } }
//private static void TestCarDetails() //{ // CarManager carManager = new CarManager(new EfCarDal()); // var result = carManager.GetCarDetails(); // if (result.Success == true) // { // foreach (var car in result.Data) // { // Console.WriteLine("ID: " + car.CarId + " /Brand: " + car.BrandName + " /Color: " + car.ColorName + " /ModelYear: " + car.ModelYear + " /DailyPrice: " + car.DailyPrice + " /Description: " + car.Description); // } // } // else // { // Console.WriteLine(result.Message); // } //} private static void TestRentalDetails() { RentalManager rentalManager = new RentalManager(new EfRentalDal()); var result = rentalManager.GetAllRentalDetails(); if (result.Success == true) { foreach (var rental in result.Data) { Console.WriteLine("RentalId: " + rental.RentalId + "/CarId: " + rental.CarId + " /Brand: " + rental.BrandName + " /UserName: "******" /Email: " + rental.UserEmail + " /Company Name: " + rental.CompanyName + " /RentDate: " + rental.RentDate + " /ReturnDate: " + rental.ReturnDate); } } else { Console.WriteLine(result.Message); } }
private static void GetAllRentalDetailsDto(RentalManager rentalManager) { Console.WriteLine("---------- Araç Kiralama Listesi ----------"); var result = rentalManager.GetAllRentalDetails(); if (result.Data.Count() > 0) { Console.WriteLine($"Kiralanan Araç sayısı: {result.Data.Count()}"); Console.WriteLine(" "); foreach (var rental in result.Data) { Console.WriteLine($"Id: {rental.Id}\nMüşteri Id: {rental.CustomerId}\nŞirket Adı: {rental.CompanyName}\nKullanıcı Adı: {rental.UserFirstName}\nKullanıcı Soyadı: {rental.UserLastName}\nAraba Id:{rental.CarId}\nMarka Adı: {rental.BrandName}\nModel Adı: {rental.ModelName}\nKiralama Tarihi: {rental.RentDate}\nİade Tarihi: {rental.ReturnDate}"); Console.WriteLine("-----------------------------------"); } } else { Console.WriteLine(result.Message); } }
public List <RentalDetailDto> RentalList() { return(_rentalManager.GetAllRentalDetails().Data); }