private static void RentACarUsageSimulation() { RentalMenager rentalMenager = new RentalMenager(new EfRentalDal()); string value1 = "15/02/2021"; Rental rental = new Rental { CarId = 1, CustomerId = 1, RentDate = DateTime.Now, ReturnDate = DateTime.Parse(value1) }; }
private static void RentalDetailsDto() { RentalMenager rentalMenager = new RentalMenager(new EfRentalDal()); var result = rentalMenager.GetRentalDetails(); Console.WriteLine(result.Message); foreach (var rental in result.Data) { Console.WriteLine("------------------------------------------------------------------------------------------------------------------"); Console.WriteLine(" ID : {0} \n ŞİRKET ADI : {1} \n ARAÇ ADI : {2} \n KİRALANAN TARİH : {3} \n KİRADAN DÖNME TARİHİ : {4}", rental.Id, rental.CustomerName, rental.CarName, rental.RentDate, rental.ReturnDate); Console.WriteLine("------------------------------------------------------------------------------------------------------------------"); } }
private static void AllRentals() { RentalMenager rentalMenager = new RentalMenager(new EfRentalDal()); var result = rentalMenager.GetAll(); Console.WriteLine("**************{0}******************************************", result.Message); foreach (var re in result.Data) { Console.WriteLine("------------------------------------------------------------------------------------------------------------------"); Console.WriteLine(" ID : {0} \n ŞİRKET ID : {1} \n ARAÇ ID : {2} \n KİRALANAN TARİH : {3} \n KİRADAN DÖNME TARİHİ : {4}", re.Id, re.CustomerId, re.CarId, re.RentDate, re.ReturnDate); Console.WriteLine("------------------------------------------------------------------------------------------------------------------"); } }
static void Main(string[] args) { //CarTest(); //BrandTest(); //ColorTest(); //CarDetailTest(); RentalMenager rentalMenager = new RentalMenager(new EfRentalDal()); var result = rentalMenager.GetAll(); if (result.Success == true) { foreach (var rent in result.Data) { Console.WriteLine(rent.CarId + "--" + rent.CustomerId + "--" + rent.RentDate + "--" + rent.ReturnDate); } } }