private static void AllCarsByPrice(CarManager carManager, BrandManager brandManager, ColorManager colorManager, decimal min, decimal max) { Console.WriteLine(".:: My Rent A Car ::. \n\t\t\t\t\tCar List Filter : Price [min: {0},max: {1}]\n", min, max); Console.WriteLine("Car ID \tBrand \t\tColor \t\tModel \t\tPrice \t\tDesc"); Console.WriteLine("------ \t------ \t\t------ \t\t------ \t\t------ \t\t------"); foreach (var car in carManager.GetAllByDailyPrice(min, max).Data) { Console.WriteLine("{0}\t{1}\t\t{2}\t\t{3}\t\t{4}\t\t{5}", car.Id, brandManager.GetById(car.BrandId).Data.BrandName, colorManager.GetById(car.ColorId).Data.ColorName, car.ModelYear, car.DailyPrice.ToString("##.## TL"), car.Descriptions); } Console.WriteLine("\n-----------------------End of List---------------------------------"); }
private static void CarTest() { CarManager carManager = new CarManager(new EfCarDal()); var result = carManager.GetAllByDailyPrice(1000, 100); if (result.Success) { foreach (var car in result.Data) { Console.WriteLine("CarId : " + car.CarId); Console.WriteLine("ColorId : " + car.ColorId); Console.WriteLine("BrandId : " + car.BrandId); Console.WriteLine("DailyPrice : " + car.DailyPrice); Console.WriteLine("ModelYear : " + car.ModelYear); Console.WriteLine("Description : " + car.Description); } } else { Console.WriteLine(result.Message); } }