I am having a Form where
Table SelectedItems Table AvailableItems
RecordID CheckBoxID CheckBoxID Description
1 1 1 'Tomatoes'
1 2 2 'Potatoes'
1 4 3 'Mangoes'
2 1 4 'Apples'
2 2
- Now I have to edit the SelectedItems
for RecordID 1 - For that purpose I made a CheckBox
list and populate it with
AvaialbeItems - Then I looped and checked the
SelectedItems for RecordID 1 - User selects some new rows from the
available list (along with old ones,
he may deselect some as well)
Now I want to update the selected records, problem being I want to know only new records to insert.
Both Tables are being returned as Business Object Lists<> , How do I compare the lists and extract only changed/new rows ?
Please advice me. I am using webforms on VSS 2005.
When you select record(s), could you update the business object(s) and dirty them? What I mean is create a class variable that will serve as a flag that you can check to see if it was changed or new. The select new rows (or old) I would think fire an event that you can use to modify the selected row’s business object.
Then when you go through your Lists you just need to check the business object flag that yields the status of change/new.