private void add_btn__Click(object sender, RoutedEventArgs e)
 {
     try
     {
         student = CreateStudentEntity();
         studentIds.Add(student.StudentId);
         _studentViewModel.SaveStudentData(student);
         student_data_grid.ItemsSource = _studentViewModel.LoadStudentData();
         ClearAll();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void SubGroup_NA_Page_loaded(object sender, RoutedEventArgs e)
 {
     subGroupNAViewModel       = new SubGroupNAViewModel();
     Student_SubGroupViewModel = new Student_SubGroupViewModel();
     subGroupNAs = subGroupNAViewModel.LoadSubGroupNAData();
     subgroup_combobx.ItemsSource = Student_SubGroupViewModel.LoadStudentData();
 }
Exemple #3
0
        private void tag_combobx_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBox tagComboBx = sender as ComboBox;

            if (tagComboBx.SelectedItem != null)
            {
                TagEntity selectedTag = tagComboBx.SelectedItem as TagEntity;
                tagName = selectedTag.TagName;
                if (tagName == "Lab")
                {
                    grp_combobx.DisplayMemberPath = "SubGroupId";
                    grp_combobx.ItemsSource       = _Student_SubGroupViewModel.LoadStudentData();
                }
                else
                {
                    grp_combobx.DisplayMemberPath = "GroupId";
                    grp_combobx.ItemsSource       = _Student_GroupViewModel.LoadStudentData();
                }
                tag_combobx_val = tagName;
                CheckValidations();
                isGrpIdSet = true;
            }
        }
        private void Student_Page_Loaded(object sender, RoutedEventArgs e)
        {
            _studentViewModel = new Student_SubGroupViewModel();

            students = _studentViewModel.LoadStudentData();
            student_data_grid.ItemsSource = students;

            foreach (Student_SubGroupEntity l in students)
            {
                studentIds.Add(l.StudentId);
            }

            add_btn_.IsEnabled    = false;
            update_btn_.IsEnabled = false;
            delete_btn_.IsEnabled = false;
        }