Esempio n. 1
0
        public ActionResult ValueGame(LastGameViewModel vM = null)
        {
            if (vM == null)
            {
                vM = new LastGameViewModel();
            }

            if (!ChechDate(vM.StarDate, vM.LastDate))
            {
                vM.StarDate  = null;
                vM.LastDate  = null;
                vM.CountGame = _repositoryGame.GetOverviewAll().ToList().Count();
            }
            else
            {
                Func <Game, bool> predicate = x => x.Date > DateTime.Parse(vM.StarDate) && x.Date < DateTime.Parse(vM.LastDate);
                vM.CountGame = _repositoryGame.GetOverviewAll(predicate).ToList().Count();
            }


            if (Request.IsAjaxRequest())
            {
                return(PartialView("_ValueGame", vM));
            }


            return(View(vM));
        }
Esempio n. 2
0
        public ActionResult LastGame()
        {
            Func <Game, bool> predicate = x => x.UserId == User.Identity.GetUserId();
            var allGame = _gameRepository.GetOverviewAll(predicate).OrderByDescending(x => x.Date).ToList();

            return(View(allGame));
        }
Esempio n. 3
0
        private List <Question> QuestionToRandom(int categoryID)
        {
            int lvlQuestion = GetLvlQuestion();

            Func <Question, bool> predicate = x => x.CategoryDictId == categoryID && (int)x.Level == lvlQuestion;

            return(_questionRepository.GetOverviewAll(predicate).ToList());
        }
Esempio n. 4
0
        public ActionResult Index()
        {
            var lastTenGame = _repositoryGame.GetOverviewAll().OrderByDescending(x => x.Date).Take(10).ToList();

            return(View(lastTenGame));
        }