/// <summary> /// Carga inicial de datos del formulario /// </summary> private void Inicio() { if (ClassPrestamos.Leer() == true) //carga datos al datagredview { while (Prestamo.Lector.Read()) //datos de la bd { dGvPrestamos.Rows.Add(Prestamo.Lector.GetString(0), Prestamo.Lector.GetString(1), Prestamo.Lector.GetString(2), Prestamo.Lector.GetString(3), Prestamo.Lector.GetString(4), Prestamo.Lector.GetString(5)); // cargar datos } //basedatos.DesconectarDB(); } else { DialogResult dialog = MessageBox.Show("Error al leer datos. " + Prestamo.Error, "Error al leer datos", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// Carga inicial del formularop /// </summary> private void Inicio() { dGvPrestamos.Rows.Clear(); //limpia datgrid cBbumDeudor.Items.Clear(); //limpia combo de deudor CbNumPrenda.Items.Clear(); //limpia combo de prenda monto = false; plazo = false; // inicio leer deudores if (ClassDeudores.Leer() == true) //carga comnboox con deudores { while (Deudores.Lector.Read()) { cBbumDeudor.Items.Add(Deudores.Lector.GetString(0)); } } // fin leer deudores // inicio leer prendas if (ClassPrenda.Leer() == true) { while (Prenda.Lector.Read()) { CbNumPrenda.Items.Add(Prenda.Lector.GetString(0)); } } // fin leer prendas // inicio de carga prestamos if (ClassPrestamos.Leer() == true) //carga datos al datagredview { while (Prestamo.Lector.Read()) //datos de la bd { dGvPrestamos.Rows.Add(Prestamo.Lector.GetString(0), Prestamo.Lector.GetString(1), Prestamo.Lector.GetString(2), Prestamo.Lector.GetString(3), Prestamo.Lector.GetString(4), Prestamo.Lector.GetString(5)); // cargar datos } } else { DialogResult dialog = MessageBox.Show("Error al leer datos. " + Prestamo.Error, "Error al leer datos", MessageBoxButtons.OK, MessageBoxIcon.Error); } // fin de carga de prestamos }