public void loadCombo() { List <Bus> buss = BusDao.findAll(); cbBus.Items.Clear(); foreach (Bus bus in buss) { cbBus.Items.Add(bus.Numero); } List <Chauffeur> chaus = ChauffeurDao.findAll(); cbChauffeur.Items.Clear(); foreach (Chauffeur chau in chaus) { cbChauffeur.Items.Add(chau.Numero); } }
public void DataDriversload() { List <Chauffeur> Buss = ChauffeurDao.findAll(); int i = 0; dgDriver.Rows.Clear(); foreach (Chauffeur chauffeur in Buss) { dgDriver.Rows.Add(); dgDriver.Rows[i].Cells[0].Value = chauffeur.Numero; dgDriver.Rows[i].Cells[1].Value = chauffeur.Nom; dgDriver.Rows[i].Cells[2].Value = chauffeur.Prenom; dgDriver.Rows[i].Cells[3].Value = chauffeur.DateNais; dgDriver.Rows[i].Cells[4].Value = chauffeur.Telephone; dgDriver.Rows[i].Cells[5].Value = chauffeur.Adresse; dgDriver.Rows[i].Cells[6].Value = chauffeur.Permis; dgDriver.Rows[i].Cells[7].Value = chauffeur.Status; i++; } }