예제 #1
0
        public ActionResult Index()
        {
            IndexModel model   = new IndexModel();
            TypeDao    typedao = new TypeDao();

            model.types = typedao.getTypeList();

            QuestionDao questiondao = new QuestionDao();

            model.questions = questiondao.getAll(0, 6);
            for (int i = 0; i < model.questions.Count; i++)
            {
                model.questions[i].optionData = questiondao.getOptionData(model.questions[i]).Replace(" ", "").Replace("\n", "").Replace("\t", "").Replace("\r", "");
                model.questions[i].voteCount  = questiondao.getVoteCount(model.questions[i]);
            }
            return(View(model));
        }