Esempio n. 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);
        }
Esempio n. 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);
        }