示例#1
0
 /// <summary>
 /// Creator: Jordan Lindo
 /// Created: 4/8/2020
 /// Approver: Chase Schulte
 ///
 /// Generates a new schedule.
 /// </summary>
 /// <remarks>
 /// Updater: NA
 /// Updated: NA
 /// Update: NA
 ///
 /// </remarks>
 private void btnNewSchedule_Click(object sender, RoutedEventArgs e)
 {
     getBaseSchedule();
     if (_baseScheduleVM != null)
     {
         try
         {
             DateTime              startDate = getStartDate();
             ScheduleVM            vM        = _scheduleManager.GenerateSchedule(startDate, _baseScheduleVM.BaseScheduleLines);
             frmConfirmNewSchedule confirm   = new frmConfirmNewSchedule(_user, vM);
             if ((bool)confirm.ShowDialog())
             {
                 vM.ScheduleID = _scheduleManager.AddSchedule(vM);
                 _scheduleManager.AddScheduledHours(vM.ScheduleID);
                 getSchedules();
                 setCboDateRange();
             }
         }
         catch (Exception ex)
         {
             WPFErrorHandler.ErrorMessage(ex.Message);
         }
     }
 }