Hi all, been so long since I last came here
I'm facing a strange thing here, I know it has to do with caching and I'm almost sure I'm doing something wrong.
I'm creating a simple bookkeeping application where a user enters a set of accounts in a grid with a value adjacent to each account. The system then iterates through all the rows in the grid (or the bound entity collection) and updates the account balance; which is equal to the old balance + the new value.
What's happening is, if the user enters the same account in more than one row, only the value in the second instance is updated correctly.
Here's the code:
Dim uow As New UnitOfWork
Dim gc As New GeneralLedgerCollection
gc.GetMulti(GeneralLedgerFields.StrGeneralLedgerId = Me.CurrentEntity.StrGeneralLedgerId)
For Each detail As GeneralLedgerEntity In gc
'Update account balances
Dim ae As New AccountEntity(detail.StrAccountId)
ae.DecTotalCredit += detail.DecDebit
ae.DecTotalDebit += detail.DecCredit
uow.AddForSave(ae)
Next
What's going on here?
Version: 2.6 Final
Released On: June 6th, 2008
Thank you all in advance.