private void btnEliminar_Click(object sender, EventArgs e) { cFunciones fun = new cFunciones(); if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar "); return; } if (fun.ValidarFecha(txtFechaCobro.Text) == false) { MessageBox.Show("La fecha de cobro es incorrecta"); return; } if (Grilla.CurrentRow.Cells[5].Value.ToString() == "") { MessageBox.Show("Ya se ha anulado el cheque "); return; } DateTime FechaCobro = Convert.ToDateTime(txtFechaCobro.Text); Int32 CodCheque = Convert.ToInt32(Grilla.CurrentRow.Cells[0].Value.ToString()); Double Importe = fun.ToDouble(Grilla.CurrentRow.Cells[4].Value.ToString()); string NumeroCheque = Grilla.CurrentRow.Cells[2].Value.ToString(); string Descripcion = "ANULACION COBRO DE CHEQUE " + NumeroCheque.ToString(); cChequeCobrar cheque = new cChequeCobrar(); cMovimiento mov = new cMovimiento(); cheque.AnularCheque(CodCheque); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, -1 * Importe, 0, 0, 0, 0, FechaCobro, Descripcion); Buscar(); MessageBox.Show("Datos grabados correctamente "); }