예제 #1
0
        /// <summary>
        /// Shows the detail.
        /// </summary>
        private void ShowDetail()
        {
            var rockContext = new RockContext();
            var groupMemberService = new GroupMemberService( rockContext );
            var attributeValueService = new AttributeValueService( rockContext );

            if ( CurrentPerson != null )
            {
                var personId = CurrentPerson.Id;

                // Setup Image
                string imgTag = Rock.Model.Person.GetPersonPhotoImageTag( CurrentPerson, 200, 200 );
                if ( CurrentPerson.PhotoId.HasValue )
                {
                    lImage.Text = string.Format( "<a href='{0}'>{1}</a>", CurrentPerson.PhotoUrl, imgTag );
                }
                else
                {
                    lImage.Text = imgTag;
                }

                // Person Info
                lName.Text = CurrentPerson.FullName;
                if ( CurrentPerson.BirthDate.HasValue )
                {
                    lAge.Text = string.Format( "{0}<small>({1})</small><br/>", CurrentPerson.FormatAge(), CurrentPerson.BirthYear != DateTime.MinValue.Year ? CurrentPerson.BirthDate.Value.ToShortDateString() : CurrentPerson.BirthDate.Value.ToMonthDayString() );
                }

                lGender.Text = CurrentPerson.Gender != Gender.Unknown ? CurrentPerson.Gender.ToString() : string.Empty;
                lGrade.Text = CurrentPerson.GradeFormatted;
                lMaritalStatus.Text = CurrentPerson.MaritalStatusValueId.DefinedValue();
                if ( CurrentPerson.AnniversaryDate.HasValue )
                {
                    lMaritalStatus.Text += string.Format( " {0} yrs <small>({1})</small>", CurrentPerson.AnniversaryDate.Value.Age(), CurrentPerson.AnniversaryDate.Value.ToMonthDayString() );
                }

                if ( CurrentPerson.GetFamilies().Count() > 1 )
                {
                    ddlGroup.Visible = true;
                }

                // Contact Info
                if ( CurrentPerson.PhoneNumbers != null )
                {
                    var selectedPhoneTypeGuids = GetAttributeValue( "PhoneNumbers" ).Split( ',' ).AsGuidList();
                    rptPhones.DataSource = CurrentPerson.PhoneNumbers.Where( pn => selectedPhoneTypeGuids.Contains( pn.NumberTypeValue.Guid ) ).ToList();
                    rptPhones.DataBind();
                }

                lEmail.Text = CurrentPerson.Email;

                // Person Attributes
                List<Guid> attributeGuidList = GetPersonAttributeGuids( personId );
                CurrentPerson.LoadAttributes();
                rptPersonAttributes.DataSource = CurrentPerson.Attributes.Where( a =>
                     attributeGuidList.Contains( a.Value.Guid ) )
                    .Select( a => new
                    {
                        Name = a.Value.Name,
                        Value = a.Value.FieldType.Field.FormatValue( null, CurrentPerson.GetAttributeValue( a.Key ), a.Value.QualifierValues, a.Value.FieldType.Class == typeof( Rock.Field.Types.ImageFieldType ).FullName )
                    } )
                    .OrderBy( av => av.Name )
                    .ToList()
                    .Where( av => !String.IsNullOrWhiteSpace( av.Value ) );
                rptPersonAttributes.DataBind();

                // Families
                if ( GetAttributeValue( "ShowFamilyMembers" ).AsBoolean() )
                {
                    if ( ddlGroup.SelectedValueAsId().HasValue )
                    {
                        var group = new GroupService( rockContext ).Get( ddlGroup.SelectedValueAsId().Value );
                        if ( group != null )
                        {

                            // Family Name
                            lGroupName.Text = group.Name;

                            // Family Address
                            Guid? locationTypeGuid = GetAttributeValue( "AddressType" ).AsGuidOrNull();
                            if ( locationTypeGuid.HasValue )
                            {
                                var addressTypeDv = DefinedValueCache.Read( locationTypeGuid.Value );

                                var familyGroupTypeGuid = Rock.SystemGuid.GroupType.GROUPTYPE_FAMILY.AsGuidOrNull();

                                if ( familyGroupTypeGuid.HasValue )
                                {
                                    var familyGroupType = GroupTypeCache.Read( familyGroupTypeGuid.Value );

                                    var address = new GroupLocationService( rockContext ).Queryable()
                                                        .Where( l => l.Group.GroupTypeId == familyGroupType.Id
                                                             && l.GroupLocationTypeValueId == addressTypeDv.Id
                                                             && l.Group.Members.Any( m => m.PersonId == CurrentPerson.Id )
                                                             && l.Group.Id == group.Id )
                                                        .Select( l => l.Location )
                                                        .FirstOrDefault();
                                    if ( address != null )
                                    {
                                        lAddress.Text = string.Format( "<div class='margin-b-md'><b>{0} Address</b><br />{1}</div>", addressTypeDv.Value, address.FormattedHtmlAddress );
                                    }
                                }
                            }

                            // Family Attributes
                            group.LoadAttributes();
                            List<Guid> familyAttributeGuidList = GetAttributeValue( "FamilyAttributes" ).SplitDelimitedValues().AsGuidList();
                            var familyAttributes = group.Attributes.Where( a =>
                                 familyAttributeGuidList.Contains( a.Value.Guid ) )
                                .Select( a => new
                                {
                                    Name = a.Value.Name,
                                    Value = a.Value.FieldType.Field.FormatValue( null, group.GetAttributeValue( a.Key ), a.Value.QualifierValues, a.Value.FieldType.Class == typeof( Rock.Field.Types.ImageFieldType ).FullName )
                                } )
                                .OrderBy( av => av.Name )
                                .ToList()
                                .Where( av => !String.IsNullOrWhiteSpace( av.Value ) );
                            if ( familyAttributes.Count() > 0 )
                            {
                                lFamilyHeader.Visible = true;
                                rptGroupAttributes.DataSource = familyAttributes;
                                rptGroupAttributes.DataBind();
                            }

                            rptGroupMembers.DataSource = group.Members.Where( gm =>
                                gm.PersonId != CurrentPerson.Id &&
                                gm.Person.IsDeceased == false )
                                .OrderBy( m => m.GroupRole.Order )
                                .ToList();
                            rptGroupMembers.DataBind();
                        }
                    }
                }

                if ( String.IsNullOrWhiteSpace( GetAttributeValue( "WorkflowLaunchPage" ) ) )
                {
                    lbRequestChanges.Visible = false;
                }
            }

            hfPersonId.Value = string.Empty;
            pnlEdit.Visible = false;
            pnlView.Visible = true;
        }
