private void ButtonUpdatePack_Click(object sender, RoutedEventArgs e) { Pack pack = (Pack)ListPack.SelectedItem; if (pack != null) { PackWindow packWindow = new PackWindow(db); packWindow.DataContext = pack; packWindow.ShowDialog(); if (packWindow.DialogResult == true) { db.SaveChanges(); } } else { MessageBox.Show("Vous n'avez séléctionné aucun client."); } }
private void ButtonAddPack_Click(object sender, RoutedEventArgs e) { Pack pack = new Pack(); PackWindow packWindow = new PackWindow(db); packWindow.DataContext = pack; packWindow.ShowDialog(); if (packWindow.DialogResult == true) { Packs.Add(pack); db.Pack.Add(pack); db.SaveChanges(); } }