示例#1
0
        private TestSprocGenerator.Business.SingleTable.Bo.Profile_Account GetProfileAccount(Guid accountID)
        {
            //now that we have a user with that username we need to get the email we do that by getting
            //Account_Profile and then from there getting Profile_Email
            TestSprocGenerator.Business.SingleTable.Bo.Profile_Account foundProfileAccount = null;

            TestSprocGenerator.Business.SingleTable.Bo.Profile_Account profileAccountSearchCriteria =
                new TestSprocGenerator.Business.SingleTable.Bo.Profile_Account(_smoSettings[CONNECTION_STRING_NAME])
            {
                AccountID = accountID
            };

            TestSprocGenerator.Business.SingleTable.Bo.List.Profile_Account profileAccountSearchReturned =
                new TestSprocGenerator.Business.SingleTable.Bo.List.Profile_Account(_smoSettings[CONNECTION_STRING_NAME]);
            profileAccountSearchReturned.FillByCriteriaExact(profileAccountSearchCriteria);

            if (profileAccountSearchReturned != null && profileAccountSearchReturned.Count > 0)
            {
                if (profileAccountSearchReturned.Count == 1)
                {
                    foundProfileAccount = (TestSprocGenerator.Business.SingleTable.Bo.Profile_Account)profileAccountSearchReturned[0];
                }
                else
                {
                    //again there should only be one...if not big problem
                    throw new ApplicationException("There should only be one Profile for this Account, but there is more than one, contact administrator");
                }
            }
            return(foundProfileAccount);
        }
示例#2
0
        private TestSprocGenerator.Business.SingleTable.Bo.Profile_Account GetProfileAccountByProfileID(Guid profileID)
        {
            TestSprocGenerator.Business.SingleTable.Bo.Profile_Account foundProfileAccount = null;

            TestSprocGenerator.Business.SingleTable.Bo.Profile_Account profileAccountSearchCriteria =
                new TestSprocGenerator.Business.SingleTable.Bo.Profile_Account(_smoSettings[CONNECTION_STRING_NAME])
            {
                ProfileID = profileID
            };

            TestSprocGenerator.Business.SingleTable.Bo.List.Profile_Account profileAccountSearchReturned =
                new TestSprocGenerator.Business.SingleTable.Bo.List.Profile_Account(_smoSettings[CONNECTION_STRING_NAME]);
            profileAccountSearchReturned.FillByCriteriaExact(profileAccountSearchCriteria);

            if (profileAccountSearchReturned != null && profileAccountSearchReturned.Count > 0)
            {
                if (profileAccountSearchReturned.Count == 1)
                {
                    foundProfileAccount = (TestSprocGenerator.Business.SingleTable.Bo.Profile_Account)profileAccountSearchReturned[0];
                }
                else
                {
                    //again there should only be one...if not big problem
                    throw new ApplicationException("There should only be one Account for this Profile, but there is more than one, contact administrator");
                }
            }
            return(foundProfileAccount);
        }
示例#3
0
        private TestSprocGenerator.Business.SingleTable.Bo.Account GetAccountByEmailAddress(string email)
        {
            TestSprocGenerator.Business.SingleTable.Bo.Account foundAccount = null;

            TestSprocGenerator.Business.SingleTable.Bo.EmailAddress foundEmailAddress = null;

            TestSprocGenerator.Business.SingleTable.Bo.EmailAddress emailAddressSearchCriteria =
                new TestSprocGenerator.Business.SingleTable.Bo.EmailAddress(_smoSettings[CONNECTION_STRING_NAME])
            {
                EmailAddress_Property = email
            };

            TestSprocGenerator.Business.SingleTable.Bo.List.EmailAddress emailAddressSearchReturned =
                new TestSprocGenerator.Business.SingleTable.Bo.List.EmailAddress(_smoSettings[CONNECTION_STRING_NAME]);

            emailAddressSearchReturned.FillByCriteriaExact(emailAddressSearchCriteria);

            if (emailAddressSearchReturned != null && emailAddressSearchReturned.Count > 0)
            {
                if (emailAddressSearchReturned.Count == 1)
                {
                    foundEmailAddress = (TestSprocGenerator.Business.SingleTable.Bo.EmailAddress)emailAddressSearchReturned[0];

                    TestSprocGenerator.Business.SingleTable.Bo.Profile_EmailAddress foundProfileEmail =
                        GetProfileEmailByEmailID(foundEmailAddress.EmailAddressID);

                    if (foundProfileEmail != null)
                    {
                        TestSprocGenerator.Business.SingleTable.Bo.Profile_Account foundProfileAccount =
                            GetProfileAccountByProfileID(foundProfileEmail.ProfileID);

                        if (foundProfileAccount != null)
                        {
                            foundAccount = GetAccountAccountByAccountID(foundProfileAccount.AccountID);
                            if (foundAccount == null)
                            {
                                throw new ApplicationException("Account not found");
                            }
                        }
                        else
                        {
                            throw new ApplicationException("Profile_Account not found");
                        }
                    }
                    else
                    {
                        throw new ApplicationException("Profile_Email  record not found");
                    }
                }
                else
                {
                    throw new ApplicationException("There should only be one Profile for this Account, but there is more than one, contact administrator");
                }
            }

            return(foundAccount);
        }
示例#4
0
        private TestSprocGenerator.Business.SingleTable.Bo.EmailAddress GetEmailByUsername(string username, out TestSprocGenerator.Business.SingleTable.Bo.Account accountByUsernameFound)
        {
            accountByUsernameFound =
                GetAccountByUsername(username);

            TestSprocGenerator.Business.SingleTable.Bo.Profile_Account profileAccountFound =
                GetProfileAccount(accountByUsernameFound.AccountID);

            TestSprocGenerator.Business.SingleTable.Bo.Profile_EmailAddress profileEmailAddressFound =
                GetProfileEmail(profileAccountFound.ProfileID);

            TestSprocGenerator.Business.SingleTable.Bo.EmailAddress emailAddressFound =
                GetEmailAddress(profileEmailAddressFound.EmailAddressID);

            return(emailAddressFound);
        }