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

6 posts, 0 answers
  1. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 28 Jul 2014 Link to this post

    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
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 31 Jul 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 31 Jul 2014 in reply to Boyan Dimitrov Link to this post

    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
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 04 Aug 2014 Link to this post

    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.

     
  6. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 07 Aug 2014 in reply to Boyan Dimitrov Link to this post

    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

  7. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 12 Aug 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017