Header with filtered detail records.

Posts   
 
    
bonder
User
Posts: 36
Joined: 23-Sep-2003
# Posted on: 03-Oct-2003 05:09:18   

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! simple_smile

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:


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! simple_smile

--Bruce

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 03-Oct-2003 10:41:33   

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. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
bonder
User
Posts: 36
Joined: 23-Sep-2003
# Posted on: 06-Oct-2003 04:16:53   

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. simple_smile

Cool, so I'm not far off! sunglasses

--Bruce