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")
RecurrencePeriod.Weekly;
if (Period == "M")
RecurrencePeriod.Monthly;
if (Period == "Y")
RecurrencePeriod.Yearly;
//recurrenceObject.EditType = RecurrenceEditType.Occurrence;
((
IList)context.Recurrences).Add(recurrenceObject);
Thanks
Yashkant
Could you please let me know what should be the value to be stored in status field for deleted? can you brief me on that? Looking forward for your reply urgent.
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:
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.