protected void Page_Load(object sender, EventArgs e)
    {
        mShippingOptionId = QueryHelper.GetInteger("objectid", 0);
        if (mShippingOptionId > 0)
        {
            mShippingOptionInfoObj = ShippingOptionInfoProvider.GetShippingOptionInfo(mShippingOptionId);
            EditedObject           = mShippingOptionInfoObj;

            if (mShippingOptionInfoObj != null)
            {
                // Check object's site id
                CheckEditedObjectSiteID(mShippingOptionInfoObj.ShippingOptionSiteID);

                DataSet ds = ShippingOptionTaxClassInfoProvider.GetShippingOptionTaxClasses(mShippingOptionId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", DataHelper.GetStringValues(ds.Tables[0], "TaxClassID"));
                }

                if (!RequestHelper.IsPostBack())
                {
                    uniSelector.Value = mCurrentValues;
                }
            }
        }

        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.OrderBy             = "TaxClassDisplayName";
        uniSelector.WhereCondition      = GetSelectorWhereCondition();
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsMultiStoreConfiguration)
        {
            CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "Ecommerce.GlobalShippingOptions.TaxClasses");
        }
        else
        {
            CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, "Configuration.ShippingOptions.TaxClasses");
        }

        mShippingOptionId = QueryHelper.GetInteger("objectid", 0);
        if (mShippingOptionId > 0)
        {
            mShippingOptionInfoObj = ShippingOptionInfoProvider.GetShippingOptionInfo(mShippingOptionId);
            EditedObject           = mShippingOptionInfoObj;

            if (mShippingOptionInfoObj != null)
            {
                // Check object's site id
                CheckEditedObjectSiteID(mShippingOptionInfoObj.ShippingOptionSiteID);

                DataSet ds = ShippingOptionTaxClassInfoProvider.GetShippingOptionTaxClasses(mShippingOptionId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", DataHelper.GetStringValues(ds.Tables[0], "TaxClassID"));
                }

                if (!RequestHelper.IsPostBack())
                {
                    uniSelector.Value = mCurrentValues;
                }
            }
        }

        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.OrderBy             = "TaxClassDisplayName";
        uniSelector.WhereCondition      = GetSelectorWhereCondition();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Check permissions for Tax clases
        if (!CMSContext.CurrentUser.IsAuthorizedPerUIElement("CMS.Ecommerce", "Configuration.ShippingOptions.TaxClasses"))
        {
            RedirectToCMSDeskUIElementAccessDenied("CMS.Ecommerce", "Configuration.ShippingOptions.TaxClasses");
        }

        lblAvialable.Text = GetString("com.shippingoption.taxes");
        mShippingOptionId = QueryHelper.GetInteger("shippingoptionid", 0);
        if (mShippingOptionId > 0)
        {
            mShippingOptionInfoObj = ShippingOptionInfoProvider.GetShippingOptionInfo(mShippingOptionId);
            EditedObject           = mShippingOptionInfoObj;

            if (mShippingOptionInfoObj != null)
            {
                // Check object's site id
                CheckEditedObjectSiteID(mShippingOptionInfoObj.ShippingOptionSiteID);

                DataSet ds = ShippingOptionTaxClassInfoProvider.GetShippingOptionTaxClasses(mShippingOptionId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SqlHelperClass.GetStringValues(ds.Tables[0], "TaxClassID"));
                }

                if (!RequestHelper.IsPostBack())
                {
                    uniSelector.Value = mCurrentValues;
                }
            }
        }

        uniSelector.IconPath            = GetObjectIconUrl("ecommerce.taxclass", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.OrderBy             = "TaxClassDisplayName";
        uniSelector.WhereCondition      = GetSelectorWhereCondition();
    }