Exemplo n.º 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;
 }
Exemplo n.º 2
0
        private CompetitionViewModel()
        {
            context = new BestDbContext();

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

            SaveCommand = new RelayCommand(Save);
            BackCommand = new RelayCommand(Back);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 public DefaultController(BestDbContext context)
 {
     this.context = context;
 }