示例#1
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();
        }
示例#2
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();
        }
示例#3
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();
        }
        public static System.Collections.IEnumerable GetAppointments()
        {
            SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();

            return(from apt in db.DBAppointments select apt);
        }
        public static System.Collections.IEnumerable GetResources()
        {
            SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();

            return(from res in db.DBResources select res);
        }