public void AddCourseToList(object obj)
        {
            var item  = SelectedCourseItem;
            var item2 = new StudentOfferedCourseListItemViewModel
            {
                SectionId    = item.SectionId,
                CourseName   = item.Name,
                LecturerName = item.LecturerName,
            };

            SelectedCourseList.Add(item2);
            StudentOfferedCourseListView.Items = SelectedCourseList;
            OnPropertyChanged(nameof(StudentOfferedCourseListView));

            MessageBox.Show(SelectedCourseItem.Name + " Course" + SelectedCourseList.Count, "Selected Course");
        }
        public void AddCourseToList(object obj)
        {
            var item  = SelectedCourseItem;
            var item2 = new StudentOfferedCourseListItemViewModel
            {
                SectionId    = item.SectionId,
                CourseName   = item.Name,
                LecturerName = item.LecturerName,
            };

            if (SelectedOfferedCourseItem.Count > 0 && SelectedOfferedCourseItem.Any(it => it.CourseName == item2.CourseName))
            {
                MessageBox.Show("Course Already in List", "Duplicate Found", MessageBoxButton.OK, MessageBoxImage.Asterisk);
            }
            else
            {
                SelectedOfferedCourseItem.Add(item2);
            }
        }
Example #3
0
 public void RemoveCourse(StudentOfferedCourseListItemViewModel item)
 {
     Items.Remove(item);
 }
Example #4
0
 public void AddCourse(StudentOfferedCourseListItemViewModel item)
 {
     Items.Add(item);
     //MessageBox.Show(item.CourseName + " Course", "Selected Course");
 }