StrataFrame Forum

Two Business oblect on a Single Form

http://forum.strataframe.net/Topic26086.aspx

By Vikas Gupta - 2/17/2010

i m using ThemedLinkMenu ,PanelManager,CustomerBusinessObject n CompanyBusinessObject on a  Form.

PaneManager Hav Two pages Page1 nPage2.

Page1 Hav MaintenanceFormToolStrip and show.Save.Edit n Delete Customers using CustomerBusinessObject.

Page2 also Hav MaintenanceFormToolStrip and show.Save.Edit n Delete Company using CompanyBusinessObject.

but when i create a new Company it automatic generate new CustomerId in Customers Table.

i set PrimaryBusinessObject property of Form None.

but problem is still

please solve this issue

By Bill Cunnien - 2/18/2010

Good morning,



The MaintenanceFormToolstrip manages the PrimaryBusinessObject of the form. A second MaintenanceFormToolstrip will manage the same business object. You will need to wire up your own themedtoolstrip/themedlinkmenu in order for you to handle a second business object. It is not that hard. Check out Les Pinter's article for some additional support (http://www.lespinter.com/FoxToNet/ShowArticle.aspx?ArtNum=410).



Have a great day!

Bill
By Edhy Rijo - 2/18/2010

Vikas Gupta (02/18/2010)
...I set PrimaryBusinessObject property of Form None. but problem is still




I Vikas,



If you want to go this route, then in the PanelManager.PageActivated event set the Form.PrimaryBusinessObject to the corresponding BO. Something like this may work, I have not tested Hehe





Private Sub PanelManager1_PageActivated(ByVal e As MicroFour.StrataFrame.UI.Windows.Forms.PanelPageEventArgs) Handles PanelManager1.PageActivated

Select Case Me.PanelManager1.CurrentPage.Name

Case Is = PageCustomers.Name

Me.PrimaryBusinessObject = Me.CustomersBO1



Case Is = PageOrders.Name

Me.PrimaryBusinessObject = Me.OrdersBO1



Case Is = PageOrderItems.Name

Me.PrimaryBusinessObject = Me.OrderItemsBO1

End Select

End Sub