private void Modifier_Load(object sender, EventArgs e) { var groupes = from @group in new DataAccess.GroupeDA().Get() select new ComboboxItem() { Text = @group.Nom, Value = @group.Id }; comboBox1.DataSource = groupes.ToList(); var element = new DataAccess.EtudiantDA().Get(Id); txtNom.Text = element.Nom; textBox1.Text = element.Prenom; textBox3.Text = element.Cin; textBox4.Text = element.CodePostal; textBox5.Text = element.Adresse; textBox6.Text = element.Tel; textBox7.Text = element.Email; dateTimePicker1.Value = element.DateNaissance; int i = 0; foreach (ComboboxItem item in comboBox1.Items) { if (Convert.ToInt32(item.Value) == element.GroupId) { comboBox1.SelectedIndex = i; } i++; } }
public Stage(int type, int etudiant, int entreprise) { TypeId = type; EtudiantId = etudiant; EntrepriseId = entreprise; Type = new DataAccess.TypeDA().Get(TypeId); Etudiant = new DataAccess.EtudiantDA().Get(EtudiantId); Entreprise = new DataAccess.EntrepriseDA().Get(EntrepriseId); }