private void DataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { Student tmp = (Student)DataGrid.SelectedItem; Window dodajStudenta = new StudentWindow(tmp); dodajStudenta.ShowDialog(); new DB().EditStudent(tmp); SetDataGrid(); }
private void Add_Click(object sender, RoutedEventArgs e) { Student tmp = new Student(); Window dodajStudenta = new StudentWindow(tmp); dodajStudenta.ShowDialog(); if (!string.IsNullOrWhiteSpace(tmp.LastName)) { list.Add(tmp); new DB().AddStudent(tmp); } SetDataGrid(); }