public ActionResult ViewVoting(int votingID)
        {
            var voting = congressVotingRepository.GetById(votingID);

            if (voting == null)
            {
                return(RedirectBackWithError("Voting does not exist!"));
            }

            var vm = CongressViewVotingViewModelChooser.Instantiate(voting, congressVotingService);

            return(View(vm));
        }
Esempio n. 2
0
 public ActionResult FinishCongressVoting(DebugFinishCongressVotingViewModel vm, string whatToDo)
 {
     if (ModelState.IsValid)
     {
         var voting = congressVotingRepository.GetById(vm.VotingID);
         if (whatToDo == "accept")
         {
             congressVotingService.FinishVoting(voting);
         }
         else
         {
             congressVotingService.RejectVoting(voting, CongressVotingRejectionReasonEnum.NotEnoughVotes);
         }
     }
     return(View(vm));
 }