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 }
public AppoitmentSynchronizer(IAppointmentLabelStorage labels, IAppointmentStatusStorage statuses, IModelListViewOptionsScheduler modelListViewOptionsScheduler) : base(null, modelListViewOptionsScheduler) { var appointmentsModel = modelListViewOptionsScheduler.OptionsScheduler.GetNode("Storage").GetNode("Appointments"); ModelSynchronizerList.Add(new AppoitmentLabelsSynchronizer(labels, (IModelAppoitmentLabels)appointmentsModel.GetNode("Labels"))); ModelSynchronizerList.Add(new AppoitmentStatusSynchronizer(statuses, (IModelAppoitmentStatuses)appointmentsModel.GetNode("Statuses"))); }
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); }
static void InitCustomAppointmentStatuses(SchedulerStorage storage) { storage.BeginUpdate(); try { IAppointmentStatusStorage statuses = storage.AppointmentStorage.Statuses; statuses.Clear(); statuses.Add(CreateNewAppointmentStatus(statuses, AppointmentStatusType.Free, Colors.White, "Free", "Free")); statuses.Add(CreateNewAppointmentStatus(statuses, AppointmentStatusType.Custom, Colors.SkyBlue, "Wash", "Wash")); statuses.Add(CreateNewAppointmentStatus(statuses, AppointmentStatusType.Custom, Colors.SteelBlue, "Maintenance", "Maintenance")); statuses.Add(CreateNewAppointmentStatus(statuses, AppointmentStatusType.Custom, Colors.YellowGreen, "Rent", "Rent")); statuses.Add(CreateNewAppointmentStatus(statuses, AppointmentStatusType.Custom, Colors.Coral, "CheckUp", "CheckUp")); } finally { storage.EndUpdate(); } }
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 }
public SchedulerListEditorModelSynchronizer(IInnerSchedulerControlOwner control, IModelListViewOptionsScheduler model, IAppointmentLabelStorage labels, IAppointmentStatusStorage statuses) : base(control, model) { ModelSynchronizerList.Add(new SchedulerControlSynchronizer(control, model)); var appoitmentSynchronizer = new AppoitmentSynchronizer(labels, statuses, model); ModelSynchronizerList.Add(appoitmentSynchronizer); }