简体   繁体   中英

maintain Database consistency

I have a database table which has a list of professor, from my website users can search and select a professor for a day.

As soon as a student select a professor I don't want that professor to be in the list of professors for other users and if that user doesn't confirm to go with this professor then again he should be displayed in the list.

Here is an example, I have four professors P1, P2,P3 and P4

All users can see all of them

Now a user U1 select P2 so all other users should see P1,P3 and P4

Also, on next page if user U1 doesn't confirm then I have to add that P2 back to the list.

How can I achieve this in asp.net 4.0 with SQL Server 2008

In the Professors table you should have another column "Reserved", for the professor who is selected by a student (even temporarily) the "Reserved" column should be updated with "Y" flag. Only those professors with null or blank "Reserved" value should be selected to be shown in the listbox or whatever container you have selected. If the student lets go of a professor, then the "Reserved" coulmn should be updated with null .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM