Hello all.
Using VS.Net 2005, Adapter. I'm struggling with a design approach for a simple pick list. In the windows UI it's a typical scenerio: two lists and two buttons between the lists - the "Copy>>" button and the "<<Remove" button. When you click the "Copy>>" button, selected items in the master list on the left are moved to the sub list on the right. When you click the "<<Remove" button, selected records on the sub list are removed.
In this case, I'm using this UI to create catalogues by choosing items from the master product list.
I'm using two EntityCollections: MasterListCollection and CatalogueDetailCollection. The CatalogueDetailCollection is prefetched within the CatalogueEntity.
Using this pick list interface, creating a CatalogueDetailCollection in a new CatalogueEntity is easy enough: just populate the new CatalogueDetailCollection with entities from the MasterListCollection and save the CatalogueEntity.
The problem comes when you use the pick list UI to modify an existing CatalogueDetailCollection. Now, there is a pre-existing number of entities in the CatalogueDetailCollection and the user and can add new records to the collection AND/OR remove existing records.
Now, the coding gets hairy. Theoretically, I should use UoW. but the user can add to and remove from the sub list over and over again. How do you use UoW to handle a situation wherein an existing record was REMOVED from the sub-list and then RE-ADDED back before the CatalogueEntity was saved? Ultimately, the sub-list contains a combination of new records and pre-existing records that the user may have bounced around before the SAVE button is finally clicked.
Sorry to have run on like this, but I don't know how to keep the code design simple on this. My guess is that I'm over-complicating the concept.
Thanks for any insight that you can provide me!
Jeff