public static string GenerateCerblobMenu(string slug, int PageID)
        {
            Site         site    = SiteCacher.GetCached();
            List <Pages> lstPage = site.Pages.Where(pg => (pg.StartDate == null ? DateTime.Now.Date : pg.StartDate.Value) <= DateTime.Now.Date && (pg.EndDate == null ? DateTime.Now.Date : pg.EndDate.Value) >= DateTime.Now.Date && pg.PageStatusID == (int)PageStatus.Show && WBSSLStore.Web.Util.WBSiteSettings.AllowedBrand(site).Contains(pg.BrandID.ToString())).OrderBy(pg => pg.ParentID).ThenBy(pg => pg.DisplayOrder).ThenBy(pg => pg.BrandID).ThenBy(pg => pg.ID).ToList();

            site = null;
            if (lstPage != null && lstPage.Count > 0)
            {
                return(GenerateCertblobSubMenu(lstPage.Where(pg => (pg.ParentID == PageID || pg.slug.ToLower().Equals(slug)) && pg.ParentID != 0).ToList(), lstPage));
            }
            return(string.Empty);
        }
        public static bool FooterPage(string fPage)
        {
            Site         site    = SiteCacher.GetCached();
            List <Pages> lstpage = site.Pages.Where(pg => pg.PageStatusID == (int)PageStatus.Show && pg.Caption.ToString().Trim().ToLower() == fPage.ToString().Trim().ToLower()).ToList();

            if (lstpage.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public static bool ShowMalware(List <ProductPricing> _ProductPricing)
        {
            bool Result = false;
            Site site   = SiteCacher.GetCached();

            foreach (string str in SSLCategories.Malware.Split(','))
            {
                if (_ProductPricing.Where(pp => pp.Product.InternalProductCode.ToLower().Equals(str.ToLower()) && WBSiteSettings.AllowedBrand(site).Contains(pp.Product.BrandID.ToString())).Count() > 0)
                {
                    Result = true;
                    break;
                }
            }
            site = null;
            return(Result);
        }
        public static bool CheckBrandShow(List <ProductPricing> _ProductPricing, ProductBrands brandEnum)
        {
            bool Result = false;
            Site site   = SiteCacher.GetCached();

            if (_ProductPricing != null && WBSiteSettings.AllowedBrand(site).Contains(((int)brandEnum).ToString()) && _ProductPricing.Where(pp => pp.Product.BrandID == (int)brandEnum).Count() > 0)
            {
                Result = true;
            }
            else
            {
                Result = false;
            }

            site = null;
            return(Result);
        }
        public static string GenerateMenuString()
        {
            Site site = SiteCacher.GetCached();

            bool IsLoginVisible = false;

            StringBuilder strMenu = new StringBuilder();

            List <Pages> lstPage = site.Pages.ToList();

            if (lstPage != null && lstPage.Count > 0)
            {
                strMenu.Append("<div><ul class=\"contentlist\">");
                List <Pages> objParent = lstPage.Where(pg => pg.ParentID == 0).ToList();
                int          Count     = 0;
                foreach (Pages objPage in objParent)
                {
                    if (objPage.Caption.ToLower().Equals("login") || objPage.Caption.ToLower().Equals("logout"))
                    {
                        IsLoginVisible = (objPage.PageStatusID == (int)PageStatus.Show);
                    }

                    if (Count == 0)
                    {
                        strMenu.Append("<li><a href=\"" + (objPage.slug.ToLower().StartsWith("http") ? objPage.slug : ApllicationFullPath + objPage.slug) + "\" target=\"" + objPage.URLTarget.ToString() + "\" >" + GetValueFromResourceFile(objPage.Caption) + "</a>" + GenerateMenuStringChild(lstPage.Where(pg => pg.ParentID == objPage.ID).ToList(), lstPage) + "</li>");
                    }

                    else
                    {
                        strMenu.Append("<li><a href=\"" + (objPage.slug.ToLower().StartsWith("http") ? objPage.slug : ApllicationFullPath + objPage.slug) + "\" target=\"" + objPage.URLTarget.ToString() + "\">" + GetValueFromResourceFile(objPage.Caption) + "</a>" + GenerateMenuStringChild(lstPage.Where(pg => pg.ParentID == objPage.ID).ToList(), lstPage) + "</li>");
                    }

                    Count++;
                }


                bool IsAuth = (HttpContext.Current != null && HttpContext.Current.User.Identity.IsAuthenticated);

                strMenu.Append("<li><a href=\"" + (IsAuth ? "/staticpage/Logout" : "/logon") + "\">" + GetValueFromResourceFile((IsAuth ? "Logout" : "Login")) + "</a></li>");

                strMenu.Append("</ul></div>");
            }
            site = null;
            return(strMenu.ToString());
        }
        public static string GenerateSiteMapXML()
        {
            Site site = SiteCacher.GetCached();

            StringBuilder strMenu = new StringBuilder();
            List <Pages>  lstPage = site.Pages.ToList();

            if (lstPage != null && lstPage.Count > 0)
            {
                string str = "xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"  xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\"";
                strMenu.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + string.Empty + "<urlset  " + str + ">" + string.Empty);

                strMenu.AppendFormat("{3}<url>{1}<loc>{0}</loc> <changefreq>daily</changefreq><priority>{2}</priority></url>", ApllicationFullPath, string.Empty, "1.00", string.Empty);

                foreach (Pages objPage in lstPage)
                {
                    strMenu.AppendFormat("{3}<url>{1}<loc>{0}</loc> <changefreq>daily</changefreq><priority>{2}</priority></url>", ApllicationFullPath + objPage.slug, string.Empty, objPage.ParentID.Equals(0) ? "0.90" : "0.80", string.Empty);
                }
            }
            strMenu.Append("</urlset>");
            site = null;
            return(strMenu.ToString());
        }