/// <summary> /// Timeslot selection change /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TimeSlotComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { //_log.Info("Inside TimeSlotComboBox_SelectionChanged"); var monthlyViewSchedulerViewModel = (MonthlyViewSchedulerViewModel)DataContext; string currentTimeSlot = (string)TimeSlotComboBox.SelectedItem; //_log.Info("Current TimeSlot: " + currentTimeSlot); monthlyViewSchedulerViewModel.CurrentTimeSlot = currentTimeSlot; DataContext = monthlyViewSchedulerViewModel; MonthlyViewCalendar.Refresh(); if (!currentTimeSlot.Equals("All Slots")) //if (currentTimeSlot == null || !currentTimeSlot.Equals("All Slots")) { DayQuota dayQuota = monthlyViewSchedulerViewModel.MonthlyQuota[monthlyViewSchedulerViewModel.CurrentDateSelected]; if (dayQuota != null) { float timeSlotQuota = dayQuota.TimeSlotQuota[currentTimeSlot]; if (timeSlotQuota > monthlyViewSchedulerViewModel.RedQuotaCutoff || monthlyViewSchedulerViewModel.IsManagerOverride) { updateRecordFields(currentTimeSlot, monthlyViewSchedulerViewModel.CurrentDateSelected); } } TimeSlotDataGrid.Visibility = System.Windows.Visibility.Collapsed; } else { monthlyViewSchedulerViewModel.ShowTimeSlotInDataGrid(monthlyViewSchedulerViewModel.CurrentDateSelected); TimeSlotDataGrid.Visibility = System.Windows.Visibility.Visible; } }
/// <summary> /// Refresh the scheduler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RefreshScheduler(object sender, RoutedEventArgs e) { //_log.Info("Inside RefreshScheduler"); var monthlyViewSchedulerViewModel = (MonthlyViewSchedulerViewModel)DataContext; monthlyViewSchedulerViewModel.IsRefreshRequested = true; monthlyViewSchedulerViewModel.CurrentTimeSlot = "All Slots"; TimeSlotComboBox.SelectedIndex = 0; DataContext = monthlyViewSchedulerViewModel; MonthlyViewCalendar.Refresh(); }