Example #1
0
        private void ExecuteAdd(object obj)
        {
            if (_selected != null)
            {
                if (!Chosen.Contains(_selected))
                {
                    String query = "Select distinct Läsperiod from Läsperioder Where Kurskod LIKE '%" + _selected.Kurskod.Trim() + "%';";
                    foreach (string v in PerformDatabaseStringAccess(query))
                    {
                        StudyPeriods.Add(v);
                    }


                    if (StudyPeriods.Count == 1)
                    {
                        Chosen.Add(_selected.returnNewCourse(StudyPeriods.First()));
                        Messenger.Default.Send <ObservableCollection <Course> >(Chosen);
                        MessageQueue.Enqueue(_selected.ToString() + " tillagd i specialiseringen");
                        StudyPeriods.Clear();
                    }
                    else
                    {
                        OpenDialog = true;
                    }
                }
                else
                {
                    MessageBox.Show("The course has already been chosen for your future specialization");
                }
            }
        }
Example #2
0
 private void ChooseStudyPeriod(string obj)
 {
     Chosen.Add(_selected.returnNewCourse(obj));
     Messenger.Default.Send <ObservableCollection <Course> >(Chosen);
     OpenDialog = false;
     MessageQueue.Enqueue(_selected.ToString() + " tillagd i specialiseringen");
     StudyPeriods.Clear();
 }