コード例 #1
0
        public Response <ExamScore> SubmitExam(SubmitExamDTO submitExamDTO)
        {
            IRestResponse        response     = REST.RestClient.Instance.SubmitExam(submitExamDTO);
            Response <ExamScore> responseData = ResponseHelper.GetResponse <ExamScore>(response);

            return(responseData);
        }
コード例 #2
0
        public RestSharp.IRestResponse SubmitExam(SubmitExamDTO submitExamDTO)
        {
            RestSharp.RestRequest request = new RestSharp.RestRequest("exam", RestSharp.Method.PUT);
            request.JsonSerializer = new NewtonsoftJsonSerializer();
            request.AddJsonBody(submitExamDTO);

            RestSharp.IRestResponse response = Execute(request);

            return(response);
        }
コード例 #3
0
 public ActionResult SubmitExam(SubmitExamDTO dto)
 {
     try
     {
         var answerDetail = Request.Params["answerDetail"] ?? Request.Params["AnswerDetail"];
         if (answerDetail.IsNullOrEmpty())
         {
             throw new ArgumentNullException("answerDetail", "参数不能为空");
         }
         dto.AnswerDetail = JsonHelper.FromJson <Answerdetail[]>(answerDetail);
         var res = _examRecordContract.SubmitExam(dto);
         return(Json(res));
     }
     catch (Exception e)
     {
         return(Json(OperationResult.Error(e.Message)));
     }
 }
コード例 #4
0
        public ActionResult SubmitExam(SubmitExamDTO dto)
        {
            var res = _examRecordContract.SubmitExam(dto);

            return(Json(res));
        }