Пример #1
0
        public ActionResult GetCurrentVote()
        {
            CandidateRepository   cr         = new CandidateRepository();
            List <CandidateModel> NewCanList = cr.GetAllShown();

            return(Json(NewCanList));
        }
Пример #2
0
        public ActionResult GetVoteList()
        {
            CandidateRepository   cr         = new CandidateRepository();
            List <CandidateModel> canList    = cr.GetAllShown();
            List <object>         returnList = new List <object>();

            foreach (CandidateModel cm in canList)
            {
                returnList.Add(new { Id = cm.Id, Name = cm.Name, Department = cm.Department, Role = cm.Role, Introduction = cm.Introduction, Story = cm.Story, BidCount = cm.BidCount });
            }
            return(Json(returnList));
        }