Пример #1
0
        public IActionResult Svar()
        {
            Models.Student.StudentAnswerModel m = new Models.Student.StudentAnswerModel();
            surveyCode  = Request.Cookies["SurveyCode"];
            cookieCheck = storage.CheckSurveyCode(surveyCode);
            if (cookieCheck == true)
            {
                try
                {
                    store.GetSurveyAnswer(surveyCode, ref surveyFordele, ref surveyForbedringer);
                    m.SurveyFordele      = surveyFordele;
                    m.SurveyForbedringer = surveyForbedringer;

                    return(View(m));
                }
                catch (Exception)
                {
                    return(Redirect("/Student/Svar/"));
                }
            }
            else
            {
                return(Redirect("/Home/Index/"));
            }
        }
Пример #2
0
        public IActionResult Svar(Models.Student.StudentAnswerModel m)
        {
            try
            {
                foreach (var item in surveyFordele)
                {
                    if (m.CheckCheckBox == true)
                    {
                        store.GemStudentCheckBox(item.Answer);
                    }
                }
                foreach (var item in surveyForbedringer)
                {
                    if (m.CheckCheckBox == true)
                    {
                        store.GemStudentCheckBox(item.Answer);
                    }
                }


                Response.Cookies.Delete("SurveyCode");

                return(Redirect("/Student/SvarGemt/"));
            }
            catch (Exception)
            {
                return(Redirect("/Student/Svar/"));
            }
        }
Пример #3
0
        public IActionResult OpretSvar(Models.Student.StudentAnswerModel m)
        {
            try
            {
                storage.GemStudentAnswer(m.FordelList, m.ForbedringList, surveyCode);

                return(Redirect("/Student/OpretSvarGemt/"));
            }
            catch
            {
                return(View(m));
            }
        }