Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I am now developing the scheduler(Grid view, dynamically created labels and buttons) for causal employees in a multi-user environment by using ASP.NET, c# and SQL Server 2008. There are three functions which employees can select and work in the time slot they are available. On each day, there are 6 slots and in each time slot, there is the maximum number of employees who can work. I would like to fetch the data from the sql table and show whether that time slot is available, when the employee chooses one function. I also want other employees who logged in view and access the scheduler at the same time, if possible. After that employee finally submits one week scheduler, I also want other employees see the updated scheduler. Do I need to refresh the page and fetch the data from the database? My application will increase the number of employees in the future tremendously. Please how would I develop my module? Thank you very much for your suggestions and advice.
Posted

1 solution

If one client has to see what an other client has done (I think this is your case), than you really need to refresh the data, but not the whole page. Ajax is a really good approach for that. You can schedule a poll to the server (every 10s for example, if your environment supports it); if some of the data changed than the you can update the screen based on the response. But don't forget to check on serverside on submit, because it can happen that data changed during the schedule time.
You can also add a state in the middle: when a user selects a timesplot, you make an ajax call, and put it in pending state if it is still open; if it is already in pending state or occupied, than you display a "sorry, choose another" message; if the user submits the form, you put the selected slot in occupied state. If the session time is out or the user canceled the operation, you put the slot back in open state. Thus you can handle concurrency quickly.
These techniques are often used in ticket reservation systems.
 
Share this answer
 
v2

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