views:

19

answers:

1

Say I have this entity with a lot of attributes. In the input form I have decided to implement a wizard control so I can collect information about this entity in several steps. The problem is that I need to collect information that has been modeled has many to many relationships.

I am planning to use a telerik gridview to manage this (add/edit/delete), the problem is where do I store that data since the entity in a insert form is not created on the database yet. OK so I can store all that info in temporary lists residing in the viewstate, waiting for the final submit where I dump all that in the DB, but one of the steps I am collecting files...now storing files in the viewstate is out of the question, same as as storing them in the session...

I have been thinking of implementing in a way that the user has to submit some info first (say first 3 steps), commit the data to the database creating the parent entity and then start inserting all the childs entities...but this will get weird as it's confusing since on the first steps you not saving the data to the DB and on the next ones you are commiting directly...

Anyone has any thoughts on this?

Thanks

+1  A: 

Consider creating a "holding" table in your database where you can store your wizards data, rather than storing it in ViewState. The table could have a column for the user's SessionID, so you can know what records belong to what users. Once the users has completed the wizard steps, you can retrieve all of the data and commit it to the final table(s).

You may also want to create a job that regularly cleans your "holding" table by removing records that are more than n hours old, so you don't accumulate orphaned records.

Tod1d
That is acceptable, but that will make me manage heaps of redundant tables...not sure i want to go there...
Luis