private void btnAdd_Click(object sender, RoutedEventArgs e) { JudgesAdd judgesAdd = new JudgesAdd(context); judgesAdd.ShowDialog(); if (judgesAdd.NewJudge != null) { context.Judges.Local.Add(judgesAdd.NewJudge); } context.SaveChanges(); }
private void btnAddJudge_Click(object sender, RoutedEventArgs e) { JudgesAdd judgesAdd = new JudgesAdd(context); judgesAdd.ShowDialog(); if (judgesAdd.NewJudge != null) { context.Judges.Local.Add(judgesAdd.NewJudge); } context.SaveChanges(); cmbBoxJudges.ItemsSource = context.Judges.Local.OrderBy(p => p.JudgeLastName).ToList(); }