public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; IAppointmentStorageBase appointmentStorage = container.Control.Storage.Appointments; IAppointmentLabel label = appointmentStorage.Labels.GetById(apt.LabelKey); IAppointmentStatus status = appointmentStorage.Statuses.GetById(apt.StatusKey); edtLabel.SelectedIndex = appointmentStorage.Labels.IndexOf(label); edtStatus.SelectedIndex = appointmentStorage.Statuses.IndexOf(status); PopulateResourceEditors(apt, container); chkRecurrence.Visible = container.ShouldShowRecurrence; //AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (container.Appointment.HasReminder) { cbReminder.Value = container.Appointment.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; }
public static void scheduler_InitAppointmentDisplayText_1(object sender, AppointmentDisplayTextEventArgs e) { SchedulerControl scheduler = sender as SchedulerControl; IAppointmentStatus status = scheduler.DataStorage.Appointments.Statuses.GetById(e.Appointment.StatusKey); e.Description = String.Format("Status Info:\nDisplayName = '{0}'\nID = '{1}'", status.DisplayName, status.Id.ToString()); }
static void CustomLabelsAndStatusesAction(SchedulerControl scheduler) { #region #CustomLabelsAndStatuses scheduler.DataStorage.Appointments.Clear(); string[] IssueList = { "Consultation", "Treatment", "X-Ray" }; Color[] IssueColorList = { Color.Ivory, Color.Pink, Color.Plum }; string[] PaymentStatuses = { "Paid", "Unpaid" }; Color[] PaymentColorStatuses = { Color.Green, Color.Red }; IAppointmentLabelStorage labelStorage = scheduler.DataStorage.Appointments.Labels; labelStorage.Clear(); int count = IssueList.Length; for (int i = 0; i < count; i++) { IAppointmentLabel label = labelStorage.CreateNewLabel(i, IssueList[i]); label.SetColor(IssueColorList[i]); labelStorage.Add(label); } IAppointmentStatusStorage statuses = scheduler.DataStorage.Appointments.Statuses; statuses.Clear(); count = PaymentStatuses.Length; for (int i = 0; i < count; i++) { IAppointmentStatus status = statuses.CreateNewStatus(i, PaymentStatuses[i], PaymentStatuses[i]); status.SetBrush(new SolidBrush(PaymentColorStatuses[i])); statuses.Add(status); } #endregion #CustomLabelsAndStatuses }
void scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e) { AppointmentViewInfo viewInfo = e.ViewInfo; if (chkCustomText.IsChecked.GetValueOrDefault()) { UpdateText(viewInfo); } CustomAppointmentData data = new CustomAppointmentData(); data.Filtered = false; data.ShowImages = chkCustomImage.IsChecked.GetValueOrDefault(); viewInfo.CustomViewInfo = data; if (!IsEmptyFilter(cbSearch.Text)) { string searchText = cbSearch.Text.ToUpper(); if (IsAppointmentFiltered(searchText, e.ViewInfo.Appointment)) { data.Filtered = true; } } if (!data.Filtered) { IAppointmentLabel label = this.scheduler.Storage.AppointmentStorage.Labels.CreateNewLabel(string.Empty); label.SetColor(Colors.LightGray); viewInfo.Label = label; IAppointmentStatus status = this.scheduler.Storage.AppointmentStorage.Statuses.CreateNewStatus(string.Empty, string.Empty); status.Type = AppointmentStatusType.Custom; status.SetBrush(new SolidColorBrush(Colors.LightGray)); viewInfo.Status = status; } }
private static IAppointmentStatus CreateNewAppointmentStatus(IAppointmentStatusStorage storage, AppointmentStatusType type, Color color, string name, string caption) { IAppointmentStatus status = storage.CreateNewStatus(null, name, caption); status.Type = type; status.SetBrush(new SolidColorBrush(color)); return(status); }
void UpdateAppointmentStatus() { IAppointmentStatus currentStatus = edStatus.AppointmentStatus; IAppointmentStatus newStatus = controller.UpdateStatus(currentStatus); if (newStatus != currentStatus) { edStatus.AppointmentStatus = newStatus; } }
public override void DataBind() { base.DataBind(); AppointmentFormTemplateContainer container = (AppointmentFormTemplateContainer)Parent; Appointment apt = container.Appointment; IAppointmentStorageBase appointmentStorage = container.Control.Storage.Appointments; IAppointmentLabel label = appointmentStorage.Labels.GetById(apt.LabelKey); IAppointmentStatus status = appointmentStorage.Statuses.GetById(apt.StatusKey); edtLabel.ValueType = apt.LabelKey.GetType(); edtLabel.SelectedIndex = appointmentStorage.Labels.IndexOf(label); edtStatus.ValueType = apt.StatusKey.GetType(); edtStatus.SelectedIndex = appointmentStorage.Statuses.IndexOf(status); PopulateResourceEditors(apt, container); BindSubjectCombobox(); cbSubject.Value = container.Subject; tbCustomInfo.Text = container.Appointment.CustomFields["ApptCustomInfo"] != null ? container.Appointment.CustomFields["ApptCustomInfo"].ToString() : ""; AppointmentRecurrenceForm1.Visible = container.ShouldShowRecurrence; if (apt.HasReminder) { cbReminder.Value = apt.Reminder.TimeBeforeStart.ToString(); chkReminder.Checked = true; } else { cbReminder.ClientEnabled = false; } if (TimeZonesEnabled) { cbTimeZone.DataSource = TimeZoneInfo.GetSystemTimeZones(); cbTimeZone.ValueField = "Id"; cbTimeZone.TextField = "DisplayName"; cbTimeZone.DataBind(); cbTimeZone.Value = container.TimeZoneId; cbTimeZone.Enabled = apt.Type == AppointmentType.Normal || apt.Type == AppointmentType.Pattern; } //btnOk.ClientSideEvents.Click = container.SaveHandler; btnCancel.ClientSideEvents.Click = container.CancelHandler; btnDelete.ClientSideEvents.Click = container.DeleteHandler; JSProperties.Add("cpHasExceptions", apt.HasExceptions); //btnDelete.Enabled = !container.IsNewAppointment; }
static void CustomLabelsAndStatusesAction(SchedulerControl scheduler) { #region #CustomLabelsAndStatuses scheduler.Storage.AppointmentStorage.Clear(); string[] IssueList = { "Consultation", "Treatment", "X-Ray" }; Color[] IssueColorList = { Colors.Ivory, Colors.Pink, Colors.Plum }; string[] PaymentStatuses = { "Paid", "Unpaid" }; Color[] PaymentColorStatuses = { Colors.Green, Colors.Red }; IAppointmentLabelStorage labelStorage = scheduler.Storage.AppointmentStorage.Labels; labelStorage.Clear(); int count = IssueList.Length; for (int i = 0; i < count; i++) { IAppointmentLabel label = labelStorage.CreateNewLabel(i, IssueList[i]); label.SetColor(IssueColorList[i]); labelStorage.Add(label); } IAppointmentStatusStorage statusStorage = scheduler.Storage.AppointmentStorage.Statuses; statusStorage.Clear(); count = PaymentStatuses.Length; for (int i = 0; i < count; i++) { IAppointmentStatus status = statusStorage.CreateNewStatus(i, PaymentStatuses[i], PaymentStatuses[i]); status.SetBrush(new SolidColorBrush(PaymentColorStatuses[i])); statusStorage.Add(status); } // Create a new appointment. Appointment apt = scheduler.Storage.CreateAppointment(AppointmentType.Normal); apt.Subject = "Test"; apt.Start = DateTime.Now; apt.End = DateTime.Now.AddHours(2); apt.ResourceId = scheduler.Storage.ResourceStorage[0].Id; apt.LabelKey = labelStorage.GetByIndex(2).Id; scheduler.Storage.AppointmentStorage.Add(apt); #endregion #CustomLabelsAndStatuses }
void InitializeLabelsAndStutuses() { Labels = new AppointmentLabelCollection(); int count = IssueList.Length; for (int i = 0; i < count; i++) { AppointmentLabel label = Labels.CreateNewLabel(i, IssueList[i]); label.SetColor(IssueColorList[i]); Labels.Add(label); } Statuses = new AppointmentStatusCollection(); count = PaymentStatuses.Length; for (int i = 0; i < count; i++) { IAppointmentStatus status = Statuses.CreateNewStatus(PaymentStatuses[i], string.Empty); status.Type = AppointmentStatusType.Custom; status.SetBrush(new SolidColorBrush(PaymentColorStatuses[i])); Statuses.Add(status); } }