示例#1
0
        private void Save(bool closeAfterSave)
        {
            if (!ValidateEndDateAndTime())
            {
                return;
            }
            if (!SaveFormData(Controller.EditedAppointmentCopy))
            {
                return;
            }
            if (!Controller.IsConflictResolved())
            {
                CustomizeMessageBoxCaptionEventArgs captionArgs = new CustomizeMessageBoxCaptionEventArgs(SchedulerStringId.Msg_Conflict, Application.ProductName);
                //Control.RaiseCustomizeMessageBoxCaption(captionArgs);
                ShowMessageBox(SchedulerLocalizer.GetString(SchedulerStringId.Msg_Conflict), captionArgs.Caption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (Controller.IsAppointmentChanged() || Controller.IsNewAppointment || IsAppointmentChanged(Controller.EditedAppointmentCopy))
            {
                Controller.ApplyChanges();
            }
            if (closeAfterSave)
            {
                this.supressCancelCore = true;
                DialogResult           = System.Windows.Forms.DialogResult.OK;
            }
        }
示例#2
0
 public static void scheduler_CustomizeMessageBoxCaption(object sender, CustomizeMessageBoxCaptionEventArgs e)
 {
     if (e.CaptionId == DevExpress.XtraScheduler.Localization.SchedulerStringId.Msg_SaveBeforeClose)
     {
         e.Caption = "Appointment modification";
     }
 }
示例#3
0
        private bool CancelCore()
        {
            bool result = true;

            if (DialogResult != System.Windows.Forms.DialogResult.Abort && Controller != null && Controller.IsAppointmentChanged() && !this.supressCancelCore)
            {
                CustomizeMessageBoxCaptionEventArgs captionArgs = new CustomizeMessageBoxCaptionEventArgs(SchedulerStringId.Msg_SaveBeforeClose, Application.ProductName);
                //Control.RaiseCustomizeMessageBoxCaption(captionArgs);
                DialogResult dialogResult = ShowMessageBox(SchedulerLocalizer.GetString(SchedulerStringId.Msg_SaveBeforeClose), captionArgs.Caption, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);

                if (dialogResult == System.Windows.Forms.DialogResult.Cancel)
                {
                    result = false;
                }
                else if (dialogResult == System.Windows.Forms.DialogResult.Yes)
                {
                    Save(true);
                }
            }

            return(result);
        }