Esempio n. 1
0
        private void searchby_combobx_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            isSerachBySet = true;
            ComboBox     searchByComboBx     = sender as ComboBox;
            ComboBoxItem searchByComboBxItem = searchByComboBx.SelectedItem as ComboBoxItem;
            string       searchByVal         = searchByComboBxItem.Content.ToString();

            if (searchByVal == "Subject")
            {
                search_combobx.DisplayMemberPath = "SubjectCode";
                search_combobx.ItemsSource       = _subjectViewModel.LoadSubjectData();
            }
            else if (searchByVal == "Group")
            {
                search_combobx.DisplayMemberPath = "GroupId";
                search_combobx.ItemsSource       = _Student_GroupViewModel.LoadStudentData();
            }
            else if (searchByVal == "Sub Group")
            {
                search_combobx.DisplayMemberPath = "SubGroupId";
                search_combobx.ItemsSource       = _Student_SubGroupViewModel.LoadStudentData();
            }
            else if (searchByVal == "Tag")
            {
                search_combobx.DisplayMemberPath = "TagName";
                search_combobx.ItemsSource       = _tagViewModel.LoadTagData();
            }
            else
            {
                search_combobx.DisplayMemberPath = "Name";
                search_combobx.ItemsSource       = _lecturerViewModel.LoadLecturerData();
            }
        }
 private void add_btn__Click(object sender, RoutedEventArgs e)
 {
     try
     {
         subject = CreateSubjectEntity();
         subjectNames.Add(subject.SubjectName);
         subjectCodes.Add(subject.SubjectCode);
         _subjectViewModel.SaveSubjectData(subject);
         subjects = _subjectViewModel.LoadSubjectData();
         subject_data_grid.ItemsSource = subjects;
         ClearAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     _prefferedRoomForSubjectViewModel = new PrefferedRoomForSubjectViewModel();
     _tagViewModel                   = new TagViewModel();
     _subjectViewModel               = new SubjectViewModel();
     tagname_combobx.ItemsSource     = _tagViewModel.LoadTagData();
     subjectname_combobx.ItemsSource = _subjectViewModel.LoadSubjectData();
     prefferedRoomForSubjects        = _prefferedRoomForSubjectViewModel.LoadData();
 }
Esempio n. 4
0
 private void Session_Page_Loaded(object sender, RoutedEventArgs e)
 {
     _lecturerViewModel         = new LecturerViewModel();
     _subjectViewModel          = new SubjectViewModel();
     _tagViewModel              = new TagViewModel();
     _sessionViewModel          = new SessionViewModel();
     _Student_GroupViewModel    = new Student_GroupViewModel();
     _Student_SubGroupViewModel = new Student_SubGroupViewModel();
     lecturers = _lecturerViewModel.LoadLecturerData();
     lecturer_combobx.ItemsSource = lecturers;
     code_combobx.ItemsSource     = _subjectViewModel.LoadSubjectData();
     tag_combobx.ItemsSource      = _tagViewModel.LoadTagData();
     sessions = _sessionViewModel.LoadSessionData();
     //grp_combobx.ItemsSource = _Student_GroupViewModel.LoadStudentData();
     //session_data_grid.ItemsSource = sessions;
     SetDataGrid();
     create_btn_.IsEnabled = false;
 }
        private void Subject_Page_Loaded(object sender, RoutedEventArgs e)
        {
            _subjectViewModel = new SubjectViewModel();

            subjects = _subjectViewModel.LoadSubjectData();
            subject_data_grid.ItemsSource = subjects;

            foreach (SubjectEntity s in subjects)
            {
                subjectNames.Add(s.SubjectName);
                subjectCodes.Add(s.SubjectCode);
            }

            add_btn_.IsEnabled    = false;
            update_btn_.IsEnabled = false;
            delete_btn_.IsEnabled = false;
            code_txtbx.Text       = "Eg: IT1050";
        }