示例#1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            StudentAdd studentWindow = new StudentAdd();

            studentWindow.btnUpdate.Visibility = Visibility.Hidden;
            ShowNewWindow(studentWindow);
        }
示例#2
0
 private void ShowNewWindow(StudentAdd studentUpWindow)
 {
     studentUpWindow.Factory    = factory;
     studentUpWindow.Connection = connection;
     studentUpWindow.Owner      = this;
     studentUpWindow.Show();
 }
示例#3
0
 private void btnUpdate_Click(object sender, RoutedEventArgs e)
 {
     if (lbStudents.SelectedItem == null)
     {
         MessageBox.Show("Enter Students please)");
     }
     else
     {
         string[]   fio             = lbStudents.SelectedItem.ToString().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
         StudentAdd studentUpWindow = new StudentAdd();
         studentUpWindow.tbName.Text           = fio[0].Trim();
         studentUpWindow.tbSurname.Text        = fio[1].Trim();
         studentUpWindow.cbGroups.SelectedItem = fio[2];
         studentUpWindow.IdStudents            = StudentsList[lbStudents.SelectedIndex];
         ShowNewWindow(studentUpWindow);
     }
 }