예제 #1
0
        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();
        }
예제 #2
0
        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();
        }