void scheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
 {
     if (e.ViewInfo.Location == String.Empty)
     {
         AppointmentLabel label = this.scheduler.Storage.AppointmentStorage.Labels.CreateNewLabel("");
         label.SetColor(Colors.White);
         e.ViewInfo.Label = label;
     }
     if (e.ViewInfo.Location.Contains("Orange"))
     {
         AppointmentLabel label = this.scheduler.Storage.AppointmentStorage.Labels.CreateNewLabel("");
         label.SetColor(Colors.Orange);
         e.ViewInfo.Label = label;
     }
     if (e.ViewInfo.Location.Contains("Green"))
     {
         AppointmentLabel label = this.scheduler.Storage.AppointmentStorage.Labels.CreateNewLabel("");
         label.SetColor(Colors.Green);
         e.ViewInfo.Label = label;
     }
     if (e.ViewInfo.Location.Contains("Blue"))
     {
         AppointmentLabel label = this.scheduler.Storage.AppointmentStorage.Labels.CreateNewLabel("");
         label.SetColor(Colors.Blue);
         e.ViewInfo.Label = label;
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
        void employeeScheduler_AppointmentViewInfoCustomizing(object sender, DevExpress.Xpf.Scheduler.AppointmentViewInfoCustomizingEventArgs e)
        {
            EmployeeTaskSchedulerData customFieldsData = new EmployeeTaskSchedulerData();

            customFieldsData.CostPrice = e.ViewInfo.Appointment.CustomFields["FieldCostPrice"] != null?Convert.ToDouble(e.ViewInfo.Appointment.CustomFields["FieldCostPrice"]) : 0.0;

            customFieldsData.DiscountPct = e.ViewInfo.Appointment.CustomFields["FieldDiscountPct"] != null?Convert.ToDouble(e.ViewInfo.Appointment.CustomFields["FieldDiscountPct"]) : 0.0;

            customFieldsData.SalesPrice = e.ViewInfo.Appointment.CustomFields["FieldSalesPrice"] != null?Convert.ToDouble(e.ViewInfo.Appointment.CustomFields["FieldSalesPrice"]) : 0.0;

            customFieldsData.Qty = e.ViewInfo.Appointment.CustomFields["FieldQty"] != null?Convert.ToDouble(e.ViewInfo.Appointment.CustomFields["FieldQty"]) : 0.0;

            customFieldsData.Text     = e.ViewInfo.Appointment.CustomFields["FieldText"] != null ? e.ViewInfo.Appointment.CustomFields["FieldText"].ToString() : "";
            e.ViewInfo.CustomViewInfo = customFieldsData;
        }