I have a system where I would like to show a warning to a user if there try and edit a record that is currently been edited. If this is the case the user will not be able to save the record but only view it.
I have an idea of using some kind of class to monitor the activity of records been edited etc but this seams a little over kill. My other concern is that what if the browser crashes or there shut their computer down on how this will effect the state of the page.
Another thought was to use last updated time stamp but this also looks a no go because the way records are been updated.
Has anyone got any thoughts or resources on how I could implement something like this. No code is necessary.
based on the comments I have added these additional details.
database is SQL server 2008
asp.net 3.5
one record could be many parts of the database for instance, the booking table session table and a row in the interrupter table.
the user will look at a list of sessions that need booking select a booking and fill out a booking form to make the booking. Want to stop is someone else trying to do the same booking at the same time or while someone else is doing the booking.
Esentially I maintain an
Edit(lookup) table in the SQL database comprising 4 fieldsUserID, Action, EntityID and Datestampand link that to each associated page and editable item.So, for example if the user is on the edit Foo webpage and clicks the
editlink, the program will perform a lookup of theEdittable and if nobody else is editing a record does an insert, i.e:4, 'Edit Foo', 123, GETUTCDATE()where 123 is the ID of theFoobeing edited.There are many further functions to the process, for example, if a user is in edit mode for a length of time the record automatically removed from the table and the item becomes editable again.
However, the solution works very well for us in a high use environment. I hope you get the idea.