예제 #1
0
        private static void ShowCar(int index)
        {
            var car = _service.GetCarById(index);

            Console.WriteLine("{0,-2} | {1,-10} | {2,-13} | {3,-13} | {4,-10}", "ID", "Plate", "Manufacturer", "Model", "PricePerDay");
            Console.WriteLine(String.Format("{0,-2} | {1,-10} | {2,-13} | {3,-13} | {4,-10}", car.CarID, car.Plate, car.Manufacturer, car.Model, car.PricePerDay));
            Console.WriteLine("---------------");
            Console.WriteLine("E) Edit car");
            Console.WriteLine("D) Delete car");
            Console.WriteLine("C) Continue");
            Console.Write("Please enter a command: ");
            var input = Console.ReadLine().ToUpper();

            if (input == "E")
            {
                EditCar(index);
            }
            else if (input == "D")
            {
                DeleteCar(index);
            }
        }
 private void LoadCar(int carId)
 {
     Car = null;
     CarDataService.GetCarById(carId, GetCarByIdCallback);
 }