private static void UpdateSkiRun() { FirearmRepositorySQL firearmRepository = new FirearmRepositorySQL(); List <Firearm> firearms = firearmRepository.SelectAll(); Firearm firearm = new Firearm(); int firearmID; using (firearmRepository) { firearms = firearmRepository.SelectAll(); firearmID = ConsoleView.GetFirearmID(firearms); firearm = firearmRepository.SelectById(firearmID); firearm = ConsoleView.UpdateFirearm(firearm); firearmRepository.Update(firearm); } }
private static void DisplayFirearmDetail() { FirearmRepositorySQL firearmRepository = new FirearmRepositorySQL(); List <Firearm> firearms; Firearm firearm = new Firearm(); int firearmID; using (firearmRepository) { firearms = firearmRepository.SelectAll(); firearmID = ConsoleView.GetFirearmID(firearms); firearm = firearmRepository.SelectById(firearmID); } ConsoleView.DisplayFirearm(firearm); ConsoleView.DisplayContinuePrompt(); }
private static void DeleteFirearm() { FirearmRepositorySQL firearmRepository = new FirearmRepositorySQL(); List <Firearm> firearms = firearmRepository.SelectAll(); Firearm firearm = new Firearm(); int firearmID; string message; firearmID = ConsoleView.GetFirearmID(firearms); using (firearmRepository) { firearmRepository.Delete(firearmID); } ConsoleView.DisplayReset(); message = String.Format("Firearm ID: {0} had been deleted.", firearmID); ConsoleView.DisplayMessage(message); ConsoleView.DisplayContinuePrompt(); }