public void TransferMoneyToIdeaRealAccountAfterSuccesfullCollecting(IUnitOfWork unitOfWork, BankAccount CSOwnerBankAccount, BankAccount ideaBankAccount, decimal sumBeingTransferred, InnerMoneyAccount ideaInnerMoneyAccount) { // УЧЕСТЬ ПРОЦЕНТЫ! paymentSystem.ProcessPayment(unitOfWork, CSOwnerBankAccount, ideaBankAccount, sumBeingTransferred); ideaInnerMoneyAccount.SumTransferredToRealBankAccount = true; }
public void RollbackPaymentWhileInCollectingMoneyState(IUnitOfWork unitOfWork, BankAccount CSOwnerBankAccount, BankAccount userBankAccount, decimal sumBeingTransferred, InnerMoneyAccount ideaInnerMoneyAccount) { // УЧЕСТЬ ПРОЦЕНТЫ! paymentSystem.ProcessPayment(unitOfWork, userBankAccount, CSOwnerBankAccount, sumBeingTransferred); ideaInnerMoneyAccount.SumAvailable -= sumBeingTransferred; }
public void ReturnMoneyToContributors(IUnitOfWork unitOfWork, BankAccount senderBankAccount, IEnumerable <BankAccount> receiversBankAccounts, InnerMoneyAccount ideaInnerMoneyAccount, Idea idea) { // УЧЕСТЬ ПРОЦЕНТЫ! foreach (var receiverBankAccount in receiversBankAccounts) { var sumBeingTransferred = unitOfWork.MoneyTransferRepository.Get(mt => (mt.IdeaId == idea.Id && mt.SenderAccountId == receiverBankAccount.Id)).FirstOrDefault().TransferredSum; paymentSystem.ProcessPayment(unitOfWork, senderBankAccount, receiverBankAccount, sumBeingTransferred); } ideaInnerMoneyAccount.SumAvailable = 0; }