コード例 #1
0
ファイル: DrugView.xaml.cs プロジェクト: PavelFlegr/mlekarna
        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);
                }
            }
        }
コード例 #2
0
        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();
                }
            }
        }