예제 #1
0
        public ActionResult CommencerQuestionnaire()
        {
            Elements element = new Elements();

            if (DALSession.sessionStart == 1)
            {
                return(RedirectToAction("RetourElementEnCours", "UserQuestionnaire"));
            }

            try
            {
                DALSession.nombreElements = DALElement.SelectAllFromQuestionnaire(DALSession.questionnaire.Id).Count;
                DALSession.lastElement    = DALElement.SelectLastElement(DALSession.questionnaire.Id);
                DALSession.sessionStart   = 1;
                element              = DALElement.FindElementByOrdre(DALSession.numElement, DALSession.questionnaire.Id);
                DALSession.element   = element;
                DALSession.dateDebut = DateTime.Now;
                DALSession.listeIdElement.Add(DALSession.element.Id);
                DALSession.nombreQuestionsQuestionnaire = DALElement.SelectAllQuestionFromQuestionnaire(DALSession.questionnaire.Id).Count;
            }
            catch (Exception e)
            {
                Tools.Logger.Ecrire(Tools.Logger.Niveau.Erreur, string.Format("CommencerQuestionnaire.UserQuestionnaire.Exception(Exception: {0})", e));
                return(RedirectToAction("Index", "UserQuestionnaire", new { error = ErrorList.commencerQuestionnaire }));
            }
            if (element.TypeElement_Id == 1)
            {
                return(RedirectToAction("SuiteDescription", "UserQuestionnaire"));
            }
            else
            {
                return(RedirectToAction("SuiteQuestion", "UserQuestionnaire"));
            }
        }