Exemple #1
0
    public static void RemoveAppointment(DBAppointment appt)
    {
        SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();
        DBAppointment query = (DBAppointment)(from carSchedule in db.DBAppointments where carSchedule.UniqueID == appt.UniqueID select carSchedule).SingleOrDefault();

        db.DBAppointments.DeleteOnSubmit(query);
        db.SubmitChanges();
    }
Exemple #2
0
    public static void InsertAppointment(DBAppointment appt)
    {
        if (appt == null)
        {
            return;
        }
        SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();

        appt.UniqueID = appt.GetHashCode();
        db.DBAppointments.InsertOnSubmit(appt);
        db.SubmitChanges();
    }
Exemple #3
0
    public static void UpdateAppointment(DBAppointment appt)
    {
        if (appt == null)
        {
            return;
        }
        SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();
        DBAppointment query = (DBAppointment)(from carSchedule in db.DBAppointments 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.ResourceID     = appt.ResourceID;
        db.SubmitChanges();
    }