private void BindToDataSet() { if (this.schedulerDataSet == null) { this.schedulerDataSet = new SchedulerDataSet(); this.appointmentsAdapter.Fill(this.schedulerDataSet.Appointments); ResourcesTableAdapter resourcesAdapter = new ResourcesTableAdapter(); resourcesAdapter.Fill(this.schedulerDataSet.Resources); AppointmentsResourcesTableAdapter appointmentsResourcesAdapter = new AppointmentsResourcesTableAdapter(); appointmentsResourcesAdapter.Fill(this.schedulerDataSet.AppointmentsResources); } SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); dataSource.EventProvider.AppointmentFactory = this.radSchedulerDemo.AppointmentFactory; AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Mappings.Add(new SchedulerMapping("Email", "Email")); appointmentMappingInfo.UniqueId = "ID"; appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "Summary"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; appointmentMappingInfo.BackgroundId = "BackgroundID"; appointmentMappingInfo.StatusId = "StatusID"; appointmentMappingInfo.Resources = "AppointmentsAppointmentsResources"; appointmentMappingInfo.ResourceId = "ResourceID"; appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"; appointmentMappingInfo.Exceptions = "AppointmentsAppointments"; appointmentMappingInfo.MasterEventId = "ParentID"; appointmentMappingInfo.Visible = "Visible"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.schedulerDataSet.Appointments; ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); resourceMappingInfo.Id = "ID"; resourceMappingInfo.Name = "ResourceName"; dataSource.ResourceProvider.Mapping = resourceMappingInfo; dataSource.ResourceProvider.DataSource = this.schedulerDataSet.Resources; this.radSchedulerDemo.DataSource = dataSource; }
private void BindScheduler() { SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "NameDoc"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.appointmentsBindingSource; this.radScheduler1.DataSource = dataSource; }
private void BindToDataSet() { if (this.schedulerDataSet == null) { this.schedulerDataSet = new SchedulerDataset(); AppointmentsTableAdapter appointmentsAdapter = new AppointmentsTableAdapter(); appointmentsAdapter.Fill(this.schedulerDataSet.Appointments); ResourcesTableAdapter resourcesAdapter = new ResourcesTableAdapter(); resourcesAdapter.Fill(this.schedulerDataSet.Resources); TransientAppointmentsResourcesTableAdapter appointmentsResourcesAdapter = new TransientAppointmentsResourcesTableAdapter(); appointmentsResourcesAdapter.Fill(this.schedulerDataSet.TransientAppointmentsResources); } SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "Summary"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; appointmentMappingInfo.BackgroundId = "BackgroundID"; appointmentMappingInfo.StatusId = "StatusID"; appointmentMappingInfo.Resources = "Appointments_AppointmentsResources"; appointmentMappingInfo.ResourceId = "ResourceID"; appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.schedulerDataSet.Appointments; ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); resourceMappingInfo.Id = "ID"; resourceMappingInfo.Name = "ResourceName"; dataSource.ResourceProvider.Mapping = resourceMappingInfo; dataSource.ResourceProvider.DataSource = this.schedulerDataSet.Resources; this.radSchedulerDemo.DataSource = dataSource; }
private void BindToBusinessObjects() { this.appointments = new List <MyAppointment>(); DateTime baseDate = new DateTime(2009, 3, 7); DateTime[] start = new DateTime[] { baseDate.AddHours(14.0), baseDate.AddDays(1.0).AddHours(9.0), baseDate.AddDays(2.0).AddHours(13.0) }; DateTime[] end = new DateTime[] { baseDate.AddHours(16.0), baseDate.AddDays(1.0).AddHours(15.0), baseDate.AddDays(2.0).AddHours(17.0) }; string[] summaries = new string[] { "Mr. Brown", "Mr. White", "Mrs. Green" }; string[] descriptions = new string[] { "", "", "" }; string[] locations = new string[] { "City", "Out of town", "Service Center" }; MyAppointment appointment = null; for (int i = 0; i < summaries.Length; i++) { appointment = new MyAppointment(start[i], end[i], summaries[i], descriptions[i], locations[i]); this.appointments.Add(appointment); } MyAppointment recurringAppointment = new MyAppointment(baseDate.AddHours(7.0), baseDate.AddHours(10.0), "Recurring appointment with exceptions", null, null); recurringAppointment.RecurrenceRule = "FREQ=DAILY"; MyAppointment notVisibleException = new MyAppointment(recurringAppointment.Start.AddDays(1.0), recurringAppointment.End.AddDays(1.0), "Recurring appointment with exceptions", null, null); notVisibleException.MasterAppointment = recurringAppointment; notVisibleException.Visible = false; recurringAppointment.Exceptions.Add(notVisibleException); this.appointments.Add(recurringAppointment); //int[] resourceIds = new int[] { 1, 2, 3 }; string[] resourceNames = new string[] { "Dell Laptop", "Lenovo Laptop", "Toshiba Laptop" }; this.resources = new List <MyResource>(); for (int i = 0; i < resourceNames.Length; i++) { this.resources.Add(new MyResource(resourceNames[i])); } SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); dataSource.EventProvider.AppointmentFactory = this.radSchedulerDemo.AppointmentFactory; AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); appointmentMappingInfo.Mappings.Add(new SchedulerMapping("Email", "Email")); appointmentMappingInfo.Start = "Start"; appointmentMappingInfo.End = "End"; appointmentMappingInfo.Summary = "Subject"; appointmentMappingInfo.Description = "Description"; appointmentMappingInfo.Location = "Location"; appointmentMappingInfo.UniqueId = "Id"; appointmentMappingInfo.Resources = "Resources"; appointmentMappingInfo.ResourceId = "Id"; appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"; appointmentMappingInfo.Exceptions = "Exceptions"; appointmentMappingInfo.MasterEventId = "MasterAppointment"; appointmentMappingInfo.Visible = "Visible"; dataSource.EventProvider.Mapping = appointmentMappingInfo; dataSource.EventProvider.DataSource = this.appointments; ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); resourceMappingInfo.Id = "Id"; resourceMappingInfo.Name = "Name"; dataSource.ResourceProvider.Mapping = resourceMappingInfo; dataSource.ResourceProvider.DataSource = this.resources; this.radSchedulerDemo.DataSource = dataSource; }