public FrmGestionEleves() { InitializeComponent(); GestionInfirmerie classes = new GestionInfirmerie(); List <string> lesClasses = new List <string>(); lesClasses = classes.recupererInfosClasses(); listeClasses.DataSource = lesClasses; GestionInfirmerie eleves = new GestionInfirmerie(); List <string> lesEleves = new List <string>(); GestionInfirmerie prenoms = new GestionInfirmerie(); List <string> lesPrenoms = new List <string>(); string libClasse = Convert.ToString(listeClasses.SelectedItem); lesEleves = eleves.recupererInfosEleves(libClasse); listeEleves.DataSource = lesEleves; string prenomsEleves = Convert.ToString(listeEleves.SelectedItem); lesPrenoms = prenoms.recupererPrenomsEleves(prenomsEleves); comboBoxPrenoms.DataSource = lesPrenoms; }
private void listeClasses_SelectedIndexChanged(object sender, EventArgs e) { GestionInfirmerie eleves = new GestionInfirmerie(); List <string> lesEleves = new List <string>(); string libClasse = Convert.ToString(listeClasses.SelectedItem); lesEleves = eleves.recupererInfosEleves(libClasse); listeEleves.DataSource = lesEleves; GestionInfirmerie prenoms = new GestionInfirmerie(); List <string> lesPrenoms = new List <string>(); string prenomsEleves = Convert.ToString(listeEleves.SelectedItem); lesPrenoms = prenoms.recupererPrenomsEleves(prenomsEleves); comboBoxPrenoms.DataSource = lesPrenoms; }