public override void DeletePerson(string personId)
        {
            // If person regions exist.
            if (IsPersonInPersonRegion(personId))
            {
                throw new SchemaIntegrityException("Unable to delete. Person exists in a Region");
            }

            // If person persontypes exist.
            if (IsPersonInPersonType(personId))
            {
                throw new SchemaIntegrityException("Unable to delete. Person exists in a PersonType");
            }

            // If person personsite exist.
            if (IsPersonInPersonSite(personId))
            {
                throw new SchemaIntegrityException("Unable to delete. Person exists at a Site");
            }

            using (var transaction = new TransactionScope(_configuration))
            {
                var    ptDS   = new PersonDataStore(transaction);
                Person person = ptDS.FindByKey(personId);
                User   user   = MembershipManager.GetUserByPerson(person);
                System.Web.Security.Membership.DeleteUser(user.Name);
                person.Deleted = true;
                ptDS.Update(person);
                transaction.Commit();
            }
        }
 public override void UpdatePerson(Person person)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var pDS = new PersonDataStore(transaction);
         pDS.Update(person);
         transaction.Commit();
     }
 }