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

[Solved] collision detection and security

1 Answer 171 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Gompje
Top achievements
Rank 1
Gompje asked on 19 Dec 2007, 12:55 PM
Hi all,

I'm trying to see if I can use the planner for a project. But I cannot see how I can achieve the following:
  • The user may not edit or change existing appointments, but is allowed to create new ones and change them.
  • No double booking is allowed. eg no appointment on an already booked timeslot (collision)
For the first thing I found some threads on this forum, but it's not clear when  this will be included.

tx!

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 Dec 2007, 03:11 PM
Hello Gompje,

Regarding the first requirement, the neatest solution would be the following:

1. Set AllowDelete="False"  and AllowEdit="False" for RadScheduler.
2. Use custom attributes to keep track of the user who created the appointment:

<telerik:RadScheduler ID="RadScheduler1" runat="server" CustomAttributeNames="CreatedBy" .../> 

 protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)  
    {  
        e.Appointment.Attributes["CreatedBy"] = "currentUser";   
    } 

3. In the AppointmentCreated event check if the appointment was created by the current user and if yes, set the AllowEdit property to true:
protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)  
    {  
        if (e.Appointment.Attributes["CreatedBy"] == "currentUser")  
        {  
            e.Appointment.AllowEdit = true;  
        }  
    } 

As for the second question, please, refer to Limiting the number of simultaneous appointments online example.

Regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Gompje
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or