Example #1
0
 public void AddCourses()
 {
     AddOrDelete(_electiveCourses);
     if (_creditsCompleted < 360)
     {
         ElectiveCourses  = new BindableCollection <CourseModel>(_sqlData.GetAllElectiveCourses(UserName, _major.MajorId));
         CreditsCompleted = _sqlData.GetCreditsCompleted(UserName, _major.MajorId).FirstOrDefault();
     }
     else
     {
         _eventAggregator.PublishOnUIThread("3");
     }
 }
Example #2
0
        public SelectElectivesViewModel(ISqlData sqlData, IEventAggregator eventAggregator, MajorModel major)
        {
            _sqlData         = sqlData;
            _eventAggregator = eventAggregator;
            _major           = major;

            if (major != null)
            {
                _electiveCourses  = new BindableCollection <CourseModel>(_sqlData.GetAllElectiveCourses(UserName, major.MajorId));
                _completedCourses = new List <CompletedCourseModel>(_sqlData.GetAllCompletedCourses(UserName));

                _creditsCompleted = _sqlData.GetCreditsCompleted(UserName, major.MajorId).FirstOrDefault();
                _creditsDue       = 360;
                MajorName         = _major.Name;
            }
        }