Пример #1
0
 private void Accept()
 {
     using (var context = new BestDbContext())
     {
         var x = context.Contests.Where(d => d.Id == Contest.Id).FirstOrDefault();
         x.GradeId = Contest.GradeId;
         context.Contests.Update(x);
         context.SaveChanges();
     }
     applicationsViewModel.IsOpen = false;
 }
Пример #2
0
        private CompetitionViewModel()
        {
            context = new BestDbContext();

            Competition = new Competition()
            {
                BreakTimes = new ObservableCollection <BreakTime>()
            };

            SaveCommand = new RelayCommand(Save);
            BackCommand = new RelayCommand(Back);
        }
Пример #3
0
        public GradeDialogViewModel(Contest contest, ApplicationsViewModel applicationsViewModel)
        {
            this.applicationsViewModel = applicationsViewModel;


            Contest = contest;
            using (var context = new BestDbContext())
            {
                Grades = context.Grades.ToList();
            }

            AcceptCommand = new RelayCommand(Accept);
        }
Пример #4
0
 public DefaultController(BestDbContext context)
 {
     this.context = context;
 }