complex aggregates and typedlists

Posts   
 
    
jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 28-Dec-2006 16:52:21   

llbl 2.0.0.61127 adapter .net 2.0 sqlserver 2000

my DB structur is as follows: customer -> order -> order line item -> line item commission <- broker

This represents a customer having many orders. Orders have many line items, line items having many commission (1 per broker) and commissions relating to a single broker. If this doesn't seem quite right it took me a while to understand as well.

Essentially an order can have multiple brokers because a broker relates to a customer/item pair. a customer/item pair can have many brokers. All brokers get a commission when an order for that customer/item pair. Messy... I know... but that's the model.

So I need to display some aggrated data to the user to select orders for commission payment. I can generate 2 seperate TypedLists 1 for the order/borker/commission amount [ListA] (unique by order/broker) and a TypedList of order/total [ListB] (unique by order).

is there a way to merge the ListB into ListA to return 1 result set? I'm thinking along the lines of Frans post [http://weblogs.asp.net/fbouma/archive/2006/06/09/llblgen-pro-v2.0-with-asp.net-2.0.aspx] Step 6. extending the entity.

Could i use some sort of scalar sub select total joined on the order number within an aggregated TypedList?

Sample Results: Order Order Total Broker Commission 001 $100.00 B1 $5.00 002 $150.00 B2 $6.50 002 $150.00 B3 $4.00

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 28-Dec-2006 20:42:22   

I figured it out! steps: * add private datacolumn members * add field definations in buildresultset * add column definations in initclass * add column definations in initmembers * create internal datacolumn properties * create typelist row properties to publicaly access the valuesbetween the cleanliness and comments within the code it gets easier to minipulate the code every day. I am also quickly learning that all my assumptions of stored procs vs dynamic sql are not just that... assumptions. And we all know what happens when you make an assumption... simple_smile