public static void GenerateAppointments(ISchedulerStorage storage, int aptsPerDay) {
     storage.BeginUpdate();
     Random rnd = new Random();
     DateTime start = DateTime.Today.AddDays(-DAY_COUNT / 2);
     for (int i = 0; i <= DAY_COUNT * aptsPerDay; i++) {
         storage.Appointments.Add(CreateNewAppointment(storage, i, aptsPerDay, rnd, start));
     }
     storage.EndUpdate();
 }
 public static void FillResources(ISchedulerStorage storage, int count) {
     ResourceCollection resources = storage.Resources.Items;
     storage.BeginUpdate();
     try {
         int cnt = Math.Min(count, SchedulerHelper.resources.Length);
         for (int i = 1; i <= cnt; i++) {
             Resource resource = storage.CreateResource(i);
             resource.Caption = SchedulerHelper.resources[i - 1];
             resources.Add(resource);
         }
     }
     finally {
         storage.EndUpdate();
     }
 }