예제 #2
0
        /// <summary>
        /// Restores the view-state information from a previous user control request that was saved by the <see cref="M:System.Web.UI.UserControl.SaveViewState" /> method.
        /// </summary>
        /// <param name="savedState">An <see cref="T:System.Object" /> that represents the user control state to be restored.</param>
        protected override void LoadViewState( object savedState )
        {
            base.LoadViewState( savedState );

            if ( IsEditingGroup == true )
            {
                Group group = new GroupService( new RockContext() ).Get( _groupId );
                group.LoadAttributes();

                phAttributes.Controls.Clear();
                Rock.Attribute.Helper.AddEditControls( group, phAttributes, false, BlockValidationGroup );
            }

            if ( IsEditingGroupMember == true )
            {
                RockContext rockContext = new RockContext();
                GroupMemberService groupMemberService = new GroupMemberService( rockContext );

                var groupMember = groupMemberService.Get( this.CurrentGroupMemberId );

                if ( groupMember == null )
                {
                    groupMember = new GroupMember { Id = 0 };
                    groupMember.GroupId = _groupId;
                    groupMember.Group = new GroupService( rockContext ).Get( groupMember.GroupId );
                    groupMember.GroupRoleId = groupMember.Group.GroupType.DefaultGroupRoleId ?? 0;
                    groupMember.GroupMemberStatus = GroupMemberStatus.Active;
                }

                // set attributes
                groupMember.LoadAttributes();
                phGroupMemberAttributes.Controls.Clear();
                Rock.Attribute.Helper.AddEditControls( groupMember, phGroupMemberAttributes, true, string.Empty, true );
            }
        }
