JavaScript takes a string of 4 hyphen delimited id's and string of 4 hyphen delimited titles and makes a request for JSON data to my C# web service. Then the C# web service makes a tracker with status "pending" and awaits the user to confirm the tracker before json can be served up on next request.
When the user confirms the tracker there will be a drop down of the 4 titles to choose the most appropriate match. Upon confirmation the title chosen form the drop down will be passed to an ActionResult in the web service that will set the status of the tracker to "live" and add the id associated with the title to the ID column of the tracker.
The way I was doing it was having the JavaScript send in the 4 ids and titles as two separate strings inside the REST request and then adding them in the same format to an one column in the row, then splitting them just before adding them to the drop down list.
Here is an example:
--Data--
ID, TITLE
SDJFJKLS83,Photoshop Digital Photographers Voices Matter
SDJFKS94k4,Adobe Photoshop CS4 Classroom Book
DJFB443B34,Adobe 65014838 Photoshop CS4 Upgrade
SDFHSKBF22,Adobe 65015634 Photoshop CS4
javascript sends to service as:
ids="SDJFJKLS83-SDJFKS94k4-DJFB443B34-SDFHSKBF22";
titles="Photoshop Digital Photographers Voices Matter- Photoshop CS4 Classroom Book-obe 65014838 Photoshop CS4 Upgrade-Adobe 65015634 Photoshop CS4";
url = http://myurl/service/ids/title
Service Creates new Tracker Row in SQL Table
TrackerID:4
Ids: SDJFJKLS83-SDJFKS94k4-DJFB443B34-SDFHSKBF22
Titles: Photoshop Digital Photographers Voices Matter- Photoshop CS4 Classroom Book-obe 65014838 Photoshop CS4 Upgrade-Adobe 65015634 Photoshop
user: randomperson13
total requests: 1
last request: 2009-03-24 20:12:45.310
status: 0
The service then shows a drop down list with all the titles for the user to select one. Tracker is updated to "live" status and the Id's column is cleared and filled with only one ID and same with the titles column.
The service can use the single ID and title the user select to get data from another SQL table.
--
Basically what I want to know is if there is a better way to store the ID's and associated titles instead of delimited in one datarow.
Sorry if this was a really long post :)
Thank You.