private void btnAdd_Click(object sender, RoutedEventArgs e) { StudentAdd studentWindow = new StudentAdd(); studentWindow.btnUpdate.Visibility = Visibility.Hidden; ShowNewWindow(studentWindow); }
private void ShowNewWindow(StudentAdd studentUpWindow) { studentUpWindow.Factory = factory; studentUpWindow.Connection = connection; studentUpWindow.Owner = this; studentUpWindow.Show(); }
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); } }