public static void InsertAppointment(EFAppointment appt) { if (appt == null) { return; } SchedulerContext db = SchedulerSettingsHelper.LocalContext; db.EfAppointments.Local.Add(appt); db.SaveChanges(); }
public static void RemoveAppointment(EFAppointment appt) { if (appt == null) { return; } SchedulerContext db = SchedulerSettingsHelper.LocalContext; EFAppointment query = (EFAppointment)(from carSchedule in db.EfAppointments.Local where carSchedule.UniqueID == appt.UniqueID select carSchedule).SingleOrDefault(); db.EfAppointments.Remove(query); db.SaveChanges(); }
public static void UpdateAppointment(EFAppointment appt) { if (appt == null) { return; } SchedulerContext db = SchedulerSettingsHelper.LocalContext; EFAppointment query = (EFAppointment)(from carSchedule in db.EfAppointments.Local where carSchedule.UniqueID == appt.UniqueID select carSchedule).SingleOrDefault(); query.UniqueID = appt.UniqueID; query.StartDate = appt.StartDate; query.EndDate = appt.EndDate; query.AllDay = appt.AllDay; query.Subject = appt.Subject; query.Description = appt.Description; query.Location = appt.Location; query.RecurrenceInfo = appt.RecurrenceInfo; query.ReminderInfo = appt.ReminderInfo; query.Status = appt.Status; query.Type = appt.Type; query.Label = appt.Label; query.ResourceIDs = appt.ResourceIDs; db.SaveChanges(); }