コード例 #1
0
        public IActionResult Action(decimal id, ActionViewModel actionViewModel)
        {
            Groep groep = _groepRepository.GetById(id);

            if (groep == null)
            {
                return(NotFound());
            }

            Pad pad = groep.getCurrentGroepPad(groep.Progress).Paden;

            if (pad.Toegangscode.Code == actionViewModel.Toegangscode)
            {
                groep.VerhoogProgress();

                _groepRepository.SaveChanges();

                return(RedirectToAction("Start", "Groep", new { Id = groep.Id }));
            }
            else
            {
                if (groep.Fout == 3)
                {
                    groep.Blok();
                }
                else
                {
                    groep.VerhoogFout();
                }
            }

            return(View(new ActionViewModel(pad, groep, false)));
        }
コード例 #2
0
        public IActionResult Action(decimal id)
        {
            Groep groep = _groepRepository.GetById(id);

            if (groep == null)
            {
                return(NotFound());
            }

            if (groep.getCurrentGroepPad(groep.Progress).Paden.ActieNaamNavigation == null)
            {
                return(View(new ActionViewModel(groep.getCurrentGroepPad(groep.Progress).Paden, groep, true,
                                                "Zoek de schatkist")));
            }

            return(View(new ActionViewModel(groep.getCurrentGroepPad(groep.Progress).Paden, groep, false)));
        }
コード例 #3
0
        public IActionResult Feedback(decimal id)
        {
            Groep groep = _groepRepository.GetById(id);

            if (groep == null)
            {
                return(NotFound());
            }

            string feedback = groep.getCurrentGroepPad(groep.Progress).Paden.OefeningNaamNavigation.Feedback;

            getFile(feedback);

            return(View(new FeedbackViewModel(groep, feedback)));
        }