void SetAppointmentId(object sender, PersistentObjectCancelEventArgs e) { ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender; Appointment apt = (Appointment)e.Object; storage.SetAppointmentId(apt, apt.GetHashCode()); }
void schedulerStorage1_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = (Appointment)e.Object; apt.CustomFields["SafeIntervalStartCF"] = apt.Start.AddHours(-1); apt.CustomFields["SafeIntervalEndCF"] = apt.End.AddHours(1); }
void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment appt = e.Object as Appointment; CustomAppointment deletedAppointment = appt.GetSourceObject(schedulerStorage1) as CustomAppointment; cache.Add(deletedAppointment); }
/// <summary> /// 插入事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Storage_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = e.Object as Appointment; try { if (schedulerService.appointmentInserting(apt)) { // 成功后刷新列表 this.treeListTask.DataSource = schedulerService.CustomEventList; this.treeListTask.ExpandAll(); // 切换到月视图 schedulerControl1.ActiveViewType = SchedulerViewType.Month; e.Cancel = false; // 控件cancel } else { e.Cancel = true; } } catch (Exception appointmentException) { MessageBox.Show(appointmentException.Message); } }
private void SchedulerStorage1_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { if (((Appointment)e.Object).Start < DateTime.Now) { e.Cancel = true; } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { if (ViewModel.EmployeeShiftsLookUp.CanDelete(shiftsBindingSource.Current as Shift)) { ViewModel.EmployeeShiftsLookUp.Delete(shiftsBindingSource.Current as Shift); } }
private void SchedulerDataStorage1_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { AdvPersistentObjectCancelEventArgs advArgs = (AdvPersistentObjectCancelEventArgs)e; if (advArgs.PropertyName == "Start" || advArgs.PropertyName == "End") { DevExpress.XtraScheduler.Internal.Implementations.AppointmentItem apt = (DevExpress.XtraScheduler.Internal.Implementations.AppointmentItem)e.Object; int id = Convert.ToInt32(apt.Id); if (advArgs.PropertyName == "Start") { if (Convert.ToDateTime(advArgs.NewValue) < AnaForm.tarihsaatgetir()) { durum = false; //eğer start hatalı ise end e bakmam. ama end field ini de güncellemeyip dönmesi için e.cancel=true yapmam gerektiği için. e.Cancel = true; } else if (AnaForm.CalismaAktifPeriyotMu(Convert.ToDateTime(advArgs.NewValue), 0, 0, Convert.ToInt32(apt.Id)) == false) { durum = false; e.Cancel = true; } } if (advArgs.PropertyName == "End") { if (durum == false) { durum = true; e.Cancel = true; } } } }
protected void ControlOnAppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { ASPxSchedulerStorage storage = (ASPxSchedulerStorage)sender; Appointment apt = (Appointment)e.Object; storage.SetAppointmentId(apt, "a" + apt.GetHashCode()); }
private void schedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { if (AppointmentDeleting != null) { AppointmentDeleting(sender, e); } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { try { Nested_CheckSecurityForDeletion(); } catch (AccessDeniedException) { ErrorHandler.Show("Impossibile accedere alla funzionalità richiesta. Accesso negato"); e.Cancel = true; return; } if (XtraMessageBox.Show("Sicuro di procedere alla cancellazione dell'appuntamento?", "Domanda", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DevExpress.XtraScheduler.Appointment app = e.Object as DevExpress.XtraScheduler.Appointment; MyAppointment a = app.GetSourceObject(schedulerStorage1) as MyAppointment; ////i save on my db AppointmentHandler h = new AppointmentHandler(); h.Delete(a); return; } e.Cancel = true; }
void Storage_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = (Appointment)e.Object; DateTime newDate = apt.Start; DateTime oldDate = Convert.ToDateTime(((DataRowView)apt.GetSourceObject(Storage.GetCoreStorage()))["Start"]); Dispatcher.BeginInvoke(new Action <Appointment, TimeSpan>((appointmentToChange, displacement) => { Storage.AppointmentChanging -= Storage_AppointmentChanging; Storage.BeginUpdate(); for (int i = 0; i < Storage.AppointmentStorage.Count; i++) { Appointment nextAppointment = Storage.AppointmentStorage[i]; if (nextAppointment == appointmentToChange) { continue; } if (AreAppointmentsFromSameGroup(nextAppointment, appointmentToChange)) { nextAppointment.LabelKey = appointmentToChange.LabelKey; nextAppointment.StatusKey = appointmentToChange.StatusKey; nextAppointment.Start += displacement; } } Storage.EndUpdate(); Storage.AppointmentChanging += Storage_AppointmentChanging; }), (Appointment)e.Object, newDate - oldDate); }
void Storage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment appointmentToDelete = (Appointment)e.Object; List <Appointment> appointmentsToDelete = new List <Appointment>(); for (int i = 0; i < Storage.AppointmentStorage.Count; i++) { Appointment nextAppointment = Storage.AppointmentStorage[i]; if (nextAppointment == appointmentToDelete) { continue; } if (AreAppointmentsFromSameGroup(nextAppointment, appointmentToDelete)) { appointmentsToDelete.Add(nextAppointment); } } Dispatcher.BeginInvoke(new Action <List <Appointment> >((apointments) => { Storage.AppointmentDeleting -= Storage_AppointmentDeleting; Storage.BeginUpdate(); for (int i = 0; i < apointments.Count; i++) { apointments[i].Delete(); } Storage.EndUpdate(); Storage.AppointmentDeleting += Storage_AppointmentDeleting; }), appointmentsToDelete); }
static void Storage_FilterAppointment(object sender, PersistentObjectCancelEventArgs e) { if (((Appointment)e.Object).CustomFields["PropertyOne"] != null) { e.Cancel = ((Appointment)e.Object).CustomFields["PropertyOne"].ToString() == "Hidden"; } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { if (isDragging) { e.Cancel = true; isDragging = false; } }
private void schedulerStorage1_FilterAppointment(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = (Appointment)e.Object; if (Resource.Empty.Equals(apt.ResourceId)) return; List<int> selectedIds = this.calendarControls.GetSelectedResourceIds(); int resourceId = Convert.ToInt32(apt.ResourceId); e.Cancel = !selectedIds.Contains(resourceId); }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = (Appointment)e.Object; DBAppointment dbApt = (DBAppointment)apt.GetSourceObject(schedulerStorage1); context.DBAppointments.DeleteOnSubmit(dbApt); context.SubmitChanges(); }
private void schedulerStorage_AppointmentDeleting_1(object sender, PersistentObjectCancelEventArgs e) { DialogResult result = MessageBox.Show("هل انت متاكد من الغاء الكورس", "الغاء الكورس", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.No) { e.Cancel = true; } }
void OnAppointmentsDeleting(object sender, PersistentObjectCancelEventArgs e) { using (new WaitCursor()) { Model.Appointment obj = e.Object.GetSourceObject((SchedulerStorage)sender) as Model.Appointment; Delete(obj); } }
private void schedulerStoragePrenotazioni_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = e.Object as Appointment; if (apt != null && apt.LabelId == Prenotazione.LabelDisabled) { e.Cancel = true; } }
private static void Storage_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { object busyKey = ((SchedulerDataStorage)sender).Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id; if (busyKey != null) { e.Cancel = ((Appointment)e.Object).StatusKey.Equals(busyKey); } }
private void SchedulerStorage1_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { object busyKey = schedulerStorage1.Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id; if (((Appointment)e.Object).StatusKey == busyKey) { e.Cancel = true; } }
private void schedulerStorage1_FilterAppointment(object sender, PersistentObjectCancelEventArgs e) { // Appointment apt = (Appointment)e.Object; // if (Resource.Empty.Equals(apt.ResourceId)) // return; // List<int> selectedIds = this.calendarControls.GetSelectedResourceIds(); // var resourceId = Convert.ToInt32(apt.ResourceId); // e.Cancel = !selectedIds.Contains(resourceId); }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { var resultado = XtraMessageBox.Show(Mensagens.DesejaRealmenteExcluir, "Alerta", MessageBoxButtons.YesNo); if (resultado.ToString() == "No") { e.Cancel = true; } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { DialogResult result = MessageBox.Show("¿ Está seguro que desea borrar esta cita ?", "Por favor, Confirme ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.No) { e.Cancel = true; } }
private void schedulerDataStorage1_FilterAppointment(object sender, PersistentObjectCancelEventArgs e) { DataRowView rowView = (DataRowView)schedulerDataStorage1.GetObjectRow(e.Object); DataRow row = rowView.Row; if (!AppointmentRowHash.ContainsKey(row)) { AppointmentRowHash.Add(rowView.Row, e.Object); } }
private void schedulerStorage1_FilterResource(object sender, PersistentObjectCancelEventArgs e) { ExpressionEvaluator ee = new ExpressionEvaluator(TypeDescriptor.GetProperties(e.Object), filterControl1.FilterCriteria, false); object obj = ee.Evaluate(e.Object); if (obj != null) { e.Cancel = !Convert.ToBoolean(obj); } }
private void schedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { EventServiceRelation relation = GetEventServiceRelation(e.Object); if (EventList.CurrentEvent == null || relation == null || relation.EventId != EventList.CurrentEvent.EventId) { e.Cancel = true; return; } }
private void schedulerStorage1_AppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { object oldLabel = ((DataRowView)((Appointment)e.Object).GetSourceObject((SchedulerStorageBase)sender)).Row["Label"]; object newLabel = ((Appointment)e.Object).LabelKey; if (!newLabel.Equals(oldLabel)) { MessageBox.Show("Label was changed!"); } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { if (deleteBtnClicked) { DialogResult res = MessageBox.Show("Are you sure?", "Please confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (res != DialogResult.Yes) { e.Cancel = true; } } deleteBtnClicked = false; }
private void OnMudanca(object sender, PersistentObjectCancelEventArgs e) { try { tb_AgendaTreinamentosTableAdapter.Update(bANCO_AWMAgenda); bANCO_AWMAgenda.AcceptChanges(); } catch (Exception) { XtraMessageBox.Show("Não é possível excluir este registro, existem alunos cadastrados neste treinamento!"); } }
void OnSchedulerStorage1AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment apt = (Appointment)e.Object; DBAppointment dbApt = (DBAppointment)apt.GetSourceObject(this.schedulerStorage1); if (dbApt == null) // occurrence { return; } this.context.DBAppointments.DeleteOnSubmit(dbApt); this.context.SubmitChanges(); }
private void SchedulerStorageAppointmentChanging(object sender, PersistentObjectCancelEventArgs e){ var appointment = (Appointment)e.Object; var type = (Type)appointment.CustomFields[SchedulerStorage.BOType]; var key = appointment.CustomFields[SchedulerStorage.BOKey]; var objectSpace = GetObjectSpace(); var eventBO = ((IEvent)objectSpace.GetObjectByKey(type, key)); if (eventBO != null){ var reminderInfo = eventBO.GetReminderInfoMemberValue(); reminderInfo.HasReminder = appointment.HasReminder; reminderInfo.Info = !reminderInfo.HasReminder ? null : new ReminderXmlPersistenceHelper(appointment.Reminder, DateSavingType.LocalTime).ToXml(); objectSpace.CommitChanges(); } }
private void schedulerStorage1_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { }
void SchedulerStorageAppointmentChanging(object sender, PersistentObjectCancelEventArgs e) { StopRefreshingStorage(); var appointment = e.Object as Appointment; if (appointment == null) throw new NullReferenceException("appointment"); using (var objectSpace = Application.CreateObjectSpace()) { var type = (Type) appointment.CustomFields[BoTypeCustomField]; var eventBO = ((IEvent)objectSpace.GetObjectByKey(type, appointment.Id)); var reminderInfo = eventBO.GetReminderInfoMemberValue(); reminderInfo.HasReminder = appointment.HasReminder; reminderInfo.Info = !reminderInfo.HasReminder ? null : new ReminderXmlPersistenceHelper(appointment.Reminder, DateSavingType.LocalTime).ToXml(); objectSpace.CommitChanges(); } StartRefreshingStorage(); }
private void scRandevuStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { deleteResult = MessageBox.Show("Silmek istediğinize emin misiniz?", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); currentAppointment = (DevExpress.XtraScheduler.Appointment)e.Object; }
void SchedulerStorage1AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { HideAppointmentCategory(); }
private void schedulerStorage_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { EventServiceRelation relation = GetEventServiceRelation(e.Object); if (EventList.CurrentEvent == null || relation == null || relation.EventId != EventList.CurrentEvent.EventId) { e.Cancel = true; return; } }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { DialogResult result = MessageBox.Show("¿ Está seguro que desea borrar esta cita ?", "Por favor, Confirme ", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.No) e.Cancel = true; }
private void schedulerStorage1_AppointmentInserting(object sender, PersistentObjectCancelEventArgs e) { this.schedulerStorage1.AppointmentsInserted += OnAppointmentChangedInsertedDeleted; }
private void schedulerStorage1_AppointmentDeleting(object sender, PersistentObjectCancelEventArgs e) { Appointment app = (Appointment)e.Object; clsVisita visita = LogicaNegocios.Calendarios.clsCalendarios.ObtenerVisitaPorId(Convert.ToInt64(app.CustomFields["IdVisita"])); if (visita == null) return; if (visita.EstadoBD == Entidades.Enums.Enums.VisitaEstado.Realizada_Con_Informe || visita.EstadoBD == Entidades.Enums.Enums.VisitaEstado.Realizada_Informe_Pendiente) { MessageBox.Show("La visita esta marcada como realizada, no es posible eliminarla", "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; return; } if (visita.EstadoBD == Entidades.Enums.Enums.VisitaEstado.No_Realizada) { MessageBox.Show("La Visita no fue realizada y se encuentra bloqueada, no es posible eliminarla", "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Information); e.Cancel = true; return; } DialogResult resdialogo = MessageBox.Show("¿Está seguro de eliminar la Visita", "Calendario", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (resdialogo == DialogResult.Yes) { ResultadoTransaccion resultado = LogicaNegocios.Calendarios.clsCalendarios.EliminarVisita(visita); if (resultado.Estado == Entidades.Enums.Enums.EstadoTransaccion.Rechazada) { MessageBox.Show(resultado.Descripcion, "Calendario", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Cancel = true; } // LoadDataCalendar(); } else { e.Cancel = true; } }