Hi Everyone
Please note that I have a list for managing overtime that contains the following columns
- Employee Number
- Employee Name
- Date
- Time from
- Time To
- Total
I need that when a user create new item for any employee number to check if this new item intersect with other records for the same employee number and give message that this item intersect with other items for the same employee number
example:
suppose that I have the below saved records
Employee Number | Employee Name | Date | Time From | Time To | Total |
100 | Rami | 20-10-20 | 18:00 | 22:00 | 4 |
and the user try to create the below item
Employee Number | Employee Name | Date | Time From | Time To | Total |
100 | Rami | 20-10-20 | 21:00 | 22:00 | 1 |
so, I need to prevent the user to add this record and show him/her message that this record intersect for another records as the new record is for the same employee in the same date and the new time is from 21:00 to 22:00 while he has another item in the same date from 18:00 to 22:00.
otherwise, if their is NO intersection the item should be accepted
e.g if the user try to create the below item this should be accepted
Employee Number | Employee Name | Date | Time From | Time To | Total |
100 | Rami | 20-10-20 | 14:00 | 16:00 | 2 |