public async Task <IActionResult> AddQuestionnaire(QuestionnaireModel model, int newId) { model.QuestionnaireId = newId; model.isSubmitted = false; if (ModelState.IsValid) { await questionnaireService.AddQuestionnaire(model, newId); model.isSubmitted = true; return(View(model)); } else { return(View(model)); } }