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 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)); }
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); } }
private bool doesUsernameExist(string username) { if (_databaseSettings != null) { TestSprocGenerator.Business.SingleTable.Bo.List.Account accounts = new TestSprocGenerator.Business.SingleTable.Bo.List.Account(_databaseSettings); TestSprocGenerator.Business.SingleTable.Bo.Account bo = new TestSprocGenerator.Business.SingleTable.Bo.Account(_databaseSettings); bo.AccountUsername = username; accounts.FillByCriteriaExact(bo); if (accounts.Count > 0) { return(true); } return(false); } else { throw new ApplicationException("Connection String was not Provided in Configuration File"); } }
private void FillByGetPermutation(CommonLibrary.Enumerations.GetPermutations getPermutation, TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { if (this.BaseDataAccessAvailable()) { this.Clear(); TestSprocGenerator.Data.SingleTable.Dto.Account dto = ((TestSprocGenerator.Data.SingleTable.Dto.Account)(filledBo)); List <TestSprocGenerator.Data.SingleTable.Dto.Account> returnDto = _baseDataAccess.Get(dto, getPermutation); int control = returnDto.Count; if ((control > 0)) { int counter; for (counter = 0; (counter < control); counter = (counter + 1)) { TestSprocGenerator.Business.SingleTable.Bo.Account boToFill = new TestSprocGenerator.Business.SingleTable.Bo.Account(_databaseSmoObjectsAndSettings); _baseBusiness.FillThisWithDto(returnDto[counter], boToFill); this.Add(boToFill); } } } else { throw new System.ApplicationException(FILL_DB_SETTINGS_EXCEPTION); } }
public TestSprocGenerator.Business.SingleTable.Bo.Account[] AccountRetrieveByCriteria(TestSprocGenerator.Business.SingleTable.Bo.Account accountModel) { return(base.Channel.AccountRetrieveByCriteria(accountModel)); }
public bool AccountUpdate(TestSprocGenerator.Business.SingleTable.Bo.Account accountModel) { return(base.Channel.AccountUpdate(accountModel)); }
public bool AccountDeleteByCriteria(TestSprocGenerator.Business.SingleTable.Bo.Account accountModel) { return(base.Channel.AccountDeleteByCriteria(accountModel)); }
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) { return(base.Channel.Register(accountInfo, personInfo, addressInfo, phoneNumberInfo, emailAddressInfo, profileType)); }
public virtual void FillByGetAll(TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { CommonLibrary.Enumerations.GetPermutations getPermutation = CommonLibrary.Enumerations.GetPermutations.AllByColumnMappings; this.FillByGetPermutation(getPermutation, filledBo); }
public virtual void FillByCriteriaExact(TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { CommonLibrary.Enumerations.GetPermutations getPermutation = CommonLibrary.Enumerations.GetPermutations.ByExplicitCriteria; this.FillByGetPermutation(getPermutation, filledBo); }
public virtual void FillByPrimaryKey(TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { CommonLibrary.Enumerations.GetPermutations getPermutation = CommonLibrary.Enumerations.GetPermutations.ByPrimaryKey; this.FillByGetPermutation(getPermutation, filledBo); }
private void FillPropertiesFromBo(TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { _baseBusiness.FillPropertiesFromBo(filledBo, this); }
public Account(CommonLibrary.DatabaseSmoObjectsAndSettings databaseSmoObjectsAndSettings, TestSprocGenerator.Business.SingleTable.Bo.Account filledBo) { _databaseSmoObjectsAndSettings = databaseSmoObjectsAndSettings; _baseDataAccess = new CommonLibrary.Base.Database.BaseDataAccess <TestSprocGenerator.Data.SingleTable.Dto.Account>(_databaseSmoObjectsAndSettings); _baseBusiness = new CommonLibrary.Base.Business.BaseBusiness <TestSprocGenerator.Business.SingleTable.Bo.Account, TestSprocGenerator.Data.SingleTable.Dto.Account>(_databaseSmoObjectsAndSettings); this.FillPropertiesFromBo(filledBo); }