Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }