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_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { TextBox autoText = e.Control as TextBox; autoText.AutoCompleteMode = AutoCompleteMode.Suggest; autoText.AutoCompleteSource = AutoCompleteSource.CustomSource; if (Data1.CurrentCell.ColumnIndex == 0) { if (autoText != null) { autoText.AutoCompleteCustomSource = ClsPublic.CargatAutoCompleteCodigo(); } } else if (Data1.CurrentCell.ColumnIndex == 1) { if (autoText != null) { autoText.AutoCompleteCustomSource = ClsPublic.CargatAutoCompleteCuenta(); } } else { autoText.AutoCompleteCustomSource = null; } }
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); }
public static void CargarForm(object formulario) { ClsPublic.Ocultar(ContenidoC); ContenidoC.Controls.Clear(); Control fh = formulario as Control; ContenidoC.Controls.Add(fh); ClsPublic.Animar(ContenidoC); }
public static void AgregarC(Control cont) { ClsPublic.Ocultar(ContenidoC); Control fh = cont as Control; ContenidoC.Controls.Add(fh); int i = ContenidoC.Controls.Count; ContenidoC.Controls[0].Visible = false; ClsPublic.Animar(ContenidoC); }
public static void CargarC(Control cont) { ClsPublic.Ocultar(ContenidoC); ContenidoC.Controls.Clear(); Control fh = cont as Control; ContenidoC.Controls.Add(fh); ClsPublic.Animar(ContenidoC); //ContenidoC.Controls.Clear(); //ContenidoC.Controls.Add(cont); }
public void ObtenerComprobanteDetalle(string idcomprobante, DataGridView data) { if (conexion.State == ConnectionState.Open) { MySqlDataAdapter tabla; DataTable datatable = new DataTable(); string comando = "CALL obtenerComprobantesDetalle({0})"; string cmd = string.Format(comando, idcomprobante); tabla = new MySqlDataAdapter(cmd, conexion); tabla.Fill(datatable); foreach (DataRow dtRow in datatable.Rows) { data.Rows.Add(dtRow[2], ClsPublic.ObtenerNombreCuenta(dtRow[2].ToString()), dtRow[3], Convert.ToDouble(dtRow[4]).ToString("N2"), Convert.ToDouble(dtRow[5]).ToString("N2")); } } else { MessageBox.Show("No existe Conexión", "Cloud Contable"); } }
private void CancelarB_Click(object sender, EventArgs e) { ClsPublic.LimpiarDataGridSinCodigo(Data1); if (TotalDebeT.Text == TotalHaberT.Text && Data1.RowCount > 1) { clsComp.OpenDB(); if (!clsComp.ObtenerNComprobante(CloudContable.Info[0]).Equals(NComprobanteT.Text)) { MessageBox.Show("El Número de Comprobante Se ha Actualizado"); } clsComp.RegistrarComprobante(Data1, CloudContable.Info[0], CloudContable.Info[1], clsComp.ObtenerNComprobante(CloudContable.Info[0]), TipoComprobanteC.SelectedItem.ToString(), RazonSocialT.Text, GlosaT.Text, NChequeT.Text, FechaComprobanteD.Value.ToString("yyyy-MM-dd"), TasaUSDT.Text, TasaUFVT.Text); NComprobanteT.Text = clsComp.ObtenerNComprobante(CloudContable.Info[0]); clsComp.CloseDB(); Clear(); } else { MessageBox.Show("No se Puede Registrar el Asiento\n-Revise los totales\n-Revise que la cantidad de cuentas utilizadas", "Cloud Contable"); } }