public void VerPrestamosPendientes(VistaPrestamosPendientes vistaPrestamosPendientes) { Boolean hayPrestamosPendientes = false; this.vistaPrestamosPendientes = vistaPrestamosPendientes; List <Prestamo> listaPrestamos = this.repositorioPrestamo.Prestamos; foreach (Prestamo prestamo in listaPrestamos) { if (prestamo.Estado.Equals("pendiente")) { this.vistaPrestamosPendientes.MostrarRegistro(prestamo.Atributos); hayPrestamosPendientes = true; } } if (hayPrestamosPendientes) { this.vistaPrestamosPendientes.Show(); } else { this.vistaPrestamo.MostrarMensaje("ACTUALMENTE NO HAY PRÉSTAMOS PENDIENTES"); } }
private void verPrestamosPendientesButton_Click(object sender, EventArgs e) { try { VistaPrestamosPendientes vistaPrestamosPendientes = new VistaPrestamosPendientes(this, this.gestorPrestamo); this.gestorPrestamo.VerPrestamosPendientes(vistaPrestamosPendientes); } catch (Exception ex) { MessageBox.Show(ex.Message); } }