private void AddNewSponsorButtonClick(object sender, RoutedEventArgs e) { var addPersonView = new AddPersonView(); addPersonView.ShowDialog(); if (addPersonView.DialogResult.HasValue && addPersonView.DialogResult.Value) { context.Person.Add(addPersonView.Person); this.Runner.RunnerSponsor.Add(new RunnerSponsor { Betrag = 0, Person = this.Runner, Person1 = addPersonView.Person }); } }
private void AddNewSponsorButtonClick(object sender, RoutedEventArgs e) { var addPersonView = new AddPersonView(); addPersonView.ShowDialog(); if (addPersonView.DialogResult.HasValue && addPersonView.DialogResult.Value) { context.Person.Add(addPersonView.Person); this.Runner.RunnerSponsor.Add(new RunnerSponsor { Betrag = 0, Person = this.Runner, Person1 = addPersonView.Person }); } }