private void butBuscarMasFrecuente_Click(object sender, EventArgs e) { richTextBox1.Clear(); if (selec == true) { double valorInicio = 0; double valorFinal = 0; double aumento = 0; if (listBoxProductos.SelectedItem != null) { String producto = listBoxProductos.SelectedItem.ToString(); labelProducto.Text = producto; //Filtrado de asociaciones try { List <int> mostrar = conexion.mostrarImplicados(producto); double[] precios = conexion.TraerPrecios(producto, mostrar); valorInicio = precios[0]; valorFinal = valorInicio + precios[1]; aumento = precios[2] * 100; for (int i = 0; i < mostrar.Count(); i++) { richTextBox1.Text += mostrar[i] + "\n"; } } catch { MessageBox.Show("No se encuentran implicantes para este producto"); } txtValorInicial.Text = valorInicio + ""; txtValorFinal.Text = valorFinal + ""; txtAumento.Text = aumento + "%"; } else { MessageBox.Show("Primero seleccione algo de la lista."); } } else { MessageBox.Show("Primero genere las asociaciones."); } }