Example #1
0
        public ActionResult Publish(publishModel model)
        {
            if (!ModelState.IsValid)
            {
                model = initPublishModel();
                return(View(model));
            }
            //添加问题
            Question question = new Models.Question();

            question.userID    = new UserDao().getById(model.userID);
            question.title     = model.title;
            question.queDes    = model.queDes;
            question.postTime  = model.postTime;
            question.endTime   = model.endTime;
            question.optionNum = model.optionNum;
            question.tags      = model.tags;
            question.queOption = model.options;

            QuestionDao questiondao = new QuestionDao();

            questiondao.add(question);

            return(RedirectToAction("MyPublish"));
        }
Example #2
0
        //发布问题
        public ActionResult Publish()
        {
            publishModel model = initPublishModel();

            return(View(model));
        }