void CambiarComprobante() { clsComp.OpenDB(); datos = clsComp.ObtenerComprobantes(CloudContable.Info[0], FechaInicioD.Value.ToString("yyyy-MM-dd"), FechaFinD.Value.ToString("yyyy-MM-dd"), NFlecha, TipoComprobanteC.SelectedItem.ToString(), 0); Data1.Rows.Clear(); clsComp.ObtenerComprobanteDetalle(datos[0], Data1); clsComp.CloseDB(); NComprobanteT.Text = datos[2]; if (datos[3] == "Diario") { TipoAsientoC.SelectedIndex = 0; } else if (datos[3] == "Ingreso") { TipoAsientoC.SelectedIndex = 1; } else if (datos[3] == "Egreso") { TipoAsientoC.SelectedIndex = 2; } RazonSocialT.Text = datos[4]; GlosaT.Text = datos[5]; NChequeT.Text = datos[6]; FechaComprobanteD.Value = Convert.ToDateTime(datos[7]); USDT.Text = datos[8]; UFVT.Text = datos[9]; ClsPublic.SumarDebeHaberComprobante(Data1, TDebeT, THaberT); }
private void Data1_CellEndEdit(object sender, DataGridViewCellEventArgs e) { if (Data1.Rows[Data1.CurrentCell.RowIndex].Cells[0].Value == null) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[0].Value = ""; } if (Data1.Rows[Data1.CurrentCell.RowIndex].Cells[1].Value == null) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[1].Value = ""; } if (Data1.Columns[e.ColumnIndex].Index == 0) { string[] Data = ClsPublic.ObtenerDataPlanCuentaAutoComplete(Data1.Rows[Data1.CurrentCell.RowIndex].Cells[0].Value.ToString()); Data1.Rows[Data1.CurrentCell.RowIndex].Cells[0].Value = Data[0]; Data1.Rows[Data1.CurrentCell.RowIndex].Cells[1].Value = Data[1]; } else if (Data1.Columns[e.ColumnIndex].Index == 1) { string[] Data = ClsPublic.ObtenerDataPlanCuentaAutoComplete(Data1.Rows[Data1.CurrentCell.RowIndex].Cells[1].Value.ToString()); Data1.Rows[Data1.CurrentCell.RowIndex].Cells[0].Value = Data[0]; Data1.Rows[Data1.CurrentCell.RowIndex].Cells[1].Value = Data[1]; } else if (Data1.Columns[e.ColumnIndex].Index == 3) { try { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[3].Value = Convert.ToDouble(Data1.Rows[Data1.CurrentCell.RowIndex].Cells[3].Value); } catch (FormatException) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[3].Value = 0.00; } } else if (Data1.Columns[e.ColumnIndex].Index == 4) { try { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[4].Value = Convert.ToDouble(Data1.Rows[Data1.CurrentCell.RowIndex].Cells[4].Value); } catch (FormatException) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[4].Value = 0.00; } } if (Data1.Rows[Data1.CurrentCell.RowIndex].Cells[2].Value == null) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[2].Value = GlosaT.Text; } if (Data1.Rows[Data1.CurrentCell.RowIndex].Cells[3].Value == null) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[3].Value = 0.00; } if (Data1.Rows[Data1.CurrentCell.RowIndex].Cells[4].Value == null) { Data1.Rows[Data1.CurrentCell.RowIndex].Cells[4].Value = 0.00; } //ClsPublic.LimpiarDataGridSinCodigo(Data1); ClsPublic.SumarDebeHaberComprobante(Data1, TotalDebeT, TotalHaberT, DiferenciaL); }