Ejemplo n.º 1
0
        public string AddChild(string motherName, string childName, string gender)
        {
            string result;
            Member member = SearchMember(familyHead, motherName);

            if (member == null)
            {
                result = Message.PERSON_NOT_FOUND;
            }
            else if (childName == null || gender == null)
            {
                result = Message.CHILD_ADDITION_FAILED;
            }
            else if (member.Gender == Gender.Female)
            {
                var g     = (FEMALE.Equals(gender)) ? Gender.Female : Gender.Male;
                var child = new Member(childName, g, member.Spouse, member);
                member.AddChild(child);
                result = Message.CHILD_ADDITION_SUCCEEDED;
            }
            else
            {
                result = Message.CHILD_ADDITION_FAILED;
            }
            return(result);
        }