コード例 #1
0
        public bool AddPerson(Persona Person)
        {
            if (People.Count > 0)
            {
                foreach (Persona Dude in People)
                {
                    if (Dude.GetRUT() == Person.GetRUT())
                    {
                        Console.WriteLine("A person with this RUT already exists.");
                        return(false);
                    }
                }
            }

            People.Add(Person);
            Console.WriteLine("Person " + Person.GetName() + " created successfully.");

            return(true);
        }