protected void gvValues_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdateCheckoutAttributeValue")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow row   = gvValues.Rows[index];

                HiddenField    hfCheckoutAttributeValueId = row.FindControl("hfCheckoutAttributeValueId") as HiddenField;
                SimpleTextBox  txtName             = row.FindControl("txtName") as SimpleTextBox;
                DecimalTextBox txtPriceAdjustment  = row.FindControl("txtPriceAdjustment") as DecimalTextBox;
                DecimalTextBox txtWeightAdjustment = row.FindControl("txtWeightAdjustment") as DecimalTextBox;
                CheckBox       cbIsPreSelected     = row.FindControl("cbIsPreSelected") as CheckBox;
                NumericTextBox txtDisplayOrder     = row.FindControl("txtDisplayOrder") as NumericTextBox;

                int     cavId            = int.Parse(hfCheckoutAttributeValueId.Value);
                string  name             = txtName.Text;
                decimal priceAdjustment  = txtPriceAdjustment.Value;
                decimal weightAdjustment = txtWeightAdjustment.Value;
                bool    isPreSelected    = cbIsPreSelected.Checked;
                int     displayOrder     = txtDisplayOrder.Value;

                var cav = CheckoutAttributeManager.GetCheckoutAttributeValueById(cavId, 0);

                if (cav != null)
                {
                    cav = CheckoutAttributeManager.UpdateCheckoutAttributeValue(cav.CheckoutAttributeValueId,
                                                                                cav.CheckoutAttributeId, name,
                                                                                priceAdjustment, weightAdjustment, isPreSelected, displayOrder);

                    SaveLocalizableContentGrid(cav);
                }
                BindData();
            }
        }
Ejemplo n.º 2
0
        protected void gvProductVariantAttributeValues_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdateProductVariantAttributeValue")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow row   = gvProductVariantAttributeValues.Rows[index];

                HiddenField    hfProductVariantAttributeValueID = row.FindControl("hfProductVariantAttributeValueID") as HiddenField;
                SimpleTextBox  txtName             = row.FindControl("txtName") as SimpleTextBox;
                DecimalTextBox txtPriceAdjustment  = row.FindControl("txtPriceAdjustment") as DecimalTextBox;
                DecimalTextBox txtWeightAdjustment = row.FindControl("txtWeightAdjustment") as DecimalTextBox;
                CheckBox       cbIsPreSelected     = row.FindControl("cbIsPreSelected") as CheckBox;
                NumericTextBox txtDisplayOrder     = row.FindControl("txtDisplayOrder") as NumericTextBox;

                int     productVariantAttributeValueID = int.Parse(hfProductVariantAttributeValueID.Value);
                string  name             = txtName.Text;
                decimal priceAdjustment  = txtPriceAdjustment.Value;
                decimal weightAdjustment = txtWeightAdjustment.Value;
                bool    isPreSelected    = cbIsPreSelected.Checked;
                int     displayOrder     = txtDisplayOrder.Value;

                ProductVariantAttributeValue productVariantAttributeValue = ProductAttributeManager.GetProductVariantAttributeValueByID(productVariantAttributeValueID);

                if (productVariantAttributeValue != null)
                {
                    ProductAttributeManager.UpdateProductVariantAttributeValue(productVariantAttributeValue.ProductVariantAttributeValueID,
                                                                               productVariantAttributeValue.ProductVariantAttributeID, name,
                                                                               priceAdjustment, weightAdjustment, isPreSelected, displayOrder);
                }

                BindData();
            }
        }
        protected void OnSpecificationAttributeOptionsCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdateOption")
            {
                int            index           = Convert.ToInt32(e.CommandArgument);
                GridViewRow    row             = grdSpecificationAttributeOptions.Rows[index];
                SimpleTextBox  txtName         = row.FindControl("txtOptionName") as SimpleTextBox;
                NumericTextBox txtDisplayOrder = row.FindControl("txtOptionDisplayOrder") as NumericTextBox;
                HiddenField    hfSpecificationAttributeOptionId = row.FindControl("hfSpecificationAttributeOptionId") as HiddenField;

                string name         = txtName.Text;
                int    displayOrder = txtDisplayOrder.Value;
                int    saoId        = int.Parse(hfSpecificationAttributeOptionId.Value);

                var sao = this.SpecificationAttributeService.GetSpecificationAttributeOptionById(saoId);
                if (sao != null)
                {
                    sao.Name         = name;
                    sao.DisplayOrder = displayOrder;
                    this.SpecificationAttributeService.UpdateSpecificationAttributeOptions(sao);
                    SaveLocalizableContentGrid(sao);
                }

                BindData();
            }
        }
Ejemplo n.º 4
0
        protected override void OnPreRender(EventArgs e)
        {
            SimpleTextBox txtName = ctrlProductInfoEdit.FindControl("txtName") as SimpleTextBox;

            if (txtName != null)
            {
                txtProductCopyName.Text = "Copy of " + txtName.Text;
            }
            base.OnPreRender(e);
        }
