DeleteKnownRelationship() public method

Deletes the known relationship.
public DeleteKnownRelationship ( int personId, int relatedPersonId, int relationshipRoleId ) : void
personId int The person identifier.
relatedPersonId int The related person identifier.
relationshipRoleId int The relationship role identifier.
return void
Ejemplo n.º 1
0
        public void DeleteKnownRelationship( int personId, int relatedPersonId, int relationshipRoleId )
        {
            SetProxyCreation( true );
            var rockContext = this.Service.Context as RockContext;
            var personService = new PersonService( rockContext );
            var person = personService.Get( personId );
            var relatedPerson = personService.Get( relatedPersonId );

            CheckCanEdit( person );
            CheckCanEdit( relatedPerson );

            System.Web.HttpContext.Current.Items.Add( "CurrentPerson", GetPerson() );

            var groupMemberService = new GroupMemberService( rockContext );
            groupMemberService.DeleteKnownRelationship( personId, relatedPersonId, relationshipRoleId );
        }