static void DeleteCar(InventoryDAL invDal, int carID) { try { invDal.DeleteCar(carID); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void DeleteCar(InventoryDAL dal) { Console.WriteLine("Enter CarId to delete"); int CarId = int.Parse(Console.ReadLine()); try { dal.DeleteCar(CarId); } catch(Exception ex) { Console.WriteLine(ex.Message); } }
private void DeleteCar(InventoryDAL inventory) { Console.Write("Enter ID of Car to delete:"); int id = int.Parse(Console.ReadLine()); try { inventory.DeleteCar(id); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void DeleteCar(InventoryDAL invDAL) { // Get ID of car to delete. Console.Write("EnterID of Car to delete: "); int id = int.Parse(Console.ReadLine()); // Catch referential integrity violation try { invDAL.DeleteCar(id); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
private static void DeleteCar(InventoryDAL invDAL) { // Get ID of car to delete. Console.Write("Enter ID of Car to delete: "); int id = int.Parse(Console.ReadLine()); // Just in case we have a primary key // violation! try { invDAL.DeleteCar(id); } catch (Exception ex) { Console.WriteLine(ex.Message); } }