Parent-Child-GrandChild BO's using CodeSmith 2.6 and C# templates

Parent-Child-GrandChild BO's using CodeSmith 2.6 and C# templates

Old forum URL: forums.lhotka.net/forums/t/1568.aspx


Sarosh posted on Monday, October 23, 2006

Hi!

I am new to CSLA 2.1 and trying to build my first WinForm Application so please be patient with me as some of the things I mention/ask maybe trivial to many of you here.

I would really appreciate if someone can help/guide me with my problem as I am not sure what the right/preferred way is to approach this issue.

I have WinForm with a Parent-Child-GrandChild relationship all use a DataGridView to Add/Edit/Delete rows.

e.g.

Customer (Parent)

Orders (Child)

OrderDetail (GrandChild)

To handle the Customer (Parent) in a DataGridView I have created two BO's

Customer from the EditableChild Template with the following Properties

ObjectName:Customer

ParentName:-

ChildCollectionNames:-

ChildPropertyNames:-

CustomerList from the EditableRootList Template with the following Properties

ChildName:Customer

ObjectName:CustomerList

The CustomerDataGridView.DataSource = CustomerBindingSource and the CustomerBindingSource.DataSource = CustomerList

The above seems to be ok and I can Add/Edit/Delete rows in the Grid.

How do I proceed in creating the Child/GrandChild Bo's

Should the Order and OrderList BO's be setup like the Customer and CustomerList and how should I relate the Customer to the Order or OrderList what about the OrderDetail and the OrderDetailList and how should I relate these as well. And finally how to tie up all these BO's in the WinForm.

I know this is a really long post but If someone can help me out I will really be greatful.

Thanks.

Sarosh

Copyright (c) Marimer LLC