public List <AccountDomainEntity> GetListByOwner(IAccountOwner accountOwner) { int ownerType = accountOwner.OwnerType.ToInt(); return(GetListBy( a => a.OwnerId == accountOwner.OwnerId && a.OwnerType == ownerType)); }
public bool HasOwnerAccountByType(IAccountOwner accountOwner, AccountTypeDomainEntity accountType) { int ownerType = accountOwner.OwnerType.ToInt(); return(Exists( a => a.OwnerId == accountOwner.OwnerId && a.OwnerType == ownerType && a.AccountTypeId == accountType.AccountTypeId)); }
public AccountDomainEntity With( AccountTypeDomainEntity accountType, IAccountOwner accountOwner, string accountNumber) { AccountType = accountType ?? throw new CommonException.RequiredParameterMissingException(nameof(accountType)); AccountOwner = accountOwner ?? throw new CommonException.RequiredParameterMissingException(nameof(accountType)); AccountNumber = string.IsNullOrWhiteSpace(accountNumber) ? throw new CommonException.RequiredParameterMissingException(nameof(accountNumber)) : accountNumber; accountRepository.InsertEntity(this); return(this); }
private IAccountOwner GetAccountOwner(Account account) { IAccountOwner accountOwner = null; if (account.OwnerType == AccountOwnerType.Person.ToInt()) { accountOwner = coreContext.Query <IPersonRepository>().GetById(account.OwnerId) as IAccountOwner; } else if (account.OwnerType == AccountOwnerType.Company.ToInt()) { accountOwner = coreContext.Query <ICompanyRepository>().GetById(account.OwnerId) as IAccountOwner; } return(accountOwner); }
protected override bool NeedUpdateFunc(IAccountOwner updatedSubject) { return(CounterpartyUoW.Root.Id == updatedSubject.Counterparty.Id); }
public void CreateAccount(IAccountOwner owner, AccountType type) { owner.AddAccount(AccountFactory.CreateAccount(type)); }
internal AccountDomainEntity CreateAccount(AccountTypeDomainEntity accountType, IAccountOwner accountOwner, string accountNumber) { var account = coreContext.New <AccountDomainEntity>() .With(accountType, accountOwner, accountNumber); account.Insert(); return(account); }