Ejemplo n.º 1
0
 private void FreezeInternalFocus(object sender, ShowDialogEventArgs args)
 {
     if (!args.Cancel)
     {
         _internalFreezeFocused = true;
     }
 }
Ejemplo n.º 2
0
 private void classSchedule_ShowDialog(object sender, ShowDialogEventArgs e)
 {
     if (e.DialogViewModel is AppointmentDialogViewModel)
     {
         e.Cancel = true;
     }
 }
Ejemplo n.º 3
0
 private void RadScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e)
 {
     if (e.DialogViewModel is AppointmentDialogViewModel && _cancelAppointmentEditing)
     {
         e.Cancel = true;
         _cancelAppointmentEditing = false; // Set true after editing Calencar Note to prevent showing Edit Appointment window
     }
 }
        public void RaiseDialogRequested(ShowDialogEventArgs e)
        {
            var handler = DialogRequest;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Ejemplo n.º 5
0
        private void AssociatedObject_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            var viewModel = (e.DialogViewModel as AppointmentDialogViewModel);

            if (viewModel != null)
            {
                e.Cancel = true;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Create and display a dialog of a given type, setting owner</summary>
        /// <typeparam name="T">Dialog type</typeparam>
        /// <param name="owner">Dialog owner</param>
        /// <param name="e">ShowDialogEventArgs specifying dialog view model</param>
        public static void CreateAndShowChildDialog <T>(this Window owner, ShowDialogEventArgs e)
            where T : Window
        {
            Requires.NotNull(e, "e");

            T dlg = Activator.CreateInstance <T>();

            dlg.DataContext = e.ViewModel;
            dlg.Owner       = owner;
            e.DialogResult  = dlg.ShowDialog();
        }
Ejemplo n.º 7
0
 private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
 {
     var viewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
     if (viewModel != null)
     {
         if (viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Dragging || viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Resizing)
         {
             var scheduleView = sender as RadScheduleView;
             destinationSlot = scheduleView.HighlightedSlots[0] as Slot;
         }
     }
 }
Ejemplo n.º 8
0
        private void AssociatedObject_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            var viewModel = (e.DialogViewModel as AppointmentDialogViewModel);

            if (viewModel != null && viewModel.ViewMode == AppointmentViewMode.Edit)
            {
                e.Cancel = !AllowEditing;
                if (DoubleClickAppointmentCommand != null && DoubleClickAppointmentCommand.CanExecute(viewModel.Occurrence.Appointment))
                {
                    DoubleClickAppointmentCommand.Execute(viewModel.Occurrence.Appointment);
                }
            }
        }
Ejemplo n.º 9
0
        private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            var viewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel;

            if (viewModel != null)
            {
                if (viewModel.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Dragging)
                {
                    var scheduleView = sender as RadScheduleView;
                    destinationSlot = scheduleView.HighlightedSlots[0] as Slot;
                }
            }
        }
        private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            if (e.DialogViewModel is AppointmentDialogViewModel)
            {
                e.Cancel = true;
                if (Properties.Settings.Default.Role != "Support Staff" && Properties.Settings.Default.Role != "Employee")
                {
                    if (scheduleView.SelectedSlot != null)
                    {
                        Slot selectedSlot = scheduleView.SelectedSlot;
                        UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedSlot, this);
                        addSchd.ShowDialog();
                    }

                    else if (scheduleView.SelectedAppointment != null)
                    {
                        IOccurrence sel = scheduleView.SelectedAppointment;
                        Appointment selectedAppt = sel as Appointment;
                        UserControl_AddSchedule addSchd = new UserControl_AddSchedule(selectedAppt, this);
                        addSchd.ShowDialog();
                    }
                }
            }

            if (e.DialogViewModel is ConfirmDialogViewModel)
            {
                e.DefaultDialogResult = false;
                e.Cancel = true;
            }

            var dialogViewModel = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
            if (dialogViewModel != null)
            {
                dialogViewModel.IsSeriesModeSelected = true;
            }
        }
