Exemple #1
0
 private void Scheduler_EditAppointmentFormShowing(object sender, AppointmentFormEventArgs e)
 {
     if (EventList.CurrentEvent != null)
     {
         using (
             CustomAppointmentForm form = new CustomAppointmentForm(Scheduler, e.Appointment,
                                                                    EventList.CurrentEvent))
         {
             if (form.ShowDialog() == DialogResult.OK)
             {
             }
         }
     }
     e.Handled = true;
 }
Exemple #2
0
        private void schedulerControlMain_EditAppointmentFormShowing(object sender, AppointmentFormEventArgs e)
        {
            int         clientId = 0;
            Appointment appt     = e.Appointment;

            // See if we have an existing appointment
            if (appt.CustomFields["ClientId"] != null)
            {
                clientId = (int)appt.CustomFields["ClientId"];
            }

            // Set the default duration to one hour
            appt.Duration = TimeSpan.FromHours(1);

            // Display the form
            CustomAppointmentForm customForm = new CustomAppointmentForm((SchedulerControl)sender, appt, false)
            {
                ClientId = clientId
            };

            e.DialogResult = customForm.ShowDialog();
            schedulerControlMain.Refresh();
            e.Handled = true;
        }