private void SML_Sub_AddSubjectButton(object sender, RoutedEventArgs e) { Subject s1 = new Subject(); s1.ID_Lecturer = lecturer.ID_lecturer; SML_Sub_AddEdit SML_Sub_AddEdit_window = new SML_Sub_AddEdit(1, s1); this.Visibility = Visibility.Hidden; SML_Sub_AddEdit_window.Show(); }
private void SML_Sub_EditButton(object sender, RoutedEventArgs e) { if (subject_grid.SelectedItem != null) { var row_list = (MenuLecturerLogic.SubjectInfo)subject_grid.SelectedItem; string name = row_list.Name; //MessageBox.Show(name); Subject s1 = new Subject(); s1.ID_Subject = (short)row_list.Id; s1.Name = row_list.Name; s1.Description = row_list.Description; s1.ID_Lecturer = lecturer.ID_lecturer; s1.Status = row_list.Status; SML_Sub_AddEdit SML_Sub_AddEdit_window = new SML_Sub_AddEdit(0, s1); this.Visibility = Visibility.Hidden; SML_Sub_AddEdit_window.Show(); } else { MessageBox.Show("Wybierz coś"); } }