protected void Page_Load(object sender, EventArgs e)
    {
        lblAvialable.Text = GetString("com.discountlevel.departmentsavailable");
        mDiscountLevelId  = QueryHelper.GetInteger("discountLevelId", 0);
        editedSiteId      = ConfiguredSiteID;

        if (mDiscountLevelId > 0)
        {
            mDiscountLevelInfoObj = DiscountLevelInfoProvider.GetDiscountLevelInfo(mDiscountLevelId);
            EditedObject          = mDiscountLevelInfoObj;

            if (mDiscountLevelInfoObj != null)
            {
                editedSiteId = mDiscountLevelInfoObj.DiscountLevelSiteID;
                CheckEditedObjectSiteID(editedSiteId);

                // Get the active departments
                DataSet ds = DepartmentInfoProvider.GetDiscountLevelDepartments(mDiscountLevelId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "DepartmentID"));
                }

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

        uniSelector.IconPath            = GetObjectIconUrl("ecommerce.department", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.WhereCondition      = GetWhereCondition();
    }
示例#2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CMSContext.CurrentUser.IsAuthorizedPerUIElement("CMS.Ecommerce", "DiscountLevels.Departments"))
        {
            RedirectToCMSDeskUIElementAccessDenied("CMS.Ecommerce", "DiscountLevels.Departments");
        }

        lblAvialable.Text = GetString("com.discountlevel.departmentsavailable");
        mDiscountLevelId  = QueryHelper.GetInteger("discountLevelId", 0);
        editedSiteId      = ConfiguredSiteID;

        if (mDiscountLevelId > 0)
        {
            mDiscountLevelInfoObj = DiscountLevelInfoProvider.GetDiscountLevelInfo(mDiscountLevelId);
            EditedObject          = mDiscountLevelInfoObj;

            if (mDiscountLevelInfoObj != null)
            {
                editedSiteId = mDiscountLevelInfoObj.DiscountLevelSiteID;
                CheckEditedObjectSiteID(editedSiteId);

                // Get the active departments
                DataSet ds = DepartmentInfoProvider.GetDiscountLevelDepartments(mDiscountLevelId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SqlHelperClass.GetStringValues(ds.Tables[0], "DepartmentID"));
                }

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

        this.uniSelector.IconPath            = GetObjectIconUrl("ecommerce.department", "object.png");
        this.uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        this.uniSelector.WhereCondition      = GetWhereCondition();
    }