Пример #1
0
        // delete vote will reorder page for each deleted vote choice, and display page again.
        public ActionResult DeleteUserVote(int choiceItemId, int pollId)
        {
            var    currentUser = _orchardServices.WorkContext.CurrentUser;
            string user        = currentUser == null ? "Anonymous" : currentUser.UserName;
            var    choice      = _pollService.GetChoices(pollId).Where(c => c.Id == choiceItemId).FirstOrDefault();

            _votingService.DeleteUserVote(choice, user);

            return(RedirectToAction("GetPoll", new { pollId = pollId }));
        }