예제 #1
0
        protected override void SetIndexData()
        {
            base.SetIndexData();
            var rounds = new RoundRepository().GetFinishedRounds(DataExtensions.UserIsAdmin());

            ViewData.Model = rounds.GetEnumerator();

            if (rounds.Count() > 0)
            {
                ViewBag.FirstRoundID = rounds.First().ID;
            }
        }
예제 #2
0
        public ActionResult Index(int userID)
        {
            var winners = new WinnerRepository().GetWinnerForUserBets(userID);
            var winner  = new TeamModel();

            ViewBag.Count = 0;
            if (winners.Count() > 0)
            {
                winner        = winners.First();
                ViewBag.Count = 1;
            }
            ViewBag.Expired = DataExtensions.UserIsAdmin() || expired;

            return(View(winner));
        }
        public ActionResult Index(int userID)
        {
            var goalscorers = new GoalscorerRepository().GetGoalScorerForUserBets(userID);
            var goalscorer  = new GoalscorerModel();

            ViewBag.Count = 0;

            if (goalscorers.Count() > 0)
            {
                goalscorer    = goalscorers.First();
                ViewBag.Count = 1;
            }

            ViewBag.Expired = DataExtensions.UserIsAdmin() || expired;

            return(View(goalscorer));
        }
예제 #4
0
        protected override void SetIndexData()
        {
            base.SetIndexData();
            var users = new UserRepository().GetActiveUsers().OrderByDescending(e => e.PointsWonBonus);

            ViewBag.Users             = users.GetEnumerator();
            ViewBag.GlobalBetsExpired = new MatchRepository().GlobalBetsExpired();

            if (users.Count() > 0)
            {
                ViewBag.FirstUserID = users.First().UserID;
            }

            var rounds = new RoundRepository().GetFinishedRounds(DataExtensions.UserIsAdmin());

            ViewBag.Rounds = rounds.GetEnumerator();

            if (rounds.Count() > 0)
            {
                ViewBag.FirstRoundID = rounds.First().ID;
            }
        }