/// <summary> /// Gets the children data. /// </summary> private void GetChildrenData() { Children = new List <PreRegistrationChild>(); foreach (var childRow in prChildren.ChildRows) { var person = new Person(); person.Id = childRow.PersonId; person.Guid = childRow.PersonGuid ?? Guid.NewGuid(); person.NickName = childRow.NickName; person.LastName = childRow.LastName; person.SuffixValueId = childRow.SuffixValueId; person.Gender = childRow.Gender; person.SetBirthDate(childRow.BirthDate); person.GradeOffset = childRow.GradeOffset; var child = new PreRegistrationChild(person); child.MobilePhoneNumber = childRow.MobilePhone; child.MobileCountryCode = childRow.MobilePhoneCountryCode; child.RelationshipType = childRow.RelationshipType; Children.Add(child); } }
/// <summary> /// Adds a new child. /// </summary> private void AddChild() { var person = new Person(); person.Guid = Guid.NewGuid(); person.Gender = Gender.Unknown; person.LastName = tbLastName.Text; person.GradeOffset = null; _dvcChildConnectionStatus = DefinedValueCache.Get(GetAttributeValue("ChildConnectionStatus").AsGuid()); if (_dvcChildConnectionStatus != null) { person.ConnectionStatusValueId = _dvcChildConnectionStatus.Id; } else { _dvcChildConnectionStatus = DefinedValueCache.Get(Rock.SystemGuid.DefinedValue.PERSON_CONNECTION_STATUS_VISITOR.AsGuid()); } var child = new PreRegistrationChild(person); Children.Add(child); }