private void BtnEdit_Click(object sender, RoutedEventArgs e) { if (DatagridMain.SelectedItem == null) { MessageBox.Show("请先选中数据"); } else { Role role = (Role)DatagridMain.SelectedItem; WinRoleAddOrEdit roleAddOrEdit = new WinRoleAddOrEdit(role.Id); roleAddOrEdit.ShowDialog(); } }
private void BtnNew_Click(object sender, RoutedEventArgs e) { WinRoleAddOrEdit roleAddOrEdit = new WinRoleAddOrEdit(null); roleAddOrEdit.ShowDialog(); }