private void AppointmentViewAppointmentDeleting(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { var deletingAppointment = (DevExpress.XtraScheduler.Appointment)e.Object; if (deletingAppointment.Id == null) { return; } if (deletingAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Pattern) { _isDeletingPattern = true; } Guid id = (Guid)deletingAppointment.Id; foreach (var appointment in _appointments) { if (appointment.AppointmentId == id) { if (_isDeletingPattern) { _deletedAppointments.Add(appointment); } else { _deletedAppointment = appointment; } break; } } _isCancelInserted = false; }
protected void ASPxScheduler1_FilterAppointment(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { string customFieldName = "Price"; double customFieldValue; double filteredValue; if (double.TryParse(e.Object.CustomFields[customFieldName].ToString(), out customFieldValue) && double.TryParse(this.HiddenField1.Value, out filteredValue)) { e.Cancel = (customFieldValue == filteredValue); } }
private void AppointmentViewAppointmentChanging(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { var changingAppointment = (DevExpress.XtraScheduler.Appointment)e.Object; if (changingAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Occurrence) { return; } UpdateSchedulerStorage(); if (changingAppointment.Id != null) { Guid changingAppointmentId = (Guid)changingAppointment.Id; var oldAppointment = _newAppointments.FirstOrDefault( appointment => appointment.AppointmentId == changingAppointmentId); _newAppointments.Remove(oldAppointment); _schedulerStorage.RefreshData(); } bool isResolved = true; if (changingAppointment.Type == DevExpress.XtraScheduler.AppointmentType.ChangedOccurrence) { Guid patternId = (Guid)changingAppointment.RecurrencePattern.Id; var pattern = _schedulerStorage.Appointments.Items.FirstOrDefault( appointment => (Guid)appointment.Id == patternId); var copyAppointment = pattern.CreateException( DevExpress.XtraScheduler.AppointmentType.ChangedOccurrence, changingAppointment.RecurrenceIndex); copyAppointment.Start = changingAppointment.Start; copyAppointment.End = changingAppointment.End; isResolved = IsConflictResolved(copyAppointment); } else if (changingAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Normal || changingAppointment.Type == DevExpress.XtraScheduler.AppointmentType.Pattern) { var copyAppointment = changingAppointment.Copy(); isResolved = IsConflictResolved(copyAppointment); } if (!isResolved) { _isCancelInserted = true; e.Cancel = true; string message = ResourceService.GetString("AppointmentConflict"); MessageService.ShowWarning(message); AutoRefresh(); return; } _isCancelInserted = false; }
private void schedulerStorage1_AppointmentDeleting(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { if (DialogResult.Yes == MessageBox.Show("Silinsin mi??", "Emin Misin", MessageBoxButtons.YesNo, MessageBoxIcon.Stop)) { if (DialogResult.No == MessageBox.Show("Sileerimmm haaa??", "Dikkat et", MessageBoxButtons.YesNo, MessageBoxIcon.Warning)) { e.Cancel = true; } } else { e.Cancel = true; } }
private void AppointmentViewAppointmentInserting(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { UpdateSchedulerStorage(); var insertingAppointment = (DevExpress.XtraScheduler.Appointment)e.Object; var isResolved = IsConflictResolved(insertingAppointment); if (!isResolved) { e.Cancel = true; string message = ResourceService.GetString("AppointmentConflict"); MessageService.ShowWarning(message); AutoRefresh(); return; } _isCancelInserted = false; }
private void schedulerStorage1_AppointmentDependencyInserting(object sender, DevExpress.XtraScheduler.PersistentObjectCancelEventArgs e) { }