private void btnLook_Click(object sender, EventArgs e) { if (selection.SelectedCount == 1) { int RowIndex = selection.GetSelectedRowIndex(0); int RowHandle = gridView1.GetRowHandle(RowIndex); string strRoleid = this.gridView1.GetRowCellDisplayText(RowHandle, "ROLE_ID"); RoleEdit RoleEdit = new RoleEdit(strRoleid); RoleEdit.Tag = "LOOK"; RoleEdit.Text = "角色查看"; RoleEdit.ShowDialog(); } else { MessageBox.Show("请选择一项进行修改"); } selection.ClearSelection(); }
private void btnEdit_Click(object sender, EventArgs e) { if (selection.SelectedCount == 1) { int RowIndex = selection.GetSelectedRowIndex(0); int RowHandle = gridView1.GetRowHandle(RowIndex); string strRoleid = this.gridView1.GetRowCellDisplayText(RowHandle, "ROLE_ID"); RoleEdit RoleEdit = new RoleEdit(strRoleid); RoleEdit.Tag = "ALTER"; RoleEdit.Text = "角色修改"; if (RoleEdit.ShowDialog() == DialogResult.OK) { unitOfWork1.DropIdentityMap(); xpServerCollectionSource1.Reload(); this.gridView1.BestFitColumns(); } } else { MessageBox.Show("请选择一项进行修改"); } selection.ClearSelection(); }