Example #1
0
        public void DeleteCashAccountTransaction(CashAccountTransaction cashAccountTransaction)
        {
            string errMsg = $"Delete failed, a cash transaction with id '{cashAccountTransaction.Id}' could not be found!";

            CashAccountTransaction found =
                ((List <CashAccountTransaction>)CashAccountTransactions).Find(p => p.Id == cashAccountTransaction.Id)
                ?? throw new InvalidOperationException(errMsg);

            _cashAccountTransactions.Remove(found);
        }
Example #2
0
        public void UpdateCashAccountTransaction(CashAccountTransaction cashAccountTransaction)
        {
            string errMsg = $"Update failed, a cash transaction with id '{cashAccountTransaction.Id}' could not be found!";

            CashAccountTransaction found =
                ((List <CashAccountTransaction>)CashAccountTransactions).Find(p => p.Id == cashAccountTransaction.Id)
                ?? throw new InvalidOperationException(errMsg);

            found.UpdateCashTransactionType(cashAccountTransaction.CashTransactionType);
            found.UpdateCashAcctTransactionDate(cashAccountTransaction.CashAcctTransactionDate);
            found.UpdateCashAcctTransactionAmount(cashAccountTransaction.CashAcctTransactionAmount);
            found.UpdateExternalAgentId(cashAccountTransaction.AgentId);
            found.UpdateEconomicEventId(cashAccountTransaction.EventId);
            found.UpdateCheckNumber(cashAccountTransaction.CheckNumber);
            found.UpdateRemittanceAdvice(cashAccountTransaction.RemittanceAdvice);
            found.UpdateUserId(cashAccountTransaction.UserId);
        }
Example #3
0
 public void AddCashAccountTransaction(CashAccountTransaction cashAccountTransaction)
 {
     //TODO check for duplicate loan payment
     //TODO Check that cashAccountTransaction.CashAccountId = this.Id
     _cashAccountTransactions.Add(cashAccountTransaction);
 }