コード例 #1
0
 public JsonResult Create(AnsweredQuestion answeredquestion)
 {
     try
     {
         answeredquestion = _iFAnsweredQuestion.Create(answeredquestion);
         return(Json(""));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }
コード例 #2
0
 public ActionResult Create(AnsweredSurvey answeredSurvey)
 {
     try
     {
         var result = _iFAnsweredSurvey.Create(answeredSurvey);
         foreach (var answeredQuestion in answeredSurvey.AnsweredQuestions)
         {
             answeredQuestion.AnsweredSurveyId = result.AnsweredSurveyId;
             _iFAnsweredQuestion.Create(answeredQuestion);
         }
         return(RedirectToAction("Answered", "AnsweredSurvey", new { answeredSurveyId = result.AnsweredSurveyId }));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }