public class StoreCard : MyCompany.WarehouseSystem.Forms.mcCardForm { private Store oStore; private DataSet dsStores; ... public StoreCard() { this.oStore = (Store)this.RegisterPrimaryBizObj(new Store()); InitializeComponent(); this.NavControl = this.txtStoreNo; this.dsStores = this.oStore.GetStores(); } ... }Now, on to my question. In the lookup form, I plan to setup the constructor to take a business object as a parameter, like this:
public class StoreLookup : MyCompany.WarehouseSystem.Forms.mcLookupForm { private Store oStore; private DataSet dsStores; ... public StoreLookup(Store store) { oStore = (Store)this.RegisterPrimaryBizObj(store); InitializeComponent(); this.dsStores = this.oStore.GetCurrentDataSet(); } ... }Is this the correct way to register the primary business object in this case: passing the already-instantiated store object to this.RegisterPrimaryBizObj and storing the return value in the form-level oStore variable?
public class StoreLookup : MyCompany.WarehouseSystem.Forms.mcLookupForm { private Store oStore; private DataSet dsStores; ... public StoreLookup(Store store) { oStore = store; this.RegisterPrimaryBizObj(oStore); InitializeComponent(); this.dsStores = this.oStore.GetCurrentDataSet(); } ... }Also, big-picture, do you see any problems with this basic strategy? I'm striving to do things in the "MM.NET way" as much as possible. Am I missing a slicker approach to sharing the business object between forms?