private void btnAdd_Click(object sender, RoutedEventArgs e) { DeptEditWindow win = new DeptEditWindow(); win.IsAddNew = true; if (win.ShowDialog() == true) { ReloadData(); } }
private void datagrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { Department dept = datagrid.SelectedItem as Department; if (dept != null) { DeptEditWindow win = new DeptEditWindow(); win.IsAddNew = false; win.EditingId = dept.Id; if (win.ShowDialog() == true) { ReloadData(); } } }