Ejemplo n.º 5
0
        protected override void OnPreRender(EventArgs e)
        {
            SimpleTextBox txtName = ctrlProductInfoEdit.FindControl("txtName") as SimpleTextBox;

            if (txtName != null)
            {
                txtProductCopyName.Text = "Copy of " + txtName.Text;
            }

            PreviewButton.OnClientClick = string.Format("javascript:OpenWindow('{0}', 800, 600, true); return false;", SEOHelper.GetProductUrl(this.ProductId));

            base.OnPreRender(e);
        }
Ejemplo n.º 6
0
        protected void gvPollAnswers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdatePollAnswer")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow row   = gvPollAnswers.Rows[index];

                HiddenField    hfPollAnswerId  = row.FindControl("hfPollAnswerId") as HiddenField;
                SimpleTextBox  txtName         = row.FindControl("txtName") as SimpleTextBox;
                NumericTextBox txtDisplayOrder = row.FindControl("txtDisplayOrder") as NumericTextBox;

                int        pollAnswerId = int.Parse(hfPollAnswerId.Value);
                PollAnswer pollAnswer   = PollManager.GetPollAnswerById(pollAnswerId);

                if (pollAnswer != null)
                {
                    pollAnswer = PollManager.UpdatePollAnswer(pollAnswer.PollAnswerId, pollAnswer.PollId,
                                                              txtName.Text, pollAnswer.Count, txtDisplayOrder.Value);
                }

                BindData();
            }
        }
        protected void gvProductVariantAttributeValues_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdateProductVariantAttributeValue")
            {
                int         index = Convert.ToInt32(e.CommandArgument);
                GridViewRow row   = gvProductVariantAttributeValues.Rows[index];

                HiddenField    hfProductVariantAttributeValueId = row.FindControl("hfProductVariantAttributeValueId") as HiddenField;
                SimpleTextBox  txtName             = row.FindControl("txtName") as SimpleTextBox;
                DecimalTextBox txtPriceAdjustment  = row.FindControl("txtPriceAdjustment") as DecimalTextBox;
                DecimalTextBox txtWeightAdjustment = row.FindControl("txtWeightAdjustment") as DecimalTextBox;
                CheckBox       cbIsPreSelected     = row.FindControl("cbIsPreSelected") as CheckBox;
                NumericTextBox txtDisplayOrder     = row.FindControl("txtDisplayOrder") as NumericTextBox;

                int     productVariantAttributeValueId = int.Parse(hfProductVariantAttributeValueId.Value);
                string  name             = txtName.Text;
                decimal priceAdjustment  = txtPriceAdjustment.Value;
                decimal weightAdjustment = txtWeightAdjustment.Value;
                bool    isPreSelected    = cbIsPreSelected.Checked;
                int     displayOrder     = txtDisplayOrder.Value;

                ProductVariantAttributeValue productVariantAttributeValue = this.ProductAttributeService.GetProductVariantAttributeValueById(productVariantAttributeValueId);

                if (productVariantAttributeValue != null)
                {
                    productVariantAttributeValue.Name             = name;
                    productVariantAttributeValue.PriceAdjustment  = priceAdjustment;
                    productVariantAttributeValue.WeightAdjustment = weightAdjustment;
                    productVariantAttributeValue.IsPreSelected    = isPreSelected;
                    productVariantAttributeValue.DisplayOrder     = displayOrder;
                    this.ProductAttributeService.UpdateProductVariantAttributeValue(productVariantAttributeValue);

                    SaveLocalizableContentGrid(productVariantAttributeValue);
                }
                BindData();
            }
        }
Ejemplo n.º 8
0
        protected void OnSpecificationAttributeOptionsCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "UpdateOption")
            {
                int            index           = Convert.ToInt32(e.CommandArgument);
                GridViewRow    row             = grdSpecificationAttributeOptions.Rows[index];
                SimpleTextBox  txtName         = row.FindControl("txtOptionName") as SimpleTextBox;
                NumericTextBox txtDisplayOrder = row.FindControl("txtOptionDisplayOrder") as NumericTextBox;
                HiddenField    hfSpecificationAttributeOptionID = row.FindControl("hfSpecificationAttributeOptionID") as HiddenField;

                string name         = txtName.Text;
                int    displayOrder = txtDisplayOrder.Value;
                int    saoID        = int.Parse(hfSpecificationAttributeOptionID.Value);

                SpecificationAttributeOption sao = SpecificationAttributeManager.GetSpecificationAttributeOptionByID(saoID);
                if (sao != null)
                {
                    SpecificationAttributeManager.UpdateSpecificationAttributeOptions(saoID, SpecificationAttributeID, name, displayOrder);
                    ColorManager.UpdateColor(sao.Name, name);
                }

                BindData();
            }
        }