This is making my head hurt (on top of all the support calls and other projects I'm working on my brain feels like it's about to explode).
I tried adding in a call to calculate the BalanceOutstanding in the place where you suggested, but nothing is happening. The code never even gets hit.
Just in case it helps you, let me see if I can state my problem a bit clearer. I have a screen for entering amounts received to build up a bank deposit slip.
The user enters the Deposit Total Amount that they have manually added up in one textbox, then they enter each item received in a grid. Each time a Receipt Value is changed in the grid I need to re-calculate the Total Receipts Amount and display it in a textbox. I also need to calculate the Balance Outstanding whenever that total changes and whenever the Deposit Total Amount is changed. The Balance Outstanding is the Deposit Total Amount - Total Receipts Amount.
So I'll have two functions:
CalculateReceiptTotal
which will use this code:
this.DepositTotal = this.CashReceipt.EntityList.Sum(x => x.crt_Amount);
and CalculateBalanceOutstanding
which will use this code:
this.BalanceOutstanding = (decimal)this.Deposit.Entity.dep_amount - this.DepositTotal;
Whenever the this.Deposit.Entity.dep_amount changes, I want to call CalculateBalanceOutstanding
Whenever a value of the crt_Amount property of any entitty in my Cashreceipt.EntityList changes I want to call CalculateReceiptTotal and CalculateBalanceOutstanding.