Use the same BO twice on the same form


Author
Message
Juan Carlos Pazos
Juan Carlos Pazos
StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)StrataFrame User (310 reputation)
Group: Forum Members
Posts: 144, Visits: 227
Hi

I have a BIGHehe problem. Hope you can help and point me in the right direction.

I need to create a form to manage products Inventory (common thing), but I need that a product can contain another products so this products is a package.

I have to tables, one for products with the usual fields (ProductID -primary-, Description, Price) and another Packages that has (PackageID -primary-, ProductID1 related to the ProductID of the products table-, ProductID2 that store the product for the package and quantity.

The idea is that is I create two products, the I create a another product that is a package, this will have the two products created first. I can sell the product alone or the package with the two products.

A ListView (similar two the old SampleCRMApplication in the OrderEntry form) is used to manage the products of the package, but I found I need two ProductsBO in the form, one for the product itself and another for fill the ListView.

As my database has some sample records, I test this, and "works" I can create and update products alone, and if the product is a package I can show the products that are part of the package.

Is this approach correct? I  don't want to create the logic to load products to the package (same way as SampleCRMApplication OrderEntry) and then found that this was not correct.

Thanks for your advice.

Smile Everything is possible, just keep trying...

Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

Dropping a BO onto a form multiple times is no problems but I think (never tried it) you can have one BO that has multiple BBS associated with it.

I would imagine the first problem to solve is how you handle logically transforming product A and B into product C and handling inventory when these products are sold/returned.

Cheers, Peter

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Yeah, I didn't totally follow what you are trying to do...but rest assured that you can have as many BO instances of the same BO class as you would like.  So this won't be an issue at all.  If you are going to have more than one ListView populated on the same form with the same BO type, that is fine.  In this case I would recommend loading all of the data into the BOs then use the CopyDataFrom methods on the BOs versus allowing each list to perform its own query (this would just be form performance reasons only).  In this case, I would use the BusinessLayer.FillMultipleDataTables method to call a single sproc (or query) and populate all of the instances then call the requeries on the ListViews manually.  This will improve performance.

For an example of this, load the StrataFlix sample...it has a lot of good stuff there and shows how to do this.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search