Пример #1
0
        protected void Page_Prerender(object sender, EventArgs e)
        {
            // Check licensing
            LicenseDataInfo license = Controller.GetLicense(PortalId, false);

            Controller.CheckLicense(license, this, ModuleKind);
        }
Пример #2
0
        protected void Page_PreRender(object sender, System.EventArgs e)
        {
            lblSearchProductGroup.Text = FilterValueProductGroup;
            string[] values = FilterValueText.Split('|');
            lblSearchText.Text = values[0];
            txtSearchText.Text = values[0];

            if (FilterValuePrice.Contains("|"))
            {
                values = FilterValuePrice.Split('|');
                decimal start = 0m;
                decimal end   = 0m;
                if (Decimal.TryParse(values[0], NumberStyles.Number, CultureInfo.InvariantCulture, out start) &&
                    Decimal.TryParse(values[1], NumberStyles.Number, CultureInfo.InvariantCulture, out end))
                {
                    txtStartPrice.Text = start.ToString("F2", CultureInfo.CurrentUICulture);
                    lblStartPrice.Text = txtStartPrice.Text;
                    txtEndPrice.Text   = end.ToString("F2", CultureInfo.CurrentUICulture);
                    lblEndPrice.Text   = txtEndPrice.Text;
                }
            }
            // Check licensing
            LicenseDataInfo license = Controller.GetLicense(PortalId, false);

            Controller.CheckLicense(license, this, ModuleKind);
        }
Пример #3
0
        protected void Page_PreRender(object sender, System.EventArgs e)
        {
            try
            {
                // We can set the Title of our Module
                if (SetTitle)
                {
                    bool breadcrumb = (Settings["ShowBreadcrumb"] != null ? Convert.ToBoolean((string)Settings["ShowBreadcrumb"]) : false);

                    string           productGroupPath = "";
                    string           root             = Localization.GetString("MainProductGroup.Text", this.LocalResourceFile);
                    ProductGroupInfo pg = Controller.GetProductGroup(PortalId, CurrentLanguage, ProductGroupId);

                    if (pg != null)
                    {
                        int productGroupId = pg.ProductGroupId;
                        if (breadcrumb)
                        {
                            string link         = Globals.NavigateURL(TabId, "", "productgroup={1}");
                            string linkTemplate = "<a href=\"" + link + "\">{0}</a>";
                            productGroupPath = Controller.GetProductGroupPath(PortalId, pg.ProductGroupId, CurrentLanguage, false, " > ", linkTemplate, root);
                        }
                        else if (productGroupId > -1)
                        {
                            productGroupPath = pg.ProductGroupName;
                        }
                    }


                    string  titleLabelName = DotNetNukeContext.Current.Application.Version.Major < 6 ? "lblTitle" : "titleLabel";
                    Control ctl            = Globals.FindControlRecursiveDown(this.ContainerControl, titleLabelName);
                    if (ctl != null)
                    {
                        ((Label)ctl).Text = productGroupPath != string.Empty ? productGroupPath : root;
                    }
                }

                if (!IsVisible && !IsEditable)
                {
                    this.ContainerControl.Visible = false;
                }
            }
            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }

            // Check licensing
            LicenseDataInfo license = Controller.GetLicense(PortalId, false);

            Controller.CheckLicense(license, this, ModuleKind);
        }
