Example #1
0
        static void UpdateAppointment()
        {
            CarScheduling insertedAppt = SchedulerExtension.GetAppointmentToInsert <CarScheduling>(
                SchedulerHelper.Settings,
                SchedulerDataHelper.GetAppointments(),
                SchedulerDataHelper.GetResources()
                );

            SchedulerDataHelper.InsertAppointment(insertedAppt);

            CarScheduling[] updatedAppt = SchedulerExtension.GetAppointmentsToUpdate <CarScheduling>(
                SchedulerHelper.Settings,
                SchedulerDataHelper.GetAppointments(),
                SchedulerDataHelper.GetResources()
                );
            foreach (var appt in updatedAppt)
            {
                SchedulerDataHelper.UpdateAppointment(appt);
            }

            CarScheduling[] removedAppt = SchedulerExtension.GetAppointmentsToRemove <CarScheduling>(
                SchedulerHelper.Settings,
                SchedulerDataHelper.GetAppointments(),
                SchedulerDataHelper.GetResources()
                );
            foreach (var appt in removedAppt)
            {
                SchedulerDataHelper.RemoveAppointment(appt);
            }
        }
    public static void UpdateAppointment(CarScheduling appt)
    {
        if (appt == null)
        {
            return;
        }
        CarsDataContext db    = new CarsDataContext();
        CarScheduling   query = (CarScheduling)(from carSchedule in db.CarSchedulings where carSchedule.ID == appt.ID select carSchedule).SingleOrDefault();

        query.ID             = appt.ID;
        query.StartTime      = appt.StartTime;
        query.EndTime        = appt.EndTime;
        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.EventType      = appt.EventType;
        query.Label          = appt.Label;
        query.CarId          = appt.CarId;
        query.ContactInfo    = appt.ContactInfo;
        query.Price          = appt.Price;
        db.SubmitChanges();
    }
        public static CarScheduling CreateCarScheduling(int ID, bool allDay)
        {
            CarScheduling carScheduling = new CarScheduling();

            carScheduling.ID     = ID;
            carScheduling.AllDay = allDay;
            return(carScheduling);
        }
Example #4
0
 public EditableSchedule(CarScheduling carScheduling)
     : base(carScheduling)
 {
     Subject     = carScheduling.Subject;
     Description = carScheduling.Description;
     StartTime   = carScheduling.StartTime;
     EndTime     = carScheduling.EndTime;
 }
    public static void RemoveAppointment(CarScheduling appt)
    {
        CarsDataContext db    = new CarsDataContext();
        CarScheduling   query = (CarScheduling)(from carSchedule in db.CarSchedulings where carSchedule.ID == appt.ID select carSchedule).SingleOrDefault();

        db.CarSchedulings.DeleteOnSubmit(query);
        db.SubmitChanges();
    }
    protected void AppointmentDataSource_Inserted(object sender, LinqDataSourceStatusEventArgs e)
    {
        CarScheduling apt = e.Result as CarScheduling;

        if (apt == null)
        {
            return;
        }
        this.lastInsertedAppointmentId = apt.ID;
    }
        public void AppointmentUpdating(CarScheduling appointment)
        {
            if (appointment.EventType == (int)AppointmentType.Occurrence)
            {
                ProcessOccurranceChange = true;
            }

            if (appointment.EventType == (int)AppointmentType.Pattern)
            {
                RecurrenceRule = appointment.RecurrenceRule;
            }
        }
    public static void InsertAppointment(CarScheduling appt)
    {
        if (appt == null)
        {
            return;
        }
        CarsDataContext db = new CarsDataContext();

        appt.ID = appt.GetHashCode();
        db.CarSchedulings.InsertOnSubmit(appt);
        db.SubmitChanges();
    }
Example #9
0
 public ValidationSchedule(CarScheduling carScheduling)
     : base(carScheduling)
 {
     if (carScheduling != null)
     {
         Subject     = carScheduling.Subject;
         Price       = carScheduling.Price;
         StartTime   = carScheduling.StartTime.Value;
         EndTime     = carScheduling.EndTime.Value;
         Description = carScheduling.Description;
         ContactInfo = carScheduling.ContactInfo;
     }
 }
