Пример #1
0
        private void PopulateControls()
        {
            if (config.LoadFirstProduct || forceLoadDetail)
            {
                Control c = Page.LoadControl("~/Product/Controls/ProductViewControl.ascx");
                if (c == null)
                {
                    return;
                }

                if (c is ProductViewControl)
                {
                    ProductViewControl productView = (ProductViewControl)c;
                    productView.module = this.ModuleConfiguration;
                    productView.Config = config;
                }

                placeHolder.Controls.Add(c);
            }
            else
            {
                Control c = Page.LoadControl("~/Product/Controls/ProductListControl.ascx");
                if (c == null)
                {
                    return;
                }

                if (c is ProductListControl)
                {
                    ProductListControl productList = (ProductListControl)c;
                    productList.ModuleId      = ModuleId;
                    productList.Config        = config;
                    productList.SiteRoot      = SiteRoot;
                    productList.ImageSiteRoot = ImageSiteRoot;
                    productList.ModuleTitle   = this.Title;
                }

                placeHolder.Controls.Add(c);

                if (!Page.IsPostBack)
                {
                    CartHelper.LastContinueShoppingPage = ProductHelper.BuildFilterUrlLeaveOutPageNumber(Request.RawUrl);
                }
            }

            if (forceLoadDetail)
            {
                CmsBasePage basePage = Page as CmsBasePage;
                if (basePage != null)
                {
                    basePage.LoadSideContent(config.ShowLeftContent, config.ShowRightContent, config.ShowHiddenContents);
                    basePage.LoadAltContent(ProductConfiguration.ShowTopContent, ProductConfiguration.ShowBottomContent, config.ShowHiddenContents);
                }
            }
        }
Пример #2
0
        private void PopulateControls()
        {
            if (config.LoadFirstItem || forceLoadDetail)
            {
                Control c = Page.LoadControl("~/News/Controls/NewsViewControl.ascx");
                if (c == null)
                {
                    return;
                }

                if (c is NewsViewControl)
                {
                    NewsViewControl newsView = (NewsViewControl)c;
                    newsView.module = this.ModuleConfiguration;
                    newsView.Config = config;
                }

                placeHolder.Controls.Add(c);
            }
            else
            {
                Control c = Page.LoadControl("~/News/Controls/NewsListControl.ascx");
                if (c == null)
                {
                    return;
                }

                if (c is NewsListControl)
                {
                    NewsListControl newsList = (NewsListControl)c;
                    newsList.ModuleId      = ModuleId;
                    newsList.Config        = config;
                    newsList.SiteRoot      = SiteRoot;
                    newsList.ImageSiteRoot = ImageSiteRoot;
                    newsList.ModuleTitle   = this.Title;
                }

                placeHolder.Controls.Add(c);
            }

            if (forceLoadDetail)
            {
                CmsBasePage basePage = Page as CmsBasePage;
                if (basePage != null)
                {
                    basePage.LoadSideContent(config.ShowLeftContent, config.ShowRightContent, config.ShowHiddenContents);
                    basePage.LoadAltContent(NewsConfiguration.ShowTopContent, NewsConfiguration.ShowBottomContent, config.ShowHiddenContents);
                }
            }
        }