|
bonder
User
Location:
Joined on: 23-Sep-2003 05:05:17
Posted: 36 posts
|
Hi Otis!
I have three entities in my system. Actually, I have many entities, but I only want to speak about three of them right now! 
They are Client, Credit, and Debit. For legal reasons I have to have physical separation of credits and debits into separate tables.
Anyway, I need to have the ability to figure the Client Account Balance for any given point in time, like so:
Code: | Client myClient = new ClientEntity(1); DateTime monthEnd = new DateTime(9,30,2003); // Sep 30 2003 decimal balance = myClient.GetAccountBalance(monthEnd);
|
So balance should be equal to all of the credits with a transaction date of 9/30/2003 or earlier, less all debits with a transaction date of 9/30/2003 or earlier.
I think I need to use a TypedList for this. Am I right? I am going to get into the coding right now, but wanted to dash off a question so we could capture your best thinking in permanent form in this forum! 
--Bruce
|
|
|
Otis
LLBLGen Pro Team
Location: The Hague, The Netherlands
Joined on: 17-Aug-2003 18:00:36
Posted: 37644 posts
|
You can use the two class scenario and add the GetAccountBalance() method to the ClientEntity() class. This class is generated once, when you use the Full/Safe configuration (recommended) and is never overwritten.
That GetAccountBalance then indeed can consult a typed list with the columns you need from debit and credit and use a filter to get the rows you need for the client and the month. 
|
|
|
bonder
User
Location:
Joined on: 23-Sep-2003 05:05:17
Posted: 36 posts
|
Otis wrote:
|
You can use the two class scenario and add the GetAccountBalance() method to the ClientEntity() class. This class is generated once, when you use the Full/Safe configuration (recommended) and is never overwritten.
That GetAccountBalance then indeed can consult a typed list with the columns you need from debit and credit and use a filter to get the rows you need for the client and the month. 
|
Cool, so I'm not far off!
--Bruce
|
|
|
|