public ActionResult GetCurrentVote() { CandidateRepository cr = new CandidateRepository(); List <CandidateModel> NewCanList = cr.GetAllShown(); return(Json(NewCanList)); }
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)); }