private void comb1_SelectionChanged(object sender, SelectionChangedEventArgs e) { Prepose prep = comb1.SelectedItem as Prepose; tbxNom.Text = Convert.ToString(prep.Nom); tbxPrenom.Text = Convert.ToString(prep.Prenom); tbxspes.Text = Convert.ToString(prep.Specialite); }
private void btnMod_Click(object sender, RoutedEventArgs e) { Prepose rez = (Prepose)comb1.SelectedItem; rez.Nom = tbxNom.Text; rez.Prenom = tbxPrenom.Text; rez.Specialite = tbxspes.Text; db.SaveChanges(); dateprep.ItemsSource = db.Preposes.ToList(); }
private void btnAjouter_Click(object sender, RoutedEventArgs e) { Prepose p1 = new Prepose(); p1.Nom = tbxNom.Text; p1.Prenom = tbxPrenom.Text; p1.Specialite = tbxspes.Text; db.Preposes.Add(p1); db.SaveChanges(); dateprep.ItemsSource = db.Preposes.ToList(); tbxNom.Text = ""; tbxPrenom.Text = ""; tbxspes.Text = ""; }