예제 #3
0
        /// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void btnSave_Click( object sender, EventArgs e )
        {
            var rockContext = new RockContext();
            if ( ddlGroup.SelectedValueAsId().HasValue )
            {
                var group = new GroupService( rockContext ).Get( ddlGroup.SelectedValueAsId().Value );
                if ( group != null )
                {
                    rockContext.WrapTransaction( () =>
                    {
                        var personService = new PersonService( rockContext );

                        var changes = new List<string>();

                        var personId = hfPersonId.Value.AsInteger();
                        if ( personId == 0 )
                        {
                            changes.Add( "Created" );

                            var groupMemberService = new GroupMemberService( rockContext );
                            var groupMember = new GroupMember() { Person = new Person(), Group = group, GroupId = group.Id };
                            groupMember.Person.TitleValueId = ddlTitle.SelectedValueAsId();
                            groupMember.Person.FirstName = tbFirstName.Text;
                            groupMember.Person.NickName = tbNickName.Text;
                            groupMember.Person.LastName = tbLastName.Text;
                            groupMember.Person.SuffixValueId = ddlSuffix.SelectedValueAsId();
                            groupMember.Person.Gender = rblGender.SelectedValueAsEnum<Gender>();
                            DateTime? birthdate = bpBirthDay.SelectedDate;
                            if ( birthdate.HasValue )
                            {
                                // If setting a future birthdate, subtract a century until birthdate is not greater than today.
                                var today = RockDateTime.Today;
                                while ( birthdate.Value.CompareTo( today ) > 0 )
                                {
                                    birthdate = birthdate.Value.AddYears( -100 );
                                }
                            }

                            groupMember.Person.SetBirthDate( birthdate );
                            if ( ddlGradePicker.Visible )
                            {
                                groupMember.Person.GradeOffset = ddlGradePicker.SelectedValueAsInt();
                            }

                            var role = group.GroupType.Roles.Where( r => r.Id == ( rblRole.SelectedValueAsInt() ?? 0 ) ).FirstOrDefault();
                            if ( role != null )
                            {
                                groupMember.GroupRole = role;
                                groupMember.GroupRoleId = role.Id;
                            }

                            var headOfHousehold = GroupServiceExtensions.HeadOfHousehold( group.Members.AsQueryable() );
                            if ( headOfHousehold != null )
                            {
                                DefinedValueCache dvcConnectionStatus = DefinedValueCache.Read( headOfHousehold.ConnectionStatusValueId ?? 0 );
                                DefinedValueCache dvcRecordStatus = DefinedValueCache.Read( headOfHousehold.ConnectionStatusValueId ?? 0 );
                                if ( dvcConnectionStatus != null )
                                {
                                    groupMember.Person.ConnectionStatusValueId = dvcConnectionStatus.Id;
                                }

                                if ( dvcRecordStatus != null )
                                {
                                    groupMember.Person.RecordStatusValueId = dvcRecordStatus.Id;
                                }
                            }

                            if ( groupMember.GroupRole.Guid == Rock.SystemGuid.GroupRole.GROUPROLE_FAMILY_MEMBER_ADULT.AsGuid() )
                            {
                                groupMember.Person.GivingGroupId = group.Id;
                            }

                            groupMember.Person.IsEmailActive = true;
                            groupMember.Person.EmailPreference = EmailPreference.EmailAllowed;
                            groupMember.Person.RecordTypeValueId = DefinedValueCache.Read( Rock.SystemGuid.DefinedValue.PERSON_RECORD_TYPE_PERSON.AsGuid() ).Id;

                            groupMemberService.Add( groupMember );
                            rockContext.SaveChanges();
                            personId = groupMember.PersonId;
                        }

                        var person = personService.Get( personId );
                        if ( person != null )
                        {
                            int? orphanedPhotoId = null;
                            if ( person.PhotoId != imgPhoto.BinaryFileId )
                            {
                                orphanedPhotoId = person.PhotoId;
                                person.PhotoId = imgPhoto.BinaryFileId;

                                if ( orphanedPhotoId.HasValue )
                                {
                                    if ( person.PhotoId.HasValue )
                                    {
                                        changes.Add( "Modified the photo." );
                                    }
                                    else
                                    {
                                        changes.Add( "Deleted the photo." );
                                    }
                                }
                                else if ( person.PhotoId.HasValue )
                                {
                                    changes.Add( "Added a photo." );
                                }
                            }

                            int? newTitleId = ddlTitle.SelectedValueAsInt();
                            History.EvaluateChange( changes, "Title", DefinedValueCache.GetName( person.TitleValueId ), DefinedValueCache.GetName( newTitleId ) );
                            person.TitleValueId = newTitleId;

                            History.EvaluateChange( changes, "First Name", person.FirstName, tbFirstName.Text );
                            person.FirstName = tbFirstName.Text;

                            History.EvaluateChange( changes, "Nick Name", person.NickName, tbNickName.Text );
                            person.NickName = tbNickName.Text;

                            History.EvaluateChange( changes, "Last Name", person.LastName, tbLastName.Text );
                            person.LastName = tbLastName.Text;

                            int? newSuffixId = ddlSuffix.SelectedValueAsInt();
                            History.EvaluateChange( changes, "Suffix", DefinedValueCache.GetName( person.SuffixValueId ), DefinedValueCache.GetName( newSuffixId ) );
                            person.SuffixValueId = newSuffixId;

                            var birthMonth = person.BirthMonth;
                            var birthDay = person.BirthDay;
                            var birthYear = person.BirthYear;

                            var birthday = bpBirthDay.SelectedDate;
                            if ( birthday.HasValue )
                            {
                                // If setting a future birthdate, subtract a century until birthdate is not greater than today.
                                var today = RockDateTime.Today;
                                while ( birthday.Value.CompareTo( today ) > 0 )
                                {
                                    birthday = birthday.Value.AddYears( -100 );
                                }

                                person.BirthMonth = birthday.Value.Month;
                                person.BirthDay = birthday.Value.Day;
                                if ( birthday.Value.Year != DateTime.MinValue.Year )
                                {
                                    person.BirthYear = birthday.Value.Year;
                                }
                                else
                                {
                                    person.BirthYear = null;
                                }
                            }
                            else
                            {
                                person.SetBirthDate( null );
                            }

                            History.EvaluateChange( changes, "Birth Month", birthMonth, person.BirthMonth );
                            History.EvaluateChange( changes, "Birth Day", birthDay, person.BirthDay );
                            History.EvaluateChange( changes, "Birth Year", birthYear, person.BirthYear );

                            int? graduationYear = null;
                            if ( ypGraduation.SelectedYear.HasValue )
                            {
                                graduationYear = ypGraduation.SelectedYear.Value;
                            }

                            History.EvaluateChange( changes, "Graduation Year", person.GraduationYear, graduationYear );
                            person.GraduationYear = graduationYear;

                            var newGender = rblGender.SelectedValue.ConvertToEnum<Gender>();
                            History.EvaluateChange( changes, "Gender", person.Gender, newGender );
                            person.Gender = newGender;

                            var phoneNumberTypeIds = new List<int>();

                            bool smsSelected = false;

                            foreach ( RepeaterItem item in rContactInfo.Items )
                            {
                                HiddenField hfPhoneType = item.FindControl( "hfPhoneType" ) as HiddenField;
                                PhoneNumberBox pnbPhone = item.FindControl( "pnbPhone" ) as PhoneNumberBox;
                                CheckBox cbUnlisted = item.FindControl( "cbUnlisted" ) as CheckBox;
                                CheckBox cbSms = item.FindControl( "cbSms" ) as CheckBox;

                                if ( hfPhoneType != null &&
                                    pnbPhone != null &&
                                    cbSms != null &&
                                    cbUnlisted != null )
                                {
                                    if ( !string.IsNullOrWhiteSpace( PhoneNumber.CleanNumber( pnbPhone.Number ) ) )
                                    {
                                        int phoneNumberTypeId;
                                        if ( int.TryParse( hfPhoneType.Value, out phoneNumberTypeId ) )
                                        {
                                            var phoneNumber = person.PhoneNumbers.FirstOrDefault( n => n.NumberTypeValueId == phoneNumberTypeId );
                                            string oldPhoneNumber = string.Empty;
                                            if ( phoneNumber == null )
                                            {
                                                phoneNumber = new PhoneNumber { NumberTypeValueId = phoneNumberTypeId };
                                                person.PhoneNumbers.Add( phoneNumber );
                                            }
                                            else
                                            {
                                                oldPhoneNumber = phoneNumber.NumberFormattedWithCountryCode;
                                            }

                                            phoneNumber.CountryCode = PhoneNumber.CleanNumber( pnbPhone.CountryCode );
                                            phoneNumber.Number = PhoneNumber.CleanNumber( pnbPhone.Number );

                                            // Only allow one number to have SMS selected
                                            if ( smsSelected )
                                            {
                                                phoneNumber.IsMessagingEnabled = false;
                                            }
                                            else
                                            {
                                                phoneNumber.IsMessagingEnabled = cbSms.Checked;
                                                smsSelected = cbSms.Checked;
                                            }

                                            phoneNumber.IsUnlisted = cbUnlisted.Checked;
                                            phoneNumberTypeIds.Add( phoneNumberTypeId );

                                            History.EvaluateChange(
                                                changes,
                                                string.Format( "{0} Phone", DefinedValueCache.GetName( phoneNumberTypeId ) ),
                                                oldPhoneNumber,
                                                phoneNumber.NumberFormattedWithCountryCode );
                                        }
                                    }
                                }
                            }

                            // Remove any blank numbers
                            var phoneNumberService = new PhoneNumberService( rockContext );
                            foreach ( var phoneNumber in person.PhoneNumbers
                                .Where( n => n.NumberTypeValueId.HasValue && !phoneNumberTypeIds.Contains( n.NumberTypeValueId.Value ) )
                                .ToList() )
                            {
                                History.EvaluateChange(
                                    changes,
                                    string.Format( "{0} Phone", DefinedValueCache.GetName( phoneNumber.NumberTypeValueId ) ),
                                    phoneNumber.ToString(),
                                    string.Empty );

                                person.PhoneNumbers.Remove( phoneNumber );
                                phoneNumberService.Delete( phoneNumber );
                            }

                            History.EvaluateChange( changes, "Email", person.Email, tbEmail.Text );
                            person.Email = tbEmail.Text.Trim();

                            var newEmailPreference = rblEmailPreference.SelectedValue.ConvertToEnum<EmailPreference>();
                            History.EvaluateChange( changes, "Email Preference", person.EmailPreference, newEmailPreference );
                            person.EmailPreference = newEmailPreference;

                            person.LoadAttributes();
                            Rock.Attribute.Helper.GetEditValues( phPersonAttributes, person );

                            if ( person.IsValid )
                            {
                                if ( rockContext.SaveChanges() > 0 )
                                {
                                    if ( changes.Any() )
                                    {
                                        HistoryService.SaveChanges(
                                            rockContext,
                                            typeof( Person ),
                                            Rock.SystemGuid.Category.HISTORY_PERSON_DEMOGRAPHIC_CHANGES.AsGuid(),
                                            person.Id,
                                            changes );
                                    }

                                    if ( orphanedPhotoId.HasValue )
                                    {
                                        BinaryFileService binaryFileService = new BinaryFileService( rockContext );
                                        var binaryFile = binaryFileService.Get( orphanedPhotoId.Value );
                                        if ( binaryFile != null )
                                        {
                                            // marked the old images as IsTemporary so they will get cleaned up later
                                            binaryFile.IsTemporary = true;
                                            rockContext.SaveChanges();
                                        }
                                    }

                                    // if they used the ImageEditor, and cropped it, the uncropped file is still in BinaryFile. So clean it up
                                    if ( imgPhoto.CropBinaryFileId.HasValue )
                                    {
                                        if ( imgPhoto.CropBinaryFileId != person.PhotoId )
                                        {
                                            BinaryFileService binaryFileService = new BinaryFileService( rockContext );
                                            var binaryFile = binaryFileService.Get( imgPhoto.CropBinaryFileId.Value );
                                            if ( binaryFile != null && binaryFile.IsTemporary )
                                            {
                                                string errorMessage;
                                                if ( binaryFileService.CanDelete( binaryFile, out errorMessage ) )
                                                {
                                                    binaryFileService.Delete( binaryFile );
                                                    rockContext.SaveChanges();
                                                }
                                            }
                                        }
                                    }
                                }
                                person.SaveAttributeValues();

                                // save family information
                                if ( pnlAddress.Visible )
                                {
                                    Guid? familyGroupTypeGuid = Rock.SystemGuid.GroupType.GROUPTYPE_FAMILY.AsGuidOrNull();
                                    if ( familyGroupTypeGuid.HasValue )
                                    {
                                        var familyGroup = new GroupService( rockContext ).Queryable()
                                                        .Where( f => f.GroupType.Guid == familyGroupTypeGuid.Value
                                                            && f.Members.Any( m => m.PersonId == person.Id ) )
                                                        .FirstOrDefault();
                                        if ( familyGroup != null )
                                        {
                                            Guid? addressTypeGuid = GetAttributeValue( "LocationType" ).AsGuidOrNull();
                                            if ( addressTypeGuid.HasValue )
                                            {
                                                var groupLocationService = new GroupLocationService( rockContext );

                                                var dvHomeAddressType = DefinedValueCache.Read( addressTypeGuid.Value );
                                                var familyAddress = groupLocationService.Queryable().Where( l => l.GroupId == familyGroup.Id && l.GroupLocationTypeValueId == dvHomeAddressType.Id ).FirstOrDefault();
                                                if ( familyAddress != null && string.IsNullOrWhiteSpace( acAddress.Street1 ) )
                                                {
                                                    // delete the current address
                                                    History.EvaluateChange( changes, familyAddress.GroupLocationTypeValue.Value + " Location", familyAddress.Location.ToString(), string.Empty );
                                                    groupLocationService.Delete( familyAddress );
                                                    rockContext.SaveChanges();
                                                }
                                                else
                                                {
                                                    if ( !string.IsNullOrWhiteSpace( acAddress.Street1 ) )
                                                    {
                                                        if ( familyAddress == null )
                                                        {
                                                            familyAddress = new GroupLocation();
                                                            groupLocationService.Add( familyAddress );
                                                            familyAddress.GroupLocationTypeValueId = dvHomeAddressType.Id;
                                                            familyAddress.GroupId = familyGroup.Id;
                                                            familyAddress.IsMailingLocation = true;
                                                            familyAddress.IsMappedLocation = true;
                                                        }
                                                        else if ( hfStreet1.Value != string.Empty )
                                                        {
                                                            // user clicked move so create a previous address
                                                            var previousAddress = new GroupLocation();
                                                            groupLocationService.Add( previousAddress );

                                                            var previousAddressValue = DefinedValueCache.Read( Rock.SystemGuid.DefinedValue.GROUP_LOCATION_TYPE_PREVIOUS.AsGuid() );
                                                            if ( previousAddressValue != null )
                                                            {
                                                                previousAddress.GroupLocationTypeValueId = previousAddressValue.Id;
                                                                previousAddress.GroupId = familyGroup.Id;

                                                                Location previousAddressLocation = new Location();
                                                                previousAddressLocation.Street1 = hfStreet1.Value;
                                                                previousAddressLocation.Street2 = hfStreet2.Value;
                                                                previousAddressLocation.City = hfCity.Value;
                                                                previousAddressLocation.State = hfState.Value;
                                                                previousAddressLocation.PostalCode = hfPostalCode.Value;
                                                                previousAddressLocation.Country = hfCountry.Value;

                                                                previousAddress.Location = previousAddressLocation;
                                                            }
                                                        }

                                                        familyAddress.IsMailingLocation = cbIsMailingAddress.Checked;
                                                        familyAddress.IsMappedLocation = cbIsPhysicalAddress.Checked;

                                                        var updatedHomeAddress = new Location();
                                                        acAddress.GetValues( updatedHomeAddress );

                                                        History.EvaluateChange( changes, dvHomeAddressType.Value + " Location", familyAddress.Location != null ? familyAddress.Location.ToString() : string.Empty, updatedHomeAddress.ToString() );

                                                        familyAddress.Location = updatedHomeAddress;
                                                        rockContext.SaveChanges();
                                                    }
                                                }

                                                HistoryService.SaveChanges(
                                                    rockContext,
                                                    typeof( Person ),
                                                    Rock.SystemGuid.Category.HISTORY_PERSON_DEMOGRAPHIC_CHANGES.AsGuid(),
                                                    person.Id,
                                                    changes );
                                            }

                                            familyGroup.LoadAttributes();
                                            Rock.Attribute.Helper.GetEditValues( phFamilyAttributes, familyGroup );
                                            familyGroup.SaveAttributeValues();
                                        }
                                    }
                                }
                            }
                        }
                    } );

                    NavigateToCurrentPage();
                }
            }
        }