protected void OnSpecificationAttributeIndexChanged(object sender, EventArgs e)
        {
            ddlNewProductSpecificationAttributeOption.Items.Clear();
            int saId = Convert.ToInt32(ddlNewProductSpecificationAttribute.SelectedValue.ToString());
            SpecificationAttributeOptionCollection saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(saId);

            foreach (SpecificationAttributeOption sao in saoCol)
            {
                ListItem item2 = new ListItem(sao.Name, sao.SpecificationAttributeOptionId.ToString());
                this.ddlNewProductSpecificationAttributeOption.Items.Add(item2);
            }
        }
Beispiel #2
0
        private void BindData()
        {
            SpecificationAttribute specificationAttribute = SpecificationAttributeManager.GetSpecificationAttributeByID(this.SpecificationAttributeID);

            if (specificationAttribute != null)
            {
                this.txtName.Text          = specificationAttribute.Name;
                this.txtDisplayOrder.Value = specificationAttribute.DisplayOrder;
            }

            SpecificationAttributeOptionCollection saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(SpecificationAttributeID);

            grdSpecificationAttributeOptions.DataSource = saoCol;
            grdSpecificationAttributeOptions.DataBind();
        }
        private void FillDropDowns()
        {
            this.ddlNewProductSpecificationAttribute.Items.Clear();
            var productSpecificationAttributes = SpecificationAttributeManager.GetSpecificationAttributes();

            foreach (SpecificationAttribute sa in productSpecificationAttributes)
            {
                ListItem item2 = new ListItem(sa.Name, sa.SpecificationAttributeId.ToString());
                this.ddlNewProductSpecificationAttribute.Items.Add(item2);
            }

            ddlNewProductSpecificationAttributeOption.Items.Clear();
            if (!String.IsNullOrEmpty(ddlNewProductSpecificationAttribute.SelectedValue))
            {
                int saId   = Convert.ToInt32(ddlNewProductSpecificationAttribute.SelectedValue.ToString());
                var saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(saId);
                foreach (SpecificationAttributeOption sao in saoCol)
                {
                    ListItem item2 = new ListItem(sao.Name, sao.SpecificationAttributeOptionId.ToString());
                    this.ddlNewProductSpecificationAttributeOption.Items.Add(item2);
                }
            }
        }
        protected void gvProductSpecificationAttributes_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                ProductSpecificationAttribute productSpecificationAttribute = (ProductSpecificationAttribute)e.Row.DataItem;

                Button btnUpdate = e.Row.FindControl("btnUpdate") as Button;
                if (btnUpdate != null)
                {
                    btnUpdate.CommandArgument = e.Row.RowIndex.ToString();
                }

                SpecificationAttributeOption sao      = SpecificationAttributeManager.GetSpecificationAttributeOptionById(productSpecificationAttribute.SpecificationAttributeOptionId);
                SpecificationAttribute       sa       = SpecificationAttributeManager.GetSpecificationAttributeById(sao.SpecificationAttributeId);
                Literal lblSpecificationAttributeName = e.Row.FindControl("lblSpecificationAttributeName") as Literal;
                lblSpecificationAttributeName.Text = sa.Name;

                DropDownList ddlSpecificationAttributeOption = e.Row.FindControl("ddlSpecificationAttributeOption") as DropDownList;
                ddlSpecificationAttributeOption.Items.Clear();
                SpecificationAttributeOptionCollection saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(sao.SpecificationAttributeId);
                foreach (SpecificationAttributeOption sao1 in saoCol)
                {
                    ListItem item = new ListItem(sao1.Name, sao1.SpecificationAttributeOptionId.ToString());
                    ddlSpecificationAttributeOption.Items.Add(item);
                    if (productSpecificationAttribute.SpecificationAttributeOptionId == sao1.SpecificationAttributeOptionId)
                    {
                        item.Selected = true;
                    }
                }

                CheckBox chkAllowFiltering = e.Row.FindControl("chkAllowFiltering") as CheckBox;
                chkAllowFiltering.Checked = productSpecificationAttribute.AllowFiltering;

                CheckBox chkShowOnProductPage = e.Row.FindControl("chkShowOnProductPage") as CheckBox;
                chkShowOnProductPage.Checked = productSpecificationAttribute.ShowOnProductPage;
            }
        }
        private void BindData()
        {
            var specificationAttribute = SpecificationAttributeManager.GetSpecificationAttributeById(this.SpecificationAttributeId);

            if (specificationAttribute != null)
            {
                pnlData.Visible    = true;
                pnlMessage.Visible = false;

                if (this.HasLocalizableContent)
                {
                    var languages = this.GetLocalizableLanguagesSupported();
                    rptrLanguageTabs.DataSource = languages;
                    rptrLanguageTabs.DataBind();
                    rptrLanguageDivs.DataSource = languages;
                    rptrLanguageDivs.DataBind();
                }

                var saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(SpecificationAttributeId);
                if (saoCol.Count > 0)
                {
                    grdSpecificationAttributeOptions.Visible    = true;
                    grdSpecificationAttributeOptions.DataSource = saoCol;
                    grdSpecificationAttributeOptions.DataBind();
                }
                else
                {
                    grdSpecificationAttributeOptions.Visible = false;
                }
            }
            else
            {
                pnlData.Visible    = false;
                pnlMessage.Visible = true;
                lblMessage.Text    = GetLocaleResourceString("Admin.SpecificationAttributeOptions.AvailableAfterSaving");
            }
        }
Beispiel #6
0
        private void BindData()
        {
            SpecificationAttribute specificationAttribute = SpecificationAttributeManager.GetSpecificationAttributeById(this.SpecificationAttributeId, 0);

            if (this.HasLocalizableContent)
            {
                var languages = this.GetLocalizableLanguagesSupported();
                rptrLanguageTabs.DataSource = languages;
                rptrLanguageTabs.DataBind();
                rptrLanguageDivs.DataSource = languages;
                rptrLanguageDivs.DataBind();
            }

            if (specificationAttribute != null)
            {
                this.txtName.Text          = specificationAttribute.Name;
                this.txtDisplayOrder.Value = specificationAttribute.DisplayOrder;
            }

            SpecificationAttributeOptionCollection saoCol = SpecificationAttributeManager.GetSpecificationAttributeOptionsBySpecificationAttribute(SpecificationAttributeId, 0);

            grdSpecificationAttributeOptions.DataSource = saoCol;
            grdSpecificationAttributeOptions.DataBind();
        }