This is a migrated thread and some comments may be shown as answers.

How to detect potential overlap on recurring events.

1 Answer 280 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Olivier Cotasson
Top achievements
Rank 1
Olivier Cotasson asked on 19 Mar 2010, 03:15 PM
Hi All,

I am using the Scheduler to plan appointments.
Some Appointments are set by administrator as "no man's land" (for example every Wednesday evening is "off") , so that is you cannot insert any appointment on this given 'slot'.
A problem arises with recurring "no man's land" events.

The potential overlap is detected correctly with the first occurence of the recurring event, but I can't manage to detect the following events.

In other words, on the first wednesday the "collision" is found, not on the subsequent ones.

Any ideas how to do that ?

Thank you.

Below is the method i tried to use (and which is faulty) :
    Protected Function isOnHSArea2(ByVal apt As Appointment) As Boolean 
 
        Dim allAppointments As IList(Of Appointment) = RadScheduler1.Appointments.GetAppointmentsInRange(apt.Start, apt.End) 
        For Each currentAppointment In allAppointments 
            If currentAppointment.ID <> apt.ID Then
 
                If (Convert.ToBoolean(currentAppointment.Attributes("isHS"))) Then 'isHS : off Duty
                    Return True 
                End If 
 
            End If 
        Next 
 
        Return False 
        'Return (appointmentsCount > (AppointmentsLimit - 1)) 
    End Function 

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 23 Mar 2010, 10:53 AM
Hello Olivier,


This is expected, because in your code you only check for the master appointment. To handle recurring appointments and to ensure that occurrences do not conflict, you need to parse the recurrence rule and check each occurrence individually if it creates conflicts with other appointments. Here are a kb article and a help topic on enumerating occurrences:

http://www.telerik.com/help/aspnet-ajax/schedule_serversideworkingwithrecurringappointments.html

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-display-all-radscheduler-appointments-in-gridview.aspx



Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Olivier Cotasson
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or