private void menuNewSchedule_Click(object sender, RoutedEventArgs e)
        {
            CourseScheduleView csView = new CourseScheduleView();

            csView.ShowDialog();
            LoadTermSY();
        }
        private void btnEditCourseSchedule_Click(object sender, RoutedEventArgs e)
        {
            Globals.COURSE_SCHEDULE row = (Globals.COURSE_SCHEDULE)((Button)e.Source).DataContext;

            //Globals.COURSE_SCHEDULE row = (Globals.COURSE_SCHEDULE)dgCourseSchedules.SelectedItem;
            Schedule           schedule = Db.GetCourseSchedule(SQL.ConString, row.ID);
            CourseScheduleView csView   = new CourseScheduleView(statusSelectedCourse.Content.ToString(), schedule);

            csView.ShowDialog();
            LoadTermSY();
        }
 private void menuEditSchedule_Click(object sender, RoutedEventArgs e)
 {
     if (dgCourseSchedules.SelectedIndex != -1)
     {
         Schedule           schedule = Db.GetCourseSchedule(SQL.ConString, SelectedCourse.ID);
         CourseScheduleView csView   = new CourseScheduleView(statusSelectedCourse.Content.ToString(), schedule);
         csView.ShowDialog();
         LoadTermSY();
     }
     else
     {
         MessageBox.Show("Select a course from the table.");
     }
 }