コード例 #1
0
ファイル: AccountController.cs プロジェクト: pakoito/web
        public ActionResult VideoVote(int video_vote)
        {
            mu = Membership.GetUser();

            Contest contest = Contest.GetLastContest();

            ViewBag.Contest = contest;

            if (ContestVideo.IsUserContestVoted(Convert.ToInt32(mu.ProviderUserKey), contest.ContestID))
            {
                LoadContestResults();
                return View();
            }

            ContestVideo convid = new ContestVideo();

            convid.GetContestVideoForContestAndVideo(video_vote, contest.ContestID);

            ContestVideoVote cvv = new ContestVideoVote();

            cvv.UserAccountID = Convert.ToInt32(mu.ProviderUserKey);
            cvv.CreatedByUserID = Convert.ToInt32(mu.ProviderUserKey);
            cvv.ContestVideoID = convid.ContestVideoID;

            cvv.Create();

            LoadContestResults();

            return View();
        }
コード例 #2
0
        public ActionResult VideoVote(int videoVote)
        {
            Contest contest = Contest.GetLastContest();

            ViewBag.Contest = contest;

            if (_mu != null && ContestVideo.IsUserContestVoted(Convert.ToInt32(_mu.ProviderUserKey), contest.ContestID))
            {
                LoadContestResults();
                return View();
            }

            var convid = new ContestVideo();

            convid.GetContestVideoForContestAndVideo(videoVote, contest.ContestID);

            if (_mu != null)
            {
                var cvv = new ContestVideoVote
                {
                    UserAccountID = Convert.ToInt32(_mu.ProviderUserKey),
                    CreatedByUserID = Convert.ToInt32(_mu.ProviderUserKey),
                    ContestVideoID = convid.ContestVideoID
                };

                cvv.Create();
            }

            LoadContestResults();

            return View();
        }