Exemple #1
0
        private void BtnEliminar_Click(object sender, EventArgs e)
        {
            BtnEliminar.Enabled = false;
            if (DGVPpago.RowCount >= 1)
            {
                int indice;
                indice = DGVPpago.CurrentRow.Index;
                string codigoP;
                codigoP = DGVPpago.Rows[indice].Cells[0].Value.ToString();
                string cap;
                string inter;
                cap   = DGVPpago.Rows[indice].Cells[2].Value.ToString();
                inter = DGVPpago.Rows[indice].Cells[3].Value.ToString();

                if (pag.estadopago(codigoP, CboPresta.Text, cap, inter))
                {
                    MessageBox.Show("El pago ha sido cancelado", "Correcto", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    llenarGrid();
                }
                else
                {
                    MessageBox.Show("El pago no ha podido ser cancelado", "Problema", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
        }