コード例 #1
0
        public ActionResult Index(ProposalModel model)
        {
            List <OptionModel> lst = new List <OptionModel>();

            foreach (var item in model.SelectedOptions)
            {
                lst.Add(new OptionModel {
                    IdOption = Convert.ToInt32(item)
                });
            }

            VotesModel vote = new VotesModel {
                Email = ((UserModel)Session["User"]).Email, Options = lst, ContracEthereumProposal = Session["propId"].ToString()
            };

            ProposalBussiness propBuss = new ProposalBussiness();

            bool resp = propBuss.DoVote(vote);

            //save
            if (resp)
            {
                return(RedirectToAction("Proposal", "ProposalList"));
            }

            return(RedirectToAction("Proposal", "ProposalList"));
        }
コード例 #2
0
        public bool DoVote(VotesModel vote)
        {
            ProposalBussiness bussiness = new ProposalBussiness();

            return(bussiness.DoVote(vote));
        }