public override IList <PersonTypeRole> GetPersonTypeRolesByPersonType(PersonType personType)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var ptrDS = new PersonTypeRoleDataStore(transaction);
         return(ptrDS.FindPersonTypeRolesByPersonType(personType.Id));
     }
 }
        public override bool PersonTypeHasRoles(string personTypeId)
        {
            bool personHasRoles = false;

            using (var transaction = new TransactionScope(_configuration))
            {
                var rDS = new PersonTypeRoleDataStore(transaction);
                IList <PersonTypeRole> roles = rDS.FindPersonTypeRolesByPersonType(personTypeId);
                if (roles.Count > 0)
                {
                    personHasRoles = true;
                }
            }
            return(personHasRoles);
        }
        public override bool IsPersonTypeInRole(string personTypeId, string roleId)
        {
            using (var transaction = new TransactionScope(_configuration))
            {
                var ds = new PersonTypeRoleDataStore(transaction);
                IList <PersonTypeRole> peoples = ds.FindPersonTypeRolesByPersonType(personTypeId);
                IEnumerable <int>      exists  = from x in peoples
                                                 where x.Role.Id.Equals(roleId)
                                                 select 1;

                if (exists.Count() > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }