This example illustrates the use of FreeTimeCalculator class to find all available free intervals within the specified period of time. Also, it can be used to find the nearest free slot with the specified duration.
When the FindFreeTimeInterval method finds an interval that does not intersect with existing appointments, the IntervalFound event occurs. We handle this event to exclude intervals which fall into restricted areas, such as non-working hours or holidays.
This application finds a free slot with specified duration within the work time before the end of the current work week. The non-working time is defined in code as an interval from 6 PM current day to 8 AM next day.The project uses SQL Server so the corresponding detached database files - XtraScheduling.mdf and XtraScheduling_log.ldf are included. You should attach the databases to the MS SQL server and change a connection string in the app.config file before running the project.
Question Comments
Added By: J S 16 at: 10/15/2014 12:28:22 AM
Hi,
I'm trying to implement this example but vs2013 (.net 4.5) throws an error that the name 'slotDuration' does not exist in the current context.
Regards,
Jan
Hello,
I tried to reproduce this behavior, but without success. In the attachment, you will find a sample video which demonstrates how it works on my side.
Would you please clarify whether you make changes in the example code?
Thanks for your reply.
Solved it...missing namespace
Added By: Andrey (DevExpress Support) at: 10/15/2014 7:45:40 AM You are welcome.