void GenerateEvents(CustomEventList eventList) { int count = schedulerDataStorage1.Resources.Count; for (int i = 0; i < count; i++) { Resource resource = schedulerDataStorage1.Resources[i]; string subjPrefix = resource.Caption + "'s "; eventList.Add(CreateEvent(eventList, subjPrefix + "meeting", resource.Id, 2, 5)); eventList.Add(CreateEvent(eventList, subjPrefix + "travel", resource.Id, 3, 6)); eventList.Add(CreateEvent(eventList, subjPrefix + "phone call", resource.Id, 0, 10)); } }
CustomEvent CreateEvent(CustomEventList eventList, string subject, object resourceId, int status, int label) { CustomEvent apt = new CustomEvent(eventList); apt.Subject = subject; apt.OwnerId = resourceId; Random rnd = RandomInstance; int rangeInMinutes = 60 * 24; apt.StartTime = DateTime.Today + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes)); apt.EndTime = apt.StartTime + TimeSpan.FromMinutes(rnd.Next(0, rangeInMinutes / 4)); apt.Status = status; apt.Label = label; return(apt); }
void InitAppointments() { this.schedulerDataStorage1.Appointments.Mappings.Start = "StartTime"; this.schedulerDataStorage1.Appointments.Mappings.End = "EndTime"; this.schedulerDataStorage1.Appointments.Mappings.Subject = "Subject"; this.schedulerDataStorage1.Appointments.Mappings.AllDay = "AllDay"; this.schedulerDataStorage1.Appointments.Mappings.Description = "Description"; this.schedulerDataStorage1.Appointments.Mappings.Label = "Label"; this.schedulerDataStorage1.Appointments.Mappings.Location = "Location"; this.schedulerDataStorage1.Appointments.Mappings.RecurrenceInfo = "RecurrenceInfo"; this.schedulerDataStorage1.Appointments.Mappings.ReminderInfo = "ReminderInfo"; this.schedulerDataStorage1.Appointments.Mappings.ResourceId = "OwnerId"; this.schedulerDataStorage1.Appointments.Mappings.Status = "Status"; this.schedulerDataStorage1.Appointments.Mappings.Type = "EventType"; CustomEventList eventList = new CustomEventList(); GenerateEvents(eventList); this.schedulerDataStorage1.Appointments.DataSource = eventList; }
public CustomEvent(CustomEventList events) { this.events = events; }