Example #10
0
 public ScheduleBase(CarScheduling carScheduling)
 {
     if (carScheduling != null)
     {
         ID             = carScheduling.ID;
         EventType      = carScheduling.EventType;
         Label          = carScheduling.Label;
         AllDay         = carScheduling.AllDay;
         Location       = carScheduling.Location;
         CarId          = carScheduling.CarId;
         Status         = carScheduling.Status;
         RecurrenceInfo = carScheduling.RecurrenceInfo;
         ReminderInfo   = carScheduling.ReminderInfo;
     }
 }
        public void SaveChanges(CarScheduling appointment)
        {
            if (appointment != null && ProcessOccurranceChange)
            {
                if (appointment.EventType == (int)AppointmentType.ChangedOccurrence)
                {
                    db.Add(appointment);
                }
                ProcessOccurranceChange = false;
            }

            if (appointment.EventType == (int)AppointmentType.Pattern && appointment.RecurrenceRule != RecurrenceRule)
            {
                RemoveOccurrances(appointment.PatternId);
                RecurrenceRule = string.Empty;
            }

            db.SaveChanges();
            Refresh();
        }
 public Schedule(CarScheduling carScheduling)
 {
     if (carScheduling != null)
     {
         ID             = carScheduling.ID;
         EventType      = carScheduling.EventType;
         Label          = carScheduling.Label;
         AllDay         = carScheduling.AllDay;
         Location       = carScheduling.Location;
         CarId          = carScheduling.CarId;
         Status         = carScheduling.Status;
         RecurrenceInfo = carScheduling.RecurrenceInfo;
         ReminderInfo   = carScheduling.ReminderInfo;
         Subject        = carScheduling.Subject;
         Price          = carScheduling.Price;
         StartTime      = carScheduling.StartTime.Value;
         EndTime        = carScheduling.EndTime.Value;
         Description    = carScheduling.Description;
         ContactInfo    = carScheduling.ContactInfo;
     }
 }
Example #13
0
        void UpdateAppointment()
        {
            CarScheduling insertedAppt = SchedulerExtension.GetAppointmentToInsert <CarScheduling>("scheduler", SchedulerDataHelper.GetAppointments(),
                                                                                                   SchedulerDataHelper.GetResources(), SchedulerDataHelper.DefaultAppointmentStorage, SchedulerDataHelper.DefaultResourceStorage);

            SchedulerDataHelper.InsertAppointment(insertedAppt);

            ViewData["EditableSchedule"] = insertedAppt;

            CarScheduling[] updatedAppt = SchedulerExtension.GetAppointmentsToUpdate <CarScheduling>("scheduler", SchedulerDataHelper.GetAppointments(),
                                                                                                     SchedulerDataHelper.GetResources(), SchedulerDataHelper.DefaultAppointmentStorage, SchedulerDataHelper.DefaultResourceStorage);
            foreach (var appt in updatedAppt)
            {
                SchedulerDataHelper.UpdateAppointment(appt);
            }

            CarScheduling[] removedAppt = SchedulerExtension.GetAppointmentsToRemove <CarScheduling>("scheduler", SchedulerDataHelper.GetAppointments(),
                                                                                                     SchedulerDataHelper.GetResources(), SchedulerDataHelper.DefaultAppointmentStorage, SchedulerDataHelper.DefaultResourceStorage);
            foreach (var appt in removedAppt)
            {
                SchedulerDataHelper.RemoveAppointment(appt);
            }
        }
Example #14
0
 partial void UpdateCarScheduling(CarScheduling instance);
 public void AddToCarSchedulings(CarScheduling carScheduling)
 {
     base.AddObject("CarSchedulings", carScheduling);
 }
 public void AppointmentAdded(CarScheduling appointment)
 {
     db.Add(appointment);
     db.SaveChanges();
     Refresh();
 }
Example #17
0
 partial void InsertCarScheduling(CarScheduling instance);
Example #18
0
 partial void DeleteCarScheduling(CarScheduling instance);