Пример #1
0
        public ActionResult EditVoteResult(int Id = -1, int resultId = -1)
        {
            VoteResultInfo voteResultInfo = Vote.GetVoteResult(resultId);

            if (voteResultInfo == null)
            {
                return(PromptView("投票结果不存在"));
            }

            VoteResultModel model = new VoteResultModel
            {
                VoteId       = voteResultInfo.VoteId,
                DisplayOrder = voteResultInfo.DisplayOrder,
                Result       = voteResultInfo.Result,
                Count        = voteResultInfo.Count
            };

            return(View(model));
        }
Пример #2
0
        public ActionResult EditVoteResult(VoteResultInfo model, int Id = -1, int resultId = -1)
        {
            VoteResultInfo voteResultInfo = Vote.GetVoteResult(resultId);

            if (voteResultInfo == null)
            {
                return(PromptView("投票结果不存在"));
            }

            if (ModelState.IsValid)
            {
                voteResultInfo.DisplayOrder = model.DisplayOrder;
                voteResultInfo.Result       = model.Result;
                voteResultInfo.Count        = model.Count;

                Vote.UpdateVoteResults(voteResultInfo);

                return(PromptView("投票结果修改成功"));
            }
            ;

            ViewData["referer"] = SiteUtils.GetAdminRefererCookie();
            return(View(model));
        }