Hi Chris,
Thank you for contacting Syncfusion support.
We suspect that CRUD code examples may not be included correctly which could be the cause for the issue, we have prepared the CRUD sample which can be download from the below location.
<Code>
public JsonResult Batch(EditParams param)
{
if (param.action == "insert" || (param.action == "batch" && param.added != null)) // this block of code will execute while inserting the appointments
{
var value = param.action == "insert" ? param.value : param.added[0];
int intMax = db.ScheduleDatas.ToList().Count > 0 ? db.ScheduleDatas.ToList().Max(p => p.Id) : 1;
DateTime startTime = Convert.ToDateTime(value.StartTime);
DateTime endTime = Convert.ToDateTime(value.EndTime);
var currentTimeZone = TimeZone.CurrentTimeZone;
ScheduleData appoint = new ScheduleData()
{
Id = intMax + 1,
StartTime = startTime,
EndTime = endTime,
Subject = value.Subject,
Recurrence = value.Recurrence,
AllDay = value.AllDay,
RecurrenceRule = value.RecurrenceRule,
};
db.ScheduleDatas.InsertOnSubmit(appoint);
db.SubmitChanges();
}
if (param.action == "remove" || param.deleted != null) // this block of code will execute while removing the appointment
{
if (param.action == "remove")
{
int key = Convert.ToInt32(param.key);
ScheduleData app = db.ScheduleDatas.Where(c => c.Id == key).FirstOrDefault();
if (app != null) db.ScheduleDatas.DeleteOnSubmit(app);
}
else
{
foreach (var apps in param.deleted)
{
ScheduleData app = db.ScheduleDatas.Where(c => c.Id == apps.Id).FirstOrDefault();
if (apps != null) db.ScheduleDatas.DeleteOnSubmit(app);
}
}
db.SubmitChanges();
}
if ((param.action == "batch" && param.changed != null) || param.action == "update") // this block of code will execute while updating the appointment
{
var value = param.action == "update" ? param.value : param.changed[0];
var filterData = db.ScheduleDatas.Where(c => c.Id == Convert.ToInt32(value.Id));
if (filterData.Count() > 0)
{
DateTime startTime = Convert.ToDateTime(value.StartTime);
DateTime endTime = Convert.ToDateTime(value.EndTime);
ScheduleData appoint = db.ScheduleDatas.Single(A => A.Id == Convert.ToInt32(value.Id));
appoint.StartTime = startTime;
appoint.EndTime = endTime;
appoint.Subject = value.Subject;
appoint.Recurrence = value.Recurrence;
appoint.AllDay = value.AllDay;
appoint.RecurrenceRule = value.RecurrenceRule;
}
db.SubmitChanges();
}
IEnumerable data = new DataClasses1DataContext().ScheduleDatas.Take(500); // nw.Appointment.Take(5);
return Json(data, JsonRequestBehavior.AllowGet);
}
</Code>
Regards,
Karthigeyan