Пример #1
0
        static void AddPartner(List <Person> People, Person currentPerson, bool isGrandParent, bool isParent)
        {
            Person partner = TypeOfPartner(isGrandParent, isParent);

            partner.InputPersonInformation();
            currentPerson.Partner = partner;
            People.Add(partner);
        }
Пример #2
0
        static void AddChild(List <Person> People, Person currentPerson, bool isGrandParent, bool isParent)
        {
            Person child = TypeOfChildren(currentPerson, isGrandParent, isParent);

            if (child == null)
            {
                Console.WriteLine($"{currentPerson.Name} is granchildren!");
                return;
            }
            else
            {
                child.InputPersonInformation();
                currentPerson.Children.Add(child);
                People.Add(child);
            }
        }