bool EliminarRegistro() { bool booResult = false; int intIdRegistro = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString()); // OBTENEMOS EL ID DEL REGISTRO QUE SE DESEA ELIMINAR DialogResult Rpta = MessageBox.Show("Esta seguro de eliminar el registro seleccionado", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); if (DialogResult.Yes == Rpta) { if (objRegistros.Eliminar(intIdRegistro) == true) { booResult = true; MessageBox.Show("¡ El registro se elimino con exito !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); // VOLVEMOS A CARGAR EL DATATABLE dtItems CON LOS DATOS DEL SERVIDOR objRegistros.mysConec = mysConec; if (n_EsCliPro == 1) { dtRegistros = objRegistros.ListarCliente(STU_SISTEMA.EMPRESAID, STU_SISTEMA.SYS_UNIBD); } else { dtRegistros = objRegistros.ListarProveedor(STU_SISTEMA.EMPRESAID, STU_SISTEMA.SYS_UNIBD); } // MOSTRAMOS LOS DATOS EN LA GRILLA ListarItems(); } else { MessageBox.Show("¡ No se pudo eliminar el registro por el siguiente motivo ! " + objRegistros.StrErrorMensaje, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } } return(booResult); }