public JsonResult Create(AnsweredQuestion answeredquestion) { try { answeredquestion = _iFAnsweredQuestion.Create(answeredquestion); return(Json("")); } catch (Exception ex) { return(Json(ex)); } }
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)); } }