Exemple #1
0
        private void btnBorrar_Click(object sender, EventArgs e)
        {
            if (this.grdParametro.RowCount > 0)
            {
                //pide confirmación:
                DialogResult confirmacion = MessageBox.Show("¿Está seguro de borrar este Parametro?", "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (confirmacion == DialogResult.No)
                {
                    return;
                }
                ParametroL oParametroL = (ParametroL)this.grdParametro.CurrentRow.DataBoundItem;

                ParametroD oParametroD = new ParametroD(this.cnx);
                oParametroD.borrarParametro(oParametroL);

                if (oParametroD.Error)
                {
                    MessageBox.Show("Error borrando el Parametro: " + oParametroD.ErrorDescription);
                }
                else
                {
                    MessageBox.Show("Parametro borrado!!!");
                    this.cargarGrid();
                }
            }
        }