Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
How to Delete a Occurence from Recurrence Series
posted

Hi I implement Infragestic Webschdular with Custom Data model in my Project Including Recurrence..

Now my user want to Delete one Occurence from Recurrence Series ie(1 Recurrence appointment Delete from whole Recurrence Series)

He want a Dialog Box same as Infragestic Provide (open the Occurence /open the series and want to Delete Occurence)

I found Infragistics Insert one Record in Activity table while Changing Occurence but not able to find how they are implementing it in Webschdule .

Can Infragistics People help me in this.

I am binding Recurrence like this

Please Help.

FetchRecurrences(

FetchRecurrencesContext context)

{

 

Recurrence recurrenceObject = null;

recurrenceObject =

new Recurrence(null);

recurrenceObject.Key =

Convert.ToString(ReservationDTO.RecurrenceId);

recurrenceObject.PeriodMultiple = ReservationDTO.RecurrenceItemDetails.Periodmultiple;

 

string DayOfWeekMaskUtc = Convert.ToString(ReservationDTO.RecurrenceItemDetails.Dayofweekmaskutc);

recurrenceObject.DayOfWeekMaskUtc = (

RecurrenceDayOfWeekMask)Enum.Parse(typeof(RecurrenceDayOfWeekMask), DayOfWeekMaskUtc);

recurrenceObject.MonthOfYear = ReservationDTO.RecurrenceItemDetails.Monthofyear;

recurrenceObject.DayOfMonth = ReservationDTO.RecurrenceItemDetails.Dayofmonth;

recurrenceObject.EndDateUtc =

new SmartDate(ReservationDTO.RecurrenceItemDetails.Enddateutc);

recurrenceObject.EditType = (

RecurrenceEditType)Enum.Parse(typeof(RecurrenceEditType), "2");

 

// recurrenceObject.DayOfWeekMask = (RecurrenceDayOfWeekMask)Enum.Parse(typeof(RecurrenceDayOfWeekMask), DayOfWeekMaskUtc);

 

//recurrenceObject.MaxOccurrences = 10;

 

string Period = ReservationDTO.RecurrenceItemDetails.Period;

 

if (Period == "D")

{

recurrenceObject.Period =

RecurrencePeriod.Daily;

}

 

if (Period == "W")

{

recurrenceObject.Period =

RecurrencePeriod.Weekly;

}

 

if (Period == "M")

{

recurrenceObject.Period =

RecurrencePeriod.Monthly;

}

 

if (Period == "Y")

{

recurrenceObject.Period =

RecurrencePeriod.Yearly;

}

 

//recurrenceObject.EditType = RecurrenceEditType.Occurrence;

((

IList)context.Recurrences).Add(recurrenceObject);

}

Thanks

Yashkant

 

Parents
  • 4960
    Suggested Answer
    posted

    yashkantg said:

    I found Infragistics Insert one Record in Activity table while Changing Occurence but not able to find how they are implementing it in Webschdule .

    The way the non-flattened WebSchedule data model handles it is by inserting an Activity record where:

    • The [StartDateTimeUtc] of the Activity matches the generated StartDateTimeUtc for that Occurrence based on the recurrence pattern, and
    • The [Status] of the Activity is set to Deleted.

    This activity record is called a variance (so the non-flattened WebSchedule data model will also assign it a variance key that is a GUID shared by all variance Activity records of the same recurrence). Its purpose in case of a deletion is basically to remember that there is a "hole" in the recurrence pattern on this [StartDateTimeUtc].

    Later, when producing occurrences on-demand, the [StartDateTimeUtc] of each is compared to the StartDateTimeUtc of the next variance.  If they match, and the variance is marking it as a deletion, then the occurrence is thrown away.

Reply Children
No Data