Esempio n. 1
0
        public bool IsParentProfile(TestSprocGenerator.Business.SingleTable.Bo.Account account, out TestSprocGenerator.Data.SingleTable.Dto.Profile profile)
        {
            RegistrationDataAccess registrationDataAccess = new RegistrationDataAccess();

            TestSprocGenerator.Data.SingleTable.Dto.Profile_Account profile_account = null;

            profile = registrationDataAccess.GetProfile(account.AccountID, out profile_account);

            TestSprocGenerator.Business.SingleTable.Bo.ProfileType profileTypeCriteria =
                new TestSprocGenerator.Business.SingleTable.Bo.ProfileType()
            {
                ProfileTypeID = profile.ProfileTypeID
            };

            TestSprocGenerator.Business.SingleTable.Bo.List.ProfileType search =
                new TestSprocGenerator.Business.SingleTable.Bo.List.ProfileType(_smoSettings[CONNECTION_STRING_NAME]);
            search.FillByCriteriaExact(profileTypeCriteria);

            if (search != null && search.Count > 0)
            {
                if (search[0].ProfileName.Contains("Parent"))
                {
                    return(true);
                }
            }

            return(false);
        }
        public List <TestSprocGenerator.Business.SingleTable.Bo.ProfileType> RetrieveProfileTypesForInternetUsers()
        {
            //make sure to not include Administrator!!!

            TestSprocGenerator.Business.SingleTable.Bo.List.ProfileType searchProfileType =
                new TestSprocGenerator.Business.SingleTable.Bo.List.ProfileType(_smoSettings[CONNECTION_STRING_NAME]);

            searchProfileType.FillByGetAll(new ProfileType(_smoSettings[CONNECTION_STRING_NAME]));

            if (searchProfileType != null && searchProfileType.Count > 0)
            {
                ProfileType profileTypeToRemove = null;

                foreach (ProfileType profileType in searchProfileType)
                {
                    if (profileType.ProfileName.ToLower().Contains("admin"))
                    {
                        profileTypeToRemove = profileType;
                    }
                }

                searchProfileType.Remove(profileTypeToRemove);
            }
            else
            {
                throw new ApplicationException("Error retrieving Profile Types for Registration");
            }

            List <ProfileType> returnList = searchProfileType.ConvertAll(new Converter <TestSprocGenerator.Data.SingleTable.Dto.ProfileType,
                                                                                        TestSprocGenerator.Business.SingleTable.Bo.ProfileType>(ProfileTypeFromDtoToBo));

            return(returnList);
        }