예제 #1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            ClassManager articlesManager = new ClassManager();

            lstClass.ItemsSource = articlesManager.GetClasse();
            TeachersManager teachersManager = new TeachersManager();

            cbTeacher_Id.ItemsSource = teachersManager.GetTeachers();
        }
예제 #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            TeachersManager teachersManagercs = new TeachersManager();

            lstTeachers.ItemsSource = teachersManagercs.GetTeachers();
            SubjectsManager subjectsManager = new SubjectsManager();

            cbSubject.ItemsSource = subjectsManager.GetSubjects();
        }
예제 #3
0
 private void DeleteTeachers(object sender, RoutedEventArgs e)
 {
     if (txtTeachersId.Text != "")
     {
         TeachersManager teachersManager = new TeachersManager();
         teachersManager.Delete("Teachers", Convert.ToInt32(txtTeachersId.Text));
         //обновить
         lstTeachers.ItemsSource = teachersManager.GetTeachers();
     }
 }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            StudentManager studentManager = new StudentManager();

            lstStudent.ItemsSource = studentManager.GetStudents();
            ClassManager classeManager = new ClassManager();

            cbClass.ItemsSource       = classeManager.GetClasse();
            cbClassFilter.ItemsSource = classeManager.GetClasse();
            //Учителя
            TeachersManager teachersManager = new TeachersManager();

            cbTeachers.ItemsSource = teachersManager.GetTeachers();
            //Предметы
            SubjectsManager subjectsManager = new SubjectsManager();

            cbSubject.ItemsSource = subjectsManager.GetSubjects();
        }
예제 #5
0
 private void AddTeachers(object sender, RoutedEventArgs e)
 {
     if (ValidationPages.CheckValue(txtDateOfBirth, txtFIO, txtPhone, txtAddress, cbSubject, txtError,
                                    "Введите дату", "Введите Фамилию Имя Отчество",
                                    "Напишите свой номер телефона", "Напишите адрес", "Выберите предмет"))
     {
         Teachers teachers = new Teachers();
         teachers.FIO         = txtFIO.Text;
         teachers.DateOfBirth = Convert.ToDateTime(txtDateOfBirth.Text);
         teachers.Address     = txtAddress.Text;
         teachers.Phone       = txtPhone.Text;
         teachers.Subjects_id = Convert.ToInt32(cbSubject.SelectedValue);
         TeachersManager teachersManagercs = new TeachersManager();
         int             newClasseID       = teachersManagercs.InsertSubjects(teachers);
         Console.WriteLine(newClasseID);
         //обновить
         lstTeachers.ItemsSource = teachersManagercs.GetTeachers();
     }
 }