private void btnCobrar_Click(object sender, EventArgs e) { cFunciones fun = new cFunciones(); if (Grilla.CurrentRow == null) { MessageBox.Show("Debe seleccionar un registro para continuar "); return; } if (Grilla.CurrentRow.Cells[5].Value.ToString() != "") { MessageBox.Show("Ya se ha cobrado el cheque "); return; } //Clases.cFunciones fun = new Clases.cFunciones(); if (fun.ValidarFecha(txtFechaCobro.Text) == false) { MessageBox.Show("La fecha cobro es incorrecta ", "Sistema"); return; } string Entregado = Grilla.CurrentRow.Cells[9].Value.ToString(); 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 = "COBRO DE CHEQUE " + NumeroCheque.ToString(); if (Entregado != "") { Descripcion = Descripcion + ", " + Entregado; } cChequeCobrar cheque = new cChequeCobrar(); cMovimiento mov = new cMovimiento(); cheque.CobroCheque(FechaCobro, CodCheque); mov.RegistrarMovimientoDescripcion(-1, Principal.CodUsuarioLogueado, Importe, 0, 0, 0, 0, FechaCobro, Descripcion); Buscar(); MessageBox.Show("Datos grabados correctamente "); }