protected void OnBtnOkClick(object sender, EventArgs e)
    {
        Appointment apt = (String.IsNullOrEmpty(appointmentId.Value)) ? Scheduler.Storage.CreateAppointment(AppointmentType.Normal) : Scheduler.LookupAppointmentByIdString(appointmentId.Value);
        AppointmentFormController formController = new AppointmentFormController(Scheduler, apt);

        if (formController == null)
        {
            return;
        }
        AssignControllerValues(formController);
        formController.ApplyChanges();
        RaiseFormClosed();
    }
 protected internal virtual void OnSaveButton()
 {
     DoValidation();
     if (!controller.IsConflictResolved())
     {
         ShowMessageBox(SchedulerLocalizer.GetString(SchedulerStringId.Msg_Conflict), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return;
     }
     if (!this.SaveFormData(this.sourceAppointment))
     {
         return;
     }
     controller.ApplyChanges();
     UpdateDeleteButton();
 }
Beispiel #3
0
        void btnOK_Click(object sender, System.EventArgs e)
        {
            ValidationArgs args = new ValidationArgs();

            currentRecurrenceControl.ValidateValues(args);
            if (args.Valid)
            {
                args = new ValidationArgs();
                currentRecurrenceControl.CheckForWarnings(args);
                if (!args.Valid)
                {
                    DialogResult answer = MessageBox.Show(this, args.ErrorMessage,
                                                          Application.ProductName, MessageBoxButtons.OKCancel,
                                                          MessageBoxIcon.Question);
                    if (answer == DialogResult.OK)
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        if (args.Control != null)
                        {
                            ((Control)args.Control).Focus();
                        }
                    }
                }
                else
                {
                    // Apply changes to the appointment recurrence pattern.
                    controller.ApplyRecurrence(patternCopy);
                }
                // Apply changes to the original appointment.
                controller.ApplyChanges();
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show(this, args.ErrorMessage, Application.ProductName,
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                if (args.Control != null)
                {
                    ((Control)args.Control).Focus();
                }
            }
        }