示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string input_term;

            if (PageAssemblyContext.Current.DisplayVersion == DisplayVersions.Web)
            {
                urlArgs    = Request.Url.Query.Substring(1);
                input_term = Strings.Clean(Request.Params["term"]);
                CdrID      = Strings.IfNull(Strings.Clean(Request.Params["id"]), Strings.Clean(Request.Params["cdrid"]));
                AudienceType   audience   = GetAudienceType(Strings.Clean(Request.Params["version"]));
                DictionaryType dictionary = GetDictionaryType(Strings.Clean(Request.Params["dictionary"]));

                //load the definition
                DictionaryAppManager _dictionaryAppManager = new DictionaryAppManager();

                DictionaryTerm dataItem = null;

                if (!string.IsNullOrEmpty(CdrID))
                {
                    CdrID = Regex.Replace(CdrID, "^CDR0+", "", RegexOptions.Compiled);
                    // call appropriate method if dictionary type is known
                    // the language is set to English = en by default
                    if (dictionary == DictionaryType.Unknown)
                    {
                        dataItem = _dictionaryAppManager.GetTermForAudience(Convert.ToInt32(CdrID), dictionaryLanguage, "v1", audience);
                    }
                    else
                    {
                        dataItem = _dictionaryAppManager.GetTerm(Convert.ToInt32(CdrID), dictionary, dictionaryLanguage, "v1", audience);
                    }
                }

                if (dataItem != null && dataItem.Term != null)
                {
                    ActivateDefinitionView(dataItem);
                }
                else
                {
                    phDefinition.Visible = false;
                    phNoResult.Visible   = true;
                }

                // Web Analytics *************************************************
                WebAnalyticsPageLoad webAnalyticsPageLoad = new WebAnalyticsPageLoad();

                webAnalyticsPageLoad.SetChannel("Dictionary of Cancer Terms");
                webAnalyticsPageLoad.SetLanguage("en");

                webAnalyticsPageLoad.AddEvent(WebAnalyticsOptions.Events.event11); // Dictionary Term view (event11)
                litOmniturePageLoad.Text = webAnalyticsPageLoad.Tag();             // Load page load script
                // End Web Analytics *********************************************
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string input_term;

            if (PageAssemblyContext.Current.DisplayVersion == DisplayVersions.Web)
            {
                urlArgs    = Request.Url.Query.Substring(1);
                input_term = Strings.Clean(Request.Params["term"]);
                CdrID      = Strings.IfNull(Strings.Clean(Request.Params["id"]), Strings.Clean(Request.Params["cdrid"]));
                AudienceType   audience   = GetAudienceType(Strings.Clean(Request.Params["version"]));
                DictionaryType dictionary = GetDictionaryType(Strings.Clean(Request.Params["dictionary"]));

                if (Request.QueryString["language"] == "Spanish")
                {
                    dictionaryLanguage        = "es";
                    logoAnchor.HRef           = "/espanol";
                    logoImage.Alt             = "Instituto Nacional Del Cáncer";
                    logoImage.Src             = "/publishedcontent/images/images/design-elements/logos/nci-logo-full-es.svg";
                    closeWindowText.InnerText = "Cerrar";
                    definitionLabel.Text      = "Definición:";
                }
                else
                {
                    logoAnchor.HRef           = "/";
                    logoImage.Alt             = "National Cancer Institute";
                    logoImage.Src             = "/publishedcontent/images/images/design-elements/logos/nci-logo-full.svg";
                    closeWindowText.InnerText = "Close Window";
                    definitionLabel.Text      = "Definition:";
                }

                //load the definition
                DictionaryAppManager _dictionaryAppManager = new DictionaryAppManager();

                DictionaryTerm dataItem = null;

                if (!string.IsNullOrEmpty(CdrID))
                {
                    CdrID = Regex.Replace(CdrID, "^CDR0+", "", RegexOptions.Compiled);

                    // call appropriate method if dictionary type is known
                    if (dictionary == DictionaryType.Unknown)
                    {
                        dataItem = _dictionaryAppManager.GetTermForAudience(Convert.ToInt32(CdrID), dictionaryLanguage, "v1", audience);
                    }
                    else
                    {
                        dataItem = _dictionaryAppManager.GetTerm(Convert.ToInt32(CdrID), dictionary, dictionaryLanguage, "v1", audience);
                    }
                }

                if (dataItem != null && dataItem.Term != null)
                {
                    ActivateDefinitionView(dataItem);
                }
                else
                {
                    phDefinition.Visible = false;
                    phNoResult.Visible   = true;
                }

                // Web Analytics *************************************************
                WebAnalyticsPageLoad webAnalyticsPageLoad = new WebAnalyticsPageLoad();

                if (dictionaryLanguage == "es")
                {
                    webAnalyticsPageLoad.SetChannel("Diccionario de cancer (Dictionary of Cancer Terms)");
                    webAnalyticsPageLoad.SetLanguage("es");
                }
                else
                {
                    webAnalyticsPageLoad.SetChannel("Dictionary of Cancer Terms");
                    webAnalyticsPageLoad.SetLanguage("en");
                }
                webAnalyticsPageLoad.AddEvent(WebAnalyticsOptions.Events.event11); // Dictionary Term view (event11)
                litOmniturePageLoad.Text = webAnalyticsPageLoad.Tag();             // Load page load script
                // End Web Analytics *********************************************
            }
        }