I understand that classes like CustomerViewModel sit on the client side and are invoked for things like retrieving customers to display in a grid or a single customer to display in a form.
When I save a customer record, I would like to recalculate his balance just to ensure that it is up to date. To do this I will loop through the customers charges and payments and get a balance. I don't want to bring any records down to the client to do this, I would like to do this on the server. So I am thinking that I will have a CalculateBalance method on the server side that will do the above and update the balance in the customer table in the database.
How will this method get invoked?
I am assuming my view class will call a routine in the ViewModel and then the ViewModel will pass the call to the server.