private void btnCrear_Click(object sender, EventArgs e) { int q; for (q = 0; q < listaSeleccionados.Count; q++) { listaSeleccionadosID.Add(Convert.ToInt32(listaSeleccionados.ElementAt(q).Replace("E", ""))); } bool verificador = true; int j; for (j = 0; j < listaSeleccionadosID.Count; j++) { if (ConexionMetodos.AsociaUser(idSprint, listaSeleccionadosID.ElementAt(j)) == -1) { verificador = false; } else { verificador = true; } } if (verificador) { MessageBox.Show("Se guardaron los datos exitosamente", "Éxito", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); } else { MessageBox.Show("Ha ocurrido un error,intentelo de nuevo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }