public ActionResult Create(AnsweredSurvey answeredSurvey)
 {
     try
     {
         _iFAnsweredSurvey.Create(answeredSurvey);
         return(RedirectToAction("Index", "AnsweredQuestion", new { Name = answeredSurvey.Name }));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }
Ejemplo n.º 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));
     }
 }
        public ActionResult Create(AnsweredSurvey answeredSurvey)
        {
            try
            {
                //foreach (var answeredsurvey in answeredsurveys)
                //{
                _iFAnsweredSurvey.Create(answeredSurvey);
                return(RedirectToAction("Index", "AnsweredQuestion", new { Name = answeredSurvey.Name }));
                //}

                //return View(/*new AnsweredQuestion()*/);
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
        }