Пример #1
0
 public static String GlossarySearch(Int32 idCommunity, GlossaryFilter filter)
 {
     return(string.Format("{0}GlossarySearch.aspx?{1}", ModuleHome, GlossaryQueryString(idCommunity, -1, -1, false, false, true, false, false, filter)));
 }
Пример #2
0
        public static String GlossaryQueryString(Int32 idCommunity, Int64 idGlossary = -1, Int64 idTerm = -1, Boolean isFirstOpen = false, Boolean asAnchor = false, Boolean fromListGlossary = false, Boolean manage = false, Boolean fromViewMap = false, GlossaryFilter filter = null, Int32 fromType = 0, Boolean loadFromCookies = false, string idCookies = "")
        {
            var urlForm = new StringBuilder((idCommunity > -1 ? string.Format("idCommunity={0}", idCommunity) : String.Empty));

            if (idGlossary > 0)
            {
                urlForm.Append(string.Format("&idGlossary={0}", idGlossary));
            }

            if (idTerm > 0)
            {
                urlForm.Append(string.Format("&idTerm={0}", idTerm));
            }

            if (!isFirstOpen)
            {
                urlForm.AppendFormat("&isFirstOpen={0}", isFirstOpen);
            }

            if (fromListGlossary)
            {
                urlForm.AppendFormat("&isFromListGlossary={0}", fromListGlossary);
            }

            if (fromViewMap)
            {
                urlForm.AppendFormat("&fromViewMap={0}", fromViewMap);
            }

            if (fromType > 0)
            {
                urlForm.AppendFormat("&fromType={0}", fromType);
            }

            if (loadFromCookies)
            {
                urlForm.AppendFormat("&loadFromCookies={0}", loadFromCookies);
            }

            if (!String.IsNullOrWhiteSpace(idCookies))
            {
                urlForm.AppendFormat("&idCookies={0}", idCookies);
            }

            //0 -> not set
            //1 -> from glossary
            //2 -> from glossary map
            //3 -> from term view


            if (manage)
            {
                urlForm.Append("&manage=True");
            }

            if (idGlossary > 0 && asAnchor)
            {
                urlForm.AppendFormat("#idGlossary{0}", idGlossary);
            }


            if (filter != null)
            {
                if (!String.IsNullOrWhiteSpace(filter.SearchString))
                {
                    urlForm.AppendFormat("&SearchString={0}", HttpUtility.UrlEncode(filter.SearchString));
                }
                if (!String.IsNullOrWhiteSpace(filter.LemmaString))
                {
                    urlForm.AppendFormat("&LemmaString={0}", HttpUtility.UrlEncode(filter.LemmaString));
                }
                if (!String.IsNullOrWhiteSpace(filter.LemmaContentString))
                {
                    urlForm.AppendFormat("&LemmaContentString={0}", HttpUtility.UrlEncode(filter.LemmaContentString));
                }
                urlForm.AppendFormat("&LemmaSearchType={0}", (Int32)filter.LemmaSearchType);
                urlForm.AppendFormat("&LemmaVisibilityType={0}", (Int32)filter.LemmaVisibilityType);
            }

            return(urlForm.ToString());
        }