You should do like this...
Create your Table with include this columns (Selected Seats,Selected Flag,Booked Flag
When a user select a seat(s) and then click a button, then update Selected Seats and Selected Flag columns
For ex: Selected Seats -->1,2,3 Selected Flag --> True
When ever user click a button at the time check it out the table Selected Seats are there and Flag also True (or) not.
For ex: Other user select a seat -->2. if the seat is available in Selected Seats column means just shown a message through that user else insert into the table based on the Route.No,Time and (Bus)Type.
If user cancel a ticket before booking, set a particular time in your table Booked Flag column is not fill means just open a ticket again.
If the ticket booked means just true (or) fill the Booked Flag column in your table.
Use optimistic Concurrency operation..Refer this link..http://msdn.microsoft.com/en-us/library/aa0416cz.aspx
Try this way.... I hope its useful to you...
Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator