private void comboBoxClasses_SelectedIndexChanged(object sender, EventArgs e) { classe laClasse = comboBoxClasses.SelectedItem as classe; if (laClasse != null) { listBoxClasses.Items.Clear(); textBox1.Text = " "; textBox2.Text = " "; textBox3.Text = " "; textBox4.Text = " "; textBox5.Text = " "; if (laClasse.eleve.Count == 0) { MessageBox.Show("Pas d'élèves dans cette classe !"); } else { foreach (var c in laClasse.eleve) { listBoxClasses.Items.Add(c); } } } }
private void comboBoxClasse_SelectedIndexChanged(object sender, EventArgs e) { classe laClasse = comboBoxClasse.SelectedItem as classe; DataContextGestionNotesDataContext dc = new DataContextGestionNotesDataContext(); var lesMatieres = (from c in dc.matiere select c).ToList(); textBoxNote.Enabled = false; if (laClasse != null) { listBoxEleve.Items.Clear(); comboBoxMatiere.Items.Clear(); textBoxNom.Text = " "; textBoxPrenom.Text = " "; textBoxNote.Text = " "; if (laClasse.eleve.Count == 0) { MessageBox.Show("Pas d'élèves dans cette classe !"); } else { comboBoxDevoir.Enabled = false; foreach (var c in laClasse.eleve) { listBoxEleve.Items.Add(c); } foreach (var n in lesMatieres) { comboBoxMatiere.Items.Add(n); } } } }
partial void Deleteclasse(classe instance);
partial void Updateclasse(classe instance);
partial void Insertclasse(classe instance);