private void BtnNew_Click(object sender, RoutedEventArgs e) { WinConfigAddOrEdit win = new WinConfigAddOrEdit(null); win.ShowDialog(); Query(); }
private void BtnEdit_Click(object sender, RoutedEventArgs e) { if (DatagridMain.SelectedItem == null) { MessageBox.Show("请先选中一条数据!"); } else { Config config = (Config)DatagridMain.SelectedItem; WinConfigAddOrEdit win = new WinConfigAddOrEdit(config.Id); win.ShowDialog(); Query(); } }