private void AddButton_Click(object sender, RoutedEventArgs e) { var w = new SelectSubstance(); if (w.ShowDialog() == true) { foreach (Substance s in w.SelectedSubstances) { DB <DrugSubstance> .AddItem(new DrugSubstance { DrugID = _drug.ID, SubstanceID = s.ID }); _drug.Substances.Add(s); } } }
private void AddButton_Click(object sender, RoutedEventArgs e) { var w = new SelectSubstance(); if (w.ShowDialog() == true) { foreach (Substance s in w.SelectedSubstances) { _customer.Allergies.Add(s); DB <CustomerAllergies> .AddItem(new CustomerAllergies(_customer.ID, s.ID)); _customer.RaisePropertyChanged(); } } }