We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Javascript Scheduler Database

Thread ID:

Created:

Updated:

Platform:

Replies:

131005 Jun 15,2017 08:48 PM Jun 22,2017 08:32 AM JavaScript 5
loading
Tags: ejSchedule
Darren McDaniel
Asked On June 15, 2017 08:48 PM

I really like the tool for the Scheduler... But I have a need for different functionality on the back end...
Right now, when I create a schedule that spans multiple days, by default it creates a single database record... While this may seem counterintuitive, i have a need for 'individual records' in the database for each of those days....
Is there a setting that I can set, that will force a single record/day by default?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On June 16, 2017 05:21 AM

Hi Darren, 
 
Thank you for contacting Syncfusion support. 
 
We request you to conform, whether your requirement is to store the exact number of occurrences of the recurrence appointment in database instead of storing its parent appointment. If we misunderstand your requirement kindly share more information like image/video demo/code example which clearly depicts your requirement to proceed further. 
 
Regards, 
Karthigeyan 


Darren McDaniel
Replied On June 16, 2017 12:34 PM

That is correct... for example.. if I had a recurring event that occurred 87 times... I would like to have 87 records in the database... 

Karthigeyan Krishnamurthi [Syncfusion]
Replied On June 20, 2017 02:44 AM

Hi Darren 
 
Thanks for your update. 
 
We can parse the recurrence rule using explicitly created new generic utility class RecurrenceHelper in the project. To make use of this generic class in your sample, please refer this below KB link and refer it in your sample. 
https://www.syncfusion.com/kb/5390/how-to-parse-the-recurrencerule-in-server-side  (The RecurrenceHelper Class is available in the sample link provided in this KB). Within this utility RecurrenceHelper class, GetRecurrenceDateTimeCollection method is defined which generates the date instances based on the RecurrenceRule and start date of the appointment. Using these auto-generated date collections from this method, we need to manually create the individual appointment instances as mentioned below in the code example, 
 
<Code> 
if (value.Recurrence!=0) // this code block will execute only for recurrence appointment 
{ 
    //Pass the recurrencerule string and the start date of the appointment to this method that will return the dates collection based on the recurrence rule 
    dates = RecurrenceHelper.GetRecurrenceDateTimeCollection(value.RecurrenceRule, Convert.ToDateTime(value.StartTime)).ToList(); 
    // Now, the variable “dates” contains the date collection, with which the appointment instances are needed to be created manually. 
    var diff = endTime - startTime1; 
    for (var i = 0; i < dates.Count; i++) // this loop is used to create the appointment instances for the generated dates 
    { 
        startTime = Convert.ToDateTime(dates[i].AddHours(startTime1.Hour).AddMinutes(startTime1.Minute)); //start time for each occurrences will be calculated 
        endTime = Convert.ToDateTime(startTime.AddHours(diff.Hours).AddMinutes(diff.Minutes)); //end time for each occurrences will be calculated 
 
        MultipleResource appoint = new MultipleResource()// Appointment object creation 
        { 
            Id = value.Id + i, 
            StartTime = startTime, 
            EndTime = endTime, 
            Subject = value.Subject, 
            Recurrence = 0, 
            AllDay = value.AllDay, 
            RecurrenceRule = value.RecurrenceRule 
        }; 
        db.MultipleResources.InsertOnSubmit(appoint); 
    } 
} 
</Code> 
 
We have prepared the sample for your reference which can be download from the below location. 
 
In the above sample, we have stored the recurrence appointment (including its occurrences) as normal appointment (without repeat option) in the database. Initially, we used to store only the parent recurrence appointment (as single appointment) in the database and by using that parent appointment recurrence rule, we have internally processed to create the other occurrence of that recurrence appointment in the Schedule control. It is possible way to achieve your requirement and it is not recommended.  
 
Regards, 
Karthigeyan 


Darren McDaniel
Replied On June 21, 2017 09:03 PM

Hi Darren 
 
Thanks for your update. 
 
We can parse the recurrence rule using explicitly created new generic utility class RecurrenceHelper in the project. To make use of this generic class in your sample, please refer this below KB link and refer it in your sample. 
https://www.syncfusion.com/kb/5390/how-to-parse-the-recurrencerule-in-server-side  (The RecurrenceHelper Class is available in the sample link provided in this KB). Within this utility RecurrenceHelper class, GetRecurrenceDateTimeCollection method is defined which generates the date instances based on the RecurrenceRule and start date of the appointment. Using these auto-generated date collections from this method, we need to manually create the individual appointment instances as mentioned below in the code example, 
 
<Code> 
if (value.Recurrence!=0) // this code block will execute only for recurrence appointment 
{ 
    //Pass the recurrencerule string and the start date of the appointment to this method that will return the dates collection based on the recurrence rule 
    dates = RecurrenceHelper.GetRecurrenceDateTimeCollection(value.RecurrenceRule, Convert.ToDateTime(value.StartTime)).ToList(); 
    // Now, the variable “dates” contains the date collection, with which the appointment instances are needed to be created manually. 
    var diff = endTime - startTime1; 
    for (var i = 0; i < dates.Count; i++) // this loop is used to create the appointment instances for the generated dates 
    { 
        startTime = Convert.ToDateTime(dates[i].AddHours(startTime1.Hour).AddMinutes(startTime1.Minute)); //start time for each occurrences will be calculated 
        endTime = Convert.ToDateTime(startTime.AddHours(diff.Hours).AddMinutes(diff.Minutes)); //end time for each occurrences will be calculated 
 
        MultipleResource appoint = new MultipleResource()// Appointment object creation 
        { 
            Id = value.Id + i, 
            StartTime = startTime, 
            EndTime = endTime, 
            Subject = value.Subject, 
            Recurrence = 0, 
            AllDay = value.AllDay, 
            RecurrenceRule = value.RecurrenceRule 
        }; 
        db.MultipleResources.InsertOnSubmit(appoint); 
    } 
} 
</Code> 
 
We have prepared the sample for your reference which can be download from the below location. 
 
In the above sample, we have stored the recurrence appointment (including its occurrences) as normal appointment (without repeat option) in the database. Initially, we used to store only the parent recurrence appointment (as single appointment) in the database and by using that parent appointment recurrence rule, we have internally processed to create the other occurrence of that recurrence appointment in the Schedule control. It is possible way to achieve your requirement and it is not recommended.  
 
Regards, 
Karthigeyan 


Thank You for the insight....

Yes, understand it's not recommended... but for what I am utilizing it for... it's required... :)


Karthigeyan Krishnamurthi [Syncfusion]
Replied On June 22, 2017 08:32 AM

 
Thanks for your update. 

Kindly try our solution as per your requirement. 
 
Regards, 
Karthigeyan 
  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;