/// <summary>
        /// Remove from schelduler the workingshifts for a specific week in the paramater.
        /// (if the workingShif id is in the list then it is removed)
        /// </summary>
        /// <param name="d">date in the removal week</param>
        /// <param name="bd">database</param>
        public static void RemoveWeekWorkingShiftScheduler(DateTime d, Scheduler scheduler)
        {
            DateTime lastMonday = PlanningGeneratorTools.GetMondayBefore(d);
            DateTime nextMonday = lastMonday.AddDays(7);

            List <Event> eventsToRemove = scheduler.Events.Where(ev => ev.Start >= lastMonday && ev.Start <= nextMonday).ToList();

            foreach (Event ev in eventsToRemove)
            {
                scheduler.DeleteEvent(ev.Id);
            }
        }
Пример #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     dpFirstDay.SelectedDate = PlanningGeneratorTools.GetMondayBefore(DateTime.Today);
     dpLastDay.SelectedDate  = PlanningGeneratorTools.GetSundayAfter(DateTime.Today);
 }