示例#1
0
        public async Task <bool> EditQuestion(QuestionEditParam param)
        {
            var question = dBContext.Questions.Find(param.QuestionId);

            question.QBody    = param.QBody;
            question.QSubject = param.QSubject;
            dBContext.SaveChanges();
            return(true);
        }
示例#2
0
        public IActionResult QuestionEdit(QuestionEditParam param)
        {
            var res = SemEvalRepository.EditQuestion(param).Result;

            if (res)
            {
                return(Redirect("/"));
            }
            return(View());
        }
示例#3
0
        public IActionResult QuestionEdit(long id)
        {
            QuestionEditParam model = new QuestionEditParam();
            var _model = SemEvalRepository.GetQuestionByIdAsync(id).Result;

            model.QBody      = _model.QBody;
            model.QSubject   = _model.QSubject;
            model.QuestionId = _model.QuestionId;
            using (TextHelper textHelper = new TextHelper())
            {
                model.QSubjectClean = textHelper.CleanReview(_model.QSubject);
                model.QBodyClean    = textHelper.CleanReview(_model.QBody);
            }
            return(View(model));
        }