Ejemplo n.º 11
0
        public IEnumerable<IResult> SchedulerShowDialog(object sender, ShowDialogEventArgs e)
        {
            IAppointment showApp = null;
            // Stops double locking attempts, this method can be fired twice depending on type of appointment
            bool isLockRequired = (this.SchedulerEditingId.IsNull() ? Guid.Empty : this.SchedulerEditingId) == Guid.Empty;
            this.schedulerDialogViewModelHandle = e.DialogViewModel;
            if (this.schedulerDialogViewModelHandle is RecurrenceChoiceDialogViewModel) {
                RecurrenceChoiceDialogViewModel svm = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
                showApp = (AppAppointment)svm.Occurrence.Master;
                if (!((AppAppointment)showApp).IsReadOnly) {
                    SchedulerEditingId = Guid.Parse(((AppAppointment)svm.Occurrence.Master).UniqueId.ToString());
                }
            }

            if (e.DialogViewModel is AppointmentDialogViewModel) {
                AppointmentDialogViewModel avm = e.DialogViewModel as AppointmentDialogViewModel;
                showApp = (AppAppointment)avm.Occurrence.Master;
                if (!((AppAppointment)showApp).IsReadOnly) {
                    if (!((AppAppointment)showApp).IsNew) if (((AppAppointment)showApp).OriginalMasterId.IsNotNull()) {
                        SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).OriginalMasterId.ToString());
                    }else {
                        SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).UniqueId.ToString());
                    }
                    else
                        SchedulerEditingId = Guid.Empty;
                }
            }

            if (e.DialogViewModel is ConfirmDialogViewModel) {
                var record = e.DialogViewModel as ConfirmDialogViewModel;
                showApp = (AppAppointment)record.Appointments.Select(x => x).FirstOrDefault();
                if (showApp != null) {
                    if (((AppAppointment)showApp).IsReadOnly) {
                        e.DefaultDialogResult = true;
                        e.Cancel = true;
                    }else {
                        SchedulerEditingId = Guid.Parse(((AppAppointment)showApp).UniqueId.ToString());
                    }
                }
            }

            if (this.SchedulerEditingId != Guid.Empty && isLockRequired) {
                this.SchedulerIsBusy = true;
                GetLockRequest lockAppointment = new GetLockRequest(ModelNamesEnum.Appointment, SchedulerEditingId.ToString());
                yield return lockAppointment;
                if (lockAppointment.Error != null) {
                    yield return new HandleExceptionResult(lockAppointment.Error);
                    ((AppAppointment)showApp).IsReadOnly = true;
                    this.SchedulerIsBusy = false;
                    this.SchedulerEditingId = Guid.Empty;
                    yield break;
                }
                if (!lockAppointment.Result) {
                    ((AppAppointment)showApp).IsReadOnly = true;
                    GetUserRequest getUserRequest = new GetUserRequest(lockAppointment.UserId);
                    yield return getUserRequest;
                    this.SchedulerIsBusy = false;
                    LastSchedulerMessage = AppLib.GetLockMessage(getUserRequest.Result);
                    var lockedDialog = UILib.DialogOk(LastSchedulerMessage, "Record In Use", "../Resources/Images/Locked.png");
                    yield return lockedDialog;
                    this.SchedulerEditingId = Guid.Empty;
                    yield break;
                }
                this.SchedulerIsBusy = false;
            }
            yield break;
        }
        private void OnShowDialog(object sender, ShowDialogEventArgs e)
        {
            var additionalData = new ParentsInfo { Parents = this.ViewModel.Parents };

            e.DialogViewModel.AdditionalData = additionalData;
        }
Ejemplo n.º 13
0
 private void FreezeInternalFocus( object sender, ShowDialogEventArgs args )
 {
     if ( !args.Cancel )
     {
         _internalFreezeFocused = true;
     }
 }
Ejemplo n.º 14
0
 private void ScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e)
 {
     e.Cancel = true;
 }
Ejemplo n.º 15
0
 /// <summary>
 ///     付款计划日程控件弹出子窗体句柄
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void PaymentScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e)
 {
     var schedule = sender as RadScheduleView;
     if (schedule == null)
     {
         return;
     }
     if (e.DialogViewModel is AppointmentDialogViewModel)
     {
         var viewModel = e.DialogViewModel as AppointmentDialogViewModel;
         if (viewModel.ViewMode == AppointmentViewMode.Edit)
         {
             var appointment = schedule.EditedAppointment as PaymentAppointment;
             if (appointment != null)
             {
                 appointment.EditRecurrenceDialog = false;
             }
             return;
         }
     }
     if (e.DialogViewModel is RecurrenceDialogViewModel)
     {
         var viewModel = e.DialogViewModel as RecurrenceDialogViewModel;
         viewModel.RecurrenceRangeType = RecurrenceRangeType.RepeatUntil;
     }
 }
Ejemplo n.º 16
0
 private void RadScheduleView_OnShowDialog(object sender, ShowDialogEventArgs e)
 {
     if (e.DialogViewModel is AppointmentDialogViewModel && _cancelAppointmentEditing)
     {
         e.Cancel = true;
         _cancelAppointmentEditing = false; // Set true after editing Calencar Note to prevent showing Edit Appointment window
     }
 }