コード例 #1
0
ファイル: RoundBetsController.cs プロジェクト: szilardd/Bets
        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));
        }
コード例 #3
0
        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;
            }
        }