Thanks for your update.
Kindly find the following responses for your queries.
We have prepared the sample for your requirements which can be download from the following location:
Query1: When I delete an additional appointment part of the recurrence series after deleting an individual appointment should I include the date as comma separated such as EXDATE= + date1 + "," + date2?
Whenever the single occurrence of the recurrence appointment is deleted, particular appointment start date is passed to controller function using ajax post. Since dynamic values is stored in date variable it is enough to use as EXDATE= + date.
Query2: How do I differentiate between individual recurrence click vs series recurrence click?
In BeforeAppointmentRemove we can’t differentiate the single occurrence or series appointment click. While deleting the entire series of an appointment there is no need to update the recurrence rule as we are going to remove the appointment from database. Therefore, we request you to follow the above suggestion while deleting the single occurrence of an appointment and you can use your method (deleting the appointment from database with the help of Id) as mentioned in the previous update for deleting the entire series of an appointment. Kindly refer to the following code example used in the above sample.
<Code>
public void DeleteApp(int id, string date)
{
ScheduleData appoint = db.ScheduleDatas.Single(A => A.Id == Convert.ToInt32(id)); // here we are filtering the parent recurrence app
if (!appoint.RecurrenceRule.Contains("EXDATE"))
appoint.RecurrenceRule = appoint.RecurrenceRule + ";EXDATE=" + date; // here we are updating the recurrence rule
else
{ // this loop will excute when we delete the another instance of the recurrence appointment
var recurRule = appoint.RecurrenceRule.Split(';'); // we are splitting the rule here
string splitRule = "";
for (var i = 0; i < recurRule.Count(); i++)
{
if (splitRule != "")
splitRule += ";";
if (recurRule[i].Contains("EXDATE"))
{ // here we are updating the EXDATE
var recurExdate = recurRule[3].Split('=');
var recurAdd = recurExdate[1] + "," + date;
recurRule[3] = recurExdate[0] + "=" + recurAdd;
}
splitRule += recurRule[i]; // here we are forming the recurrence rule with the updated EXDATE
}
appoint.RecurrenceRule = splitRule;
}
db.SubmitChanges(); // updating the data base
}
</Code>
Regards,
Karthigeyan