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

Create recurring appointment as individula appointmnet in datababase and should be able to edit series or individual instance

5 Answers 54 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Prava kafle
Top achievements
Rank 1
Prava kafle asked on 28 Jul 2014, 06:39 PM
Hi,
I would like to create a recurring appointment  for rad scheduler, these  master and child appointments should have unique appointment Id in database.
Master and child appointments should be physically present in database table.
I should also be able to edit/delete individual appointment or the series in one shot. Can someone point me to a working sample?

Thanks,
Prava

5 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 31 Jul 2014, 08:11 AM
Hello Prava,

I guess you want to implement this functionality in web service scenario. If so I would suggest using the appointment insert method of your custom provider. Instead of inserting the appointment in  the standard way you have to do the following things:
  • Retrieve the appointment recurrence rule, parse it and find all occurring appointments. This could be achieved using the RecurrenceRule class and its methods as shown in the code snippet
    RecurrenceRule rule = RecurrenceRule.TryParse(appointmentToInsert.RecurrenceRule);
    IEnumerable<DateTime> ocurrences = rule.Occurrences;
     //iterate through the collection and add each of those date time objects as separate appointment record
  • In order to be able to edit and delete the entire series of appointment I would suggest adding an additional column to appointment data table. It should indicate the recurrence series id and once an appointment is edited you will edit only this appointment instance or find all appointments from the current recurrence series and modify all of them. The tricky part is to know on the server whether the user wants to edit only the current occurrence or the entire series. In order to send this information to the server please use this help article.
  • An easy way to determine whether the user want to edit the entire series or the current occurrence only is to use the OnClientAppointmentEditing client-side event as shown here.
  • The last thing in this scenario is to make all appointments part of this series an master appointment in the get appointments method.
    apt.RecurrenceState = RecurrenceState.Master;

Please note that this is custom scenario which is not supported by the RadScheduler control so you might face some unexpected behavior .

Out of the box the RadScheduler handles the recurring appointments in quite different way using the master appointment recurrence rule. Only the master appointment is added as separate record in the data base and its occurrences are generated on the fly.



Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Prava kafle
Top achievements
Rank 1
answered on 31 Jul 2014, 01:35 PM
Hi Boyan,

I am creating individual child appointments with similar logic and rendering them as master appointments. My question here is how do I create exceptions   if a user edits an occurrence or update series from exceptions?

Thanks,
Prava
0
Boyan Dimitrov
Telerik team
answered on 04 Aug 2014, 02:57 PM
Hello,

As I mentioned such scenario is not supported by the RadScheduler control so some of those functionalities might not behave as expected. 

In this case you can think of the following idea:  if user is editing only occurrence of a specific series to set the appointment RecurrenceParentID ( in the appointment update method)  to an appointment id value from this series. This way in your GetAppointments method of the appointment record has  a RecurrenceParentID value to set the appointment RecurrenceState to RecurrenceState.Exception.

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Prava kafle
Top achievements
Rank 1
answered on 07 Aug 2014, 02:33 PM
Hi Boyan,

I did set all appointments to recurrenccestate = Master. At some instances, at clientsite I get appointment id  as appointmentmentID_0.
How can I avoid recurring appointments from suffixes of  '_0'. AppointmentID  of my ticket is 99 but javascript shows 99_0
 var apptID = appt.get_id();
    ---> 99_0

Thanks,
Prava

0
Boyan Dimitrov
Telerik team
answered on 12 Aug 2014, 10:35 AM
Hello,

Indeed that recurring appointments in the RadScheduler control does have id values with suffixes of  '_0'. I am afraid that this built-in functionality for the recurring appointments and could not be changed. A valid approach might to get the number before the suffix "_". 

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Scheduler
Asked by
Prava kafle
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Prava kafle
Top achievements
Rank 1
Share this question
or