Пример #4
0
        protected void Page_Prerender(object sender, System.EventArgs e)
        {
            if (IsConfigured)
            {
                bool setTitle = (Settings["SetTitle"] != null ? Convert.ToBoolean((string)Settings["SetTitle"]) : false);

                if (setTitle)
                {
                    bool breadcrumb = (Settings["TitleBreadcrumb"] != null ? Convert.ToBoolean((string)Settings["TitleBreadcrumb"]) : false);

                    string productGroupPath     = "";
                    string rootText             = Localization.GetString("MainProductGroup.Text", this.LocalResourceFile);
                    List <ProductFilterInfo> fi = Controller.GetProductFilter(PortalId, FilterSessionId, "ProductGroup");
                    if (fi.Count > 0)
                    {
                        string[] values         = fi[0].FilterValue.Split('|');
                        int      productGroupId = Convert.ToInt32(values[0]);
                        if (breadcrumb)
                        {
                            string link         = Globals.NavigateURL(TabId, "", "productgroup={1}");
                            string linkTemplate = "<a href=\"" + link + "\">{0}</a>";
                            productGroupPath = Controller.GetProductGroupPath(PortalId, productGroupId, CurrentLanguage, false, " > ", linkTemplate, rootText);
                        }
                        else if (productGroupId > -1)
                        {
                            ProductGroupInfo pg = Controller.GetProductGroup(PortalId, CurrentLanguage, productGroupId);
                            productGroupPath = pg.ProductGroupName;
                        }
                    }

                    string  titleLabelName = DotNetNukeContext.Current.Application.Version.Major < 6 ? "lblTitle" : "titleLabel";
                    Control ctl            = Globals.FindControlRecursiveDown(this.ContainerControl, titleLabelName);
                    if (ctl != null)
                    {
                        ((Label)ctl).Text = productGroupPath != string.Empty ? productGroupPath : rootText;
                    }
                }

                // Header and Footer area
                pnlListHead.Visible   = (Settings["ShowListHead"] == null || Convert.ToBoolean(Settings["ShowListHead"]) == true);
                pnlListFooter.Visible = (Products.Count > Pager.PageSize);
                if (Settings["ShowPaging"] != null && Convert.ToBoolean(Settings["ShowPaging"]) == false)
                {
                    pnlListFooter.Visible = false;
                }

                // Header and Footer text
                LocalResourceLangInfo localResourceLang = Controller.GetLocalResourceLang(PortalId, "PRODUCTLISTHEADER", CurrentLanguage);
                if (localResourceLang != null && localResourceLang.TextValue != String.Empty)
                {
                    ltrHead.Text = localResourceLang.TextValue;
                }

                localResourceLang = Controller.GetLocalResourceLang(PortalId, "PRODUCTLISTFOOTER", CurrentLanguage);
                if (localResourceLang != null && localResourceLang.TextValue != String.Empty)
                {
                    ltrFoot.Text = localResourceLang.TextValue;
                }

                // No Products found Display
                if (Products.Count == 0)
                {
                    localResourceLang = Controller.GetLocalResourceLang(PortalId, "PRODUCTLISTEMPTY", CurrentLanguage);
                    if (localResourceLang != null && localResourceLang.TextValue != String.Empty)
                    {
                        ltrEmpty.Text    = localResourceLang.TextValue;
                        ltrEmpty.Visible = true;
                    }
                }


                LinkButton lnkShowAll = lnkShowAllTop;

                if (Settings["ShowAllLinkPos"] != null && Convert.ToInt32(Settings["ShowAllLinkPos"]) > 0 &&
                    _products.Count > 0 && _products.Count > ProductsPerPage)
                {
                    int pos = Convert.ToInt32(Settings["ShowAllLinkPos"]);
                    switch (pos)
                    {
                    case 1:
                        lnkShowAllTop.Visible = true;
                        lnkShowAll            = lnkShowAllTop;
                        divShowAllTop.Style.Add("text-align", "left");
                        break;

                    case 2:
                        lnkShowAllTop.Visible = true;
                        lnkShowAll            = lnkShowAllTop;
                        divShowAllTop.Style.Add("text-align", "center");
                        break;

                    case 3:
                        lnkShowAllTop.Visible = true;
                        lnkShowAll            = lnkShowAllTop;
                        divShowAllTop.Style.Add("text-align", "right");
                        break;

                    case 4:
                        lnkShowAllBottom.Visible = true;
                        lnkShowAll = lnkShowAllBottom;
                        divShowAllBottom.Style.Add("text-align", "left");
                        break;

                    case 5:
                        lnkShowAllBottom.Visible = true;
                        lnkShowAll = lnkShowAllBottom;
                        divShowAllBottom.Style.Add("text-align", "center");
                        break;

                    case 6:
                        lnkShowAllBottom.Visible = true;
                        lnkShowAll = lnkShowAllBottom;
                        divShowAllBottom.Style.Add("text-align", "right");
                        break;
                    }
                    lnkShowAll.Text     = string.Format(Localization.GetString("ShowAllLink.Text", this.LocalResourceFile), Products.Count);
                    lnkShowAll.CssClass = "bbstore-productlist-showall";
                }
            }
            else
            {
                pnlListHead.Visible   = false;
                pnlListFooter.Visible = false;
            }

            if (Convert.ToBoolean(Settings["HideEmptyModule"] ?? "false") == true && _products.Any() == false && !IsEditable)
            {
                this.ContainerControl.Visible = false;
            }

            // Check licensing
            LicenseDataInfo license = Controller.GetLicense(PortalId, false);

            Controller.CheckLicense(license, this, ModuleKind);
        }