Exemplo n.º 1
0
        public bool Register(TestSprocGenerator.Business.SingleTable.Bo.Account accountInfo,
                             TestSprocGenerator.Business.SingleTable.Bo.Person personInfo,
                             TestSprocGenerator.Business.SingleTable.Bo.Address addressInfo,
                             TestSprocGenerator.Business.SingleTable.Bo.PhoneNumber phoneNumberInfo,
                             TestSprocGenerator.Business.SingleTable.Bo.EmailAddress emailAddressInfo,
                             TestSprocGenerator.Business.SingleTable.Bo.ProfileType profileType)
        {
            RegistrationDataAccess registrationDataAccess =
                new RegistrationDataAccess();

            AccountBusinessLayer.AccountManager accountManager = new AccountBusinessLayer.AccountManager();


            bool exists = accountManager.DoesUserNameExist(accountInfo.AccountUsername);

            if (exists)
            {
                throw new ArgumentException("AccountUsername is in Use, Please pick another username");
            }

            return(registrationDataAccess.Register((TestSprocGenerator.Data.SingleTable.Dto.Account)accountInfo,
                                                   (TestSprocGenerator.Data.SingleTable.Dto.Person)personInfo,
                                                   (TestSprocGenerator.Data.SingleTable.Dto.Address)addressInfo,
                                                   (TestSprocGenerator.Data.SingleTable.Dto.PhoneNumber)phoneNumberInfo,
                                                   (TestSprocGenerator.Data.SingleTable.Dto.EmailAddress)emailAddressInfo,
                                                   (TestSprocGenerator.Data.SingleTable.Dto.ProfileType)profileType));
        }
Exemplo n.º 2
0
        public bool DeleteRegistration(string username, out bool didItExist)
        {
            bool successful = false;

            RegistrationDataAccess registrationDataAccess = new RegistrationDataAccess();

            AccountBusinessLayer.AccountManager accountManager         = new AccountBusinessLayer.AccountManager();
            TestSprocGenerator.Business.SingleTable.Bo.Account account = null;

            didItExist = accountManager.DoesUserNameExist(username, out account);

            if (didItExist)
            {
                TestSprocGenerator.Data.SingleTable.Dto.Profile profile = null;
                bool isParentProfile = IsParentProfile(account, out profile);


                return(registrationDataAccess.DeleteRegistration(account, profile, isParentProfile, CommonLibrary.Base.Database.BaseDatabase.TransactionBehavior.Begin));
            }
            else
            {
                return(successful);
            }
        }