コード例 #1
0
        public static void InsertAppointment(EFAppointment appt)
        {
            if (appt == null)
            {
                return;
            }
            SchedulerContext db = SchedulerSettingsHelper.LocalContext;

            db.EFAppointments.Local.Add(appt);
            db.SaveChanges();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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();
        }