void scheduler_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { if (chkCustomWorkTime != null) { if (!(bool)chkCustomWorkTime.IsChecked) { return; } } if (scheduler != null) { SchedulerStorage schedulerStorage = scheduler.Storage; if (schedulerStorage.ResourceStorage == null) { return; } int resourceIndex = schedulerStorage.ResourceStorage.Items.IndexOf(e.Resource); if (resourceIndex >= 0) { if (resourceIndex == 0) { if ((e.Interval.Start.Day % 2) == 0) { e.WorkTime = workTimes[resourceIndex % workTimes.Length]; } else { e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(8), TimeSpan.FromHours(13))); e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(14), TimeSpan.FromHours(18))); } } else { if (scheduler.WorkDays.IsWorkDay(e.Interval.Start.Date)) { e.WorkTime = workTimes[resourceIndex % workTimes.Length]; } } } } }
protected void ASPxScheduler1_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { switch (e.Interval.Start.DayOfWeek) { case DayOfWeek.Monday: e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(8), TimeSpan.FromHours(12))); e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(13), TimeSpan.FromHours(17))); break; case DayOfWeek.Friday: e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(10), TimeSpan.FromHours(14))); break; default: e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(9), TimeSpan.FromHours(13))); e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(14), TimeSpan.FromHours(18))); break; } }
private void SchedulerControl1_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { if (e.Resource.Id.Equals(1)) { if (e.Interval.Start.Day % 2 == 0) { List <TimeOfDayInterval> workTimes = new List <TimeOfDayInterval>(); workTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(0), TimeSpan.FromHours(3))); workTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(5), TimeSpan.FromHours(8))); workTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(10), TimeSpan.FromHours(11))); e.WorkTimes.AddRange(workTimes); } else { e.WorkTime = new TimeOfDayInterval(TimeSpan.FromHours(8), TimeSpan.FromHours(20)); } } if (e.Resource.Id.Equals(2)) { if (e.Interval.Start.Day % 2 == 0) { e.WorkTime = new TimeOfDayInterval(TimeSpan.FromHours(14), TimeSpan.FromHours(18)); } else { e.WorkTime = new TimeOfDayInterval(TimeSpan.FromHours(8), TimeSpan.FromHours(12)); } } if (e.Resource.Id.Equals(3)) { e.WorkTime = new TimeOfDayInterval(TimeSpan.FromHours(14), TimeSpan.FromHours(21)); } if (e.Resource.Id.Equals(4)) { List <TimeOfDayInterval> workTimes = new List <TimeOfDayInterval>(); workTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(8), TimeSpan.FromHours(11))); workTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(13), TimeSpan.FromHours(17))); e.WorkTimes.AddRange(workTimes); } }
private void schedulerControl1_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(10), TimeSpan.FromHours(13))); e.WorkTimes.Add(new TimeOfDayInterval(TimeSpan.FromHours(14), TimeSpan.FromHours(16))); printProperties(); }
private void schedulerControl1_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { }
private void Schedu_QueryWorkTime(object sender, QueryWorkTimeEventArgs e) { }