Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a Project in which user send a request to change data and insert data which is to be changed. It will go to admin for approval. If admin approve that request , it will change to main database and if not it should not change. Problem is, i have lot of fields in my database. Suppose user sends a request to change 5 fields in database and sends data to be changed, it all depends upon admin he might accept only one or two or all.
how can i manage this? Really stuck in it
Posted
Comments
Prasad Khandekar 21-May-13 3:09am    
One simple way that worked for me is to store the changed data in a serialized (JSON) form in some table say undo_table. Then in approval page use the original record along with this serialized data and ask administrator to select the fields he is interested in approving via (checkbox). Upon submit only update the checked fields.
Sunil Dhanerwal1 21-May-13 3:13am    
Thanks for your quick reply prasad. This is what i was thinking but i am confused about the thing how i come to know at tun time which fields user has demanded to change?
one more thing, Do i need to make table (undo_table) with same fields as in original table?
Any help will be appreciated. if possible plz suggest any link or aexample
Sunasara Imdadhusen 21-May-13 3:23am    
Have you tried anything before?
Sunil Dhanerwal1 21-May-13 3:25am    
never faced this type of query. I think i might add bool value for each changed field demanded by user but looks like that too lengthy and might not work.
Mahesh Bailwal 21-May-13 3:41am    
Instead using bool value for each changed field you can also think about using Nullable Types, where changed field will have value and other fields will have NULL value.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900