Esempio n. 1
0
 public ActionResult RecoveryPassword()
 {
     if (AccountController.CheckSession("token"))
     {
         if (AccountController.GetSession("token") == "true")
         {
             return(View(new LoginViewModel()));
         }
         else
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
Esempio n. 2
0
        // 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"));
            }
        }