Beispiel #1
0
        public List <Person> ListAllPersons(List <Person> ppl)
        {
            IGraphicUserInterface gui = new ConsoleUserInterface();

            foreach (Person person in ppl)
            {
                gui.PrintPerson(person);
                Console.ReadLine();
            }
            return(ppl);
        }
Beispiel #2
0
        public Person RemovePerson(List <Person> people, Person person)
        {
            IGraphicUserInterface gui = new ConsoleUserInterface();

            gui.PrintMessageOnLine("Enter the CNP of the person you would like to remove.");
            string cnp = gui.ReadInput();

            person = people.FirstOrDefault(x => x.CNP == cnp);

            if (person == null)
            {
                gui.PrintMessageOnLine("That person could not be found.");
                gui.ReadInput();
                return(null);
            }
            else
            {
                people.Remove(person);
                Console.WriteLine("Person {0} deleted.", person.LastName);
                gui.ReadInput();
                return(person);
            }
        }