Exemplo n.º 1
0
        private static void UpdateGreatPerson()
        {
            GreatPeopleRepositorySQL greatPeopleRepository = new GreatPeopleRepositorySQL();
            List <GreatPeople>       greatPerson           = greatPeopleRepository.SelectAll();
            GreatPeople greatPeople = new GreatPeople();
            int         greatPersonID;

            using (greatPeopleRepository)
            {
                greatPerson   = greatPeopleRepository.SelectAll();
                greatPersonID = ConsoleView.GetGreatPersonID(greatPerson);
                greatPeople   = greatPeopleRepository.SelectById(greatPersonID);
                greatPeople   = ConsoleView.UpdateGreatPerson(greatPeople);
                greatPeopleRepository.Update(greatPeople);
            }
        }
Exemplo n.º 2
0
        private static void ListAllGreatPeople()
        {
            GreatPeopleRepositorySQL greatPersonRepository = new GreatPeopleRepositorySQL();
            List <GreatPeople>       greatPeople;

            using (greatPersonRepository)
            {
                greatPeople = greatPersonRepository.SelectAll();
                ConsoleView.DisplayAllGreatPeople(greatPeople);
                ConsoleView.DisplayContinuePromptInvisible();
            }
        }
Exemplo n.º 3
0
        private static void DisplayGreatPersonDetail()
        {
            GreatPeopleRepositorySQL greatPeopleRepository = new GreatPeopleRepositorySQL();
            List <GreatPeople>       greatPeople;
            GreatPeople greatPerson = new GreatPeople();
            int         greatPersonID;

            using (greatPeopleRepository)
            {
                greatPeople   = greatPeopleRepository.SelectAll();
                greatPersonID = ConsoleView.GetGreatPersonID(greatPeople);
                greatPerson   = greatPeopleRepository.SelectById(greatPersonID);
            }

            ConsoleView.DisplayGreatPerson(greatPerson);
            ConsoleView.DisplayContinuePromptInvisible();
        }
Exemplo n.º 4
0
        private static void DeleteGreatPerson()
        {
            GreatPeopleRepositorySQL greatPeopleRepository = new GreatPeopleRepositorySQL();
            List <GreatPeople>       greatPeople           = greatPeopleRepository.SelectAll();
            GreatPeople greatPerson = new GreatPeople();
            int         greatPersonID;
            string      message;

            greatPersonID = ConsoleView.GetGreatPersonID(greatPeople);

            using (greatPeopleRepository)
            {
                greatPeopleRepository.Delete(greatPersonID);
            }

            ConsoleView.DisplayReset();

            message = String.Format("Great Person ID: {0} had been deleted.", greatPersonID);

            ConsoleView.DisplayMessage(message);
            ConsoleView.DisplayContinuePromptInvisible();
        }