private void facturasGrid_CellClick(object sender, DataGridViewCellEventArgs e) { string numero_tel = GridViewObj.objCell(facturasGrid, e.RowIndex, 0).Value.ToString(); var totalCalculos = Datos.listDetallesNumero(listxls, numero_tel); var numDetalles = Datos.numDetalles(listDetallesCargos, numero_tel); txt_numCel.Text = numDetalles.numero_tel; txtValorFac.Text = numDetalles.valor.ToString(); txtIvaFac.Text = totalCalculos.Sum(x => x.iva).ToString(); txtImpFac.Text = totalCalculos.Sum(x => x.imp).ToString(); txtTotalFac.Text = numDetalles.total.ToString(); facturaDetallesGrid.DataSource = Datos.valoresPositivos(totalCalculos); facturaDetallesDescuentos.DataSource = Datos.valoresDescuentos(totalCalculos); }
// Este evento se utiliza para validar que el txt tenga un valor de tipo double private void txtImp_KeyUp(object sender, KeyEventArgs e) { lblAlertImp.Visible = !double.TryParse(txtImp.Text, out double n) ? true : false; GridViewObj.objCell(cuadroGrid, 2, 2).Value = n.ToString(); }
//-------------------------------------------------- //Calcula las diferencias entre cuadro y factura //-------------------------------------------------- private void btnCalcular_Click(object sender, EventArgs e) { GridViewObj.objCell(cuadroGrid, 8, 2).Value = Math.Round(double.Parse(txtGastosC.Text) + double.Parse(txtIva.Text) + double.Parse(txtImp.Text) + double.Parse(txtOtro.Text), 2); Diferencias.calcularDiferencias(cuadroGrid, new string[] { txtGastosC.Text, txtIva.Text, txtImp.Text }); txtResumen.Text = data.resumen(GridViewObj.objCell(cuadroGrid, 8, 3).Value.ToString()); }