private void FormtipoSala_Load() { if (!BDconnection.verifySGBDConnection()) { return; } if (comboBoxTSala.Items.Count == 0) { return; } String turmaSelected = (String)comboBoxTSala.SelectedItem; SqlCommand cmd = new SqlCommand("select * from SAA.Alunos_Turmas_Do_TipoSala ('" + turmaSelected + "') ", BDconnection.getConnection()); SqlDataReader reader = cmd.ExecuteReader(); listBox3.Items.Clear(); while (reader.Read()) { tipoSala B = new tipoSala(); B.ID_Sala = (int)reader["ID_Sala"]; B.AnoLectivo = (int)reader["AnoLectivo"]; B.ID_Turma = (int)reader["ID_Turma"]; B.TipoSala = reader["tipoSala"].ToString(); B.limiAlunos = (int)reader["Limite_Alunos"]; B.ID_Dep = (int)reader["ID_Dep"]; listBox3.Items.Add(B); } BDconnection.getConnection().Close(); curreteSala = 0; ShowTurma_Prof(); }
public void ShowAlunos_tipoSala() { if (listBox3.Items.Count == 0 | curreteSala < 0) { return; } tipoSala p = new tipoSala(); p = (tipoSala)listBox3.Items[curreteSala]; }