i have few work stored in my database and few users. i need to distribute data like first finshed and got second unassigned work auto.
like i have a 100 report in database to work on it. and i have a 5 staff .
first, they login and got one work at a time. when one staff finish there work then he got second work which is not assign by any other users.
Naimish MakwanaPosted Mar 11, 2023, 6:30 AM
Hello Ajay,
To distribute the work among the staff in a way that the first finished work is assigned to the next available staff, you can implement a simple algorithm in your .NET application that tracks the status of the work and the assigned staff.
Here's one way you can implement this algorithm:
Create a table in your database to store the reports and their status. The table should have columns for the report ID, report name, report status (assigned, in progress, completed), and assigned staff ID (nullable).
When a staff member logs in, your application should query the database for the next unassigned report. You can do this by selecting a report with the status "unassigned" and no assigned staff ID.
Assign the selected report to the logged-in staff member by updating the assigned staff ID column in the database.
When the staff member completes the assigned work, update the report status to "completed" in the database.
Query the database again for the next unassigned report and assign it to the next available staff member who is not already working on a report.
Repeat steps 4 and 5 until all the reports are completed.
This algorithm ensures that the first finished work is always assigned to the next available staff member, and that no two staff members are working on the same report at the same time.
Thanks
ajay chauhanPosted Mar 11, 2023, 3:11 PM
Thanks for this.
Can i ask you one more question.
I have an issue with a login functionality. after login browser back button take again on login page and same on logout function. i google for this all related topics told about javascript to disable browser back button. but i think this is not a proper way to do this. if possible share some details or some sample project to learn about this. i am creating a website myself for learning.
Thanks in advance