Ejemplo n.º 1
0
        private void LoadSettings()
        {
            surveyGuid   = WebUtils.ParseGuidFromQueryString("SurveyGuid", Guid.Empty);
            PageId       = WebUtils.ParseInt32FromQueryString("pageid", -1);
            ModuleId     = WebUtils.ParseInt32FromQueryString("mid", -1);
            responseGuid = WebUtils.ParseGuidFromQueryString("ResponseGuid", Guid.Empty);

            if (surveyGuid == Guid.Empty)
            {
                return;
            }

            if (responseGuid == Guid.Empty)
            {
                SurveyResponse response = SurveyResponse.GetFirst(surveyGuid);

                if (response == null)
                {
                    WebUtils.SetupRedirect(
                        this,
                        $"{SiteRoot}/Survey/Surveys.aspx?pageid={PageId.ToInvariantString()}&mid={ModuleId.ToInvariantString()}"
                        );
                }
                else
                {
                    WebUtils.SetupRedirect(
                        this,
                        $"{SiteRoot}/Survey/Results.aspx?SurveyGuid={surveyGuid.ToString()}&ResponseGuid={response.ResponseGuid.ToString()}&pageid={PageId.ToInvariantString()}&mid={ModuleId.ToInvariantString()}"
                        );
                }
            }
            else
            {
                currentResponse  = new SurveyResponse(responseGuid);
                previousResponse = SurveyResponse.GetPrevious(responseGuid);
                nextResponse     = SurveyResponse.GetNext(responseGuid);
            }

            if (surveyGuid != Guid.Empty)
            {
                survey = new Survey(surveyGuid);

                if (survey.SiteGuid != siteSettings.SiteGuid)
                {
                    surveyGuid = Guid.Empty;
                    survey     = null;

                    responseGuid     = Guid.Empty;
                    currentResponse  = null;
                    previousResponse = null;
                    nextResponse     = null;
                }
            }

            AddClassToBody("surveyresults");
        }
Ejemplo n.º 2
0
        private void LoadSettings()
        {
            surveyGuid   = WebUtils.ParseGuidFromQueryString("SurveyGuid", Guid.Empty);
            pageId       = WebUtils.ParseInt32FromQueryString("pageid", -1);
            moduleId     = WebUtils.ParseInt32FromQueryString("mid", -1);
            responseGuid = WebUtils.ParseGuidFromQueryString("ResponseGuid", Guid.Empty);

            if (surveyGuid == Guid.Empty)
            {
                return;
            }


            if (responseGuid == Guid.Empty)
            {
                SurveyResponse response = SurveyResponse.GetFirst(surveyGuid);

                if (response == null)
                {
                    WebUtils.SetupRedirect(this, SiteRoot + "/Survey/Surveys.aspx?pageid=" + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString());
                }
                else
                {
                    WebUtils.SetupRedirect(this, SiteRoot + "/Survey/Results.aspx?SurveyGuid=" + surveyGuid.ToString() +
                                           "&ResponseGuid=" + response.ResponseGuid.ToString() + "&pageid=" + pageId.ToInvariantString() + "&mid=" + moduleId.ToInvariantString());
                }
            }
            else
            {
                currentResponse  = new SurveyResponse(responseGuid);
                previousResponse = SurveyResponse.GetPrevious(responseGuid);
                nextResponse     = SurveyResponse.GetNext(responseGuid);
            }

            if (surveyGuid != Guid.Empty)
            {
                survey = new Survey(surveyGuid);
                if (survey.SiteGuid != siteSettings.SiteGuid)
                {
                    surveyGuid = Guid.Empty;
                    survey     = null;

                    responseGuid     = Guid.Empty;
                    currentResponse  = null;
                    previousResponse = null;
                    nextResponse     = null;
                }
            }
        }