コード例 #1
0
        public JsonResult InsertQuestionType(QuestionType questionType)
        {
            JsonResult result = new JsonResult();

            try
            {
                questionType.QuestionTypeID = Guid.NewGuid();
                questionType.CreateTime     = DateTime.Now;
                questionType.Creator        = (Session["user"] as SYS_User)?.UserName;
                bool isSuccess = questionTypeService.InsertQuestionType(questionType);
                log.Info("添加成功");
            }
            catch (Exception e)
            {
                log.Error(e.Message);
            }
            finally
            {
                result = Json(new { msg = "添加成功" }, JsonRequestBehavior.AllowGet);
            }
            return(result);
        }