// GET: Surveys/Create public ActionResult Create(string error) { if (AccountController.CheckPermission("Survey-Create")) { if (error != null) { ModelState.AddModelError("Questions", error); } UpdateList(); System.Web.HttpContext.Current.Session["action"] = "Survey-Create"; if (AccountController.CheckSession("Edit")) { ViewBag.edit = true; AccountController.ClearSession("Edit"); } else { ViewBag.edit = false; } ViewBag.SurveyTypeId = new SelectList(listSurveyType, "Id", "Type"); ViewBag.UserId = new SelectList(listUser, "Id", "Username"); QuestionsController q = new QuestionsController(); ViewBag.QuestionTypeId = new SelectList(q.GetQuestionType(), "Id", "Type"); if (AccountController.CheckSurveyId()) { return(View(AccountController.GetSurvey())); } return(View()); } else { return(RedirectToAction("Index", "Home")); } }