/// <summary>
    /// Returns true if contact came to specified landing page.
    /// </summary>
    /// <param name="parameters">Contact; Node ID or alias path of the page</param>
    public static object CameToLandingPage(params object[] parameters)
    {
        switch (parameters.Length)
        {
        case 2:
            int    nodeId  = ValidationHelper.GetInteger(parameters[1], 0);
            string nodeIds = null;
            if (nodeId <= 0)
            {
                string alias = ValidationHelper.GetString(parameters[1], "");
                if (!string.IsNullOrEmpty(alias))
                {
                    TreeNodeDataSet ds = new TreeProvider().SelectNodes(TreeProvider.ALL_SITES, alias, TreeProvider.ALL_CULTURES, true);
                    if (!DataHelper.DataSourceIsEmpty(ds))
                    {
                        nodeIds = TextHelper.Join(",", SystemDataHelper.GetStringValues(ds.Tables[0], "NodeID"));
                    }
                }
            }

            if (nodeId > 0)
            {
                return(OnlineMarketingFunctions.DidActivity(parameters[0], "landingpage", null, 0, "ActivityNodeID = " + nodeId));
            }
            else if (!string.IsNullOrEmpty(nodeIds))
            {
                return(OnlineMarketingFunctions.DidActivity(parameters[0], "landingpage", null, 0, "ActivityNodeID IN (" + nodeIds + ")"));
            }
            return(false);

        default:
            throw new NotSupportedException();
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblAvialable.Text = GetString("com.department.defaulttaxes");
        mDepartmentId     = QueryHelper.GetInteger("departmentid", 0);
        if (mDepartmentId > 0)
        {
            mDepartmentInfoObj = DepartmentInfoProvider.GetDepartmentInfo(mDepartmentId);
            EditedObject       = mDepartmentInfoObj;

            if (mDepartmentInfoObj != null)
            {
                CheckEditedObjectSiteID(mDepartmentInfoObj.DepartmentSiteID);

                // Get tax classes assigned to department
                DataSet ds = TaxClassInfoProvider.GetDepartmentTaxClasses(mDepartmentId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "TaxClassID"));
                }

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

        uniSelector.IconPath            = GetObjectIconUrl("ecommerce.taxclass", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.WhereCondition      = GetSelectorWhereCondition();
    }
    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();
    }
    /// <summary>
    /// Returns board roles separated by semicolon.
    /// </summary>
    private string GetRoles()
    {
        // Load the roles into the ListBox
        DataSet roles = BoardRoleInfoProvider.GetBoardRoles(BoardID, "RoleID,RoleDisplayName");

        return(TextHelper.Join(";", SystemDataHelper.GetStringValues(roles.Tables[0], "RoleID")));
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        // Show panel with message how to enable indexing
        ucDisabledModule.SettingsKeys = "CMSSearchIndexingEnabled";
        ucDisabledModule.InfoText     = GetString("srch.searchdisabledinfo");

        indexId = QueryHelper.GetInteger("indexid", 0);

        // Add sites filter
        uniSelector.FilterControl = "~/CMSFormControls/Filters/SiteFilter.ascx";
        uniSelector.SetValue("DefaultFilterValue", CMSContext.CurrentSiteID);
        uniSelector.SetValue("FilterMode", "cultures");

        // Get the active sites
        DataSet ds = SearchIndexCultureInfoProvider.GetSearchIndexCultures("IndexID = " + indexId, null, 0, "IndexID, IndexCultureID");

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "IndexCultureID"));
        }

        if (!URLHelper.IsPostback())
        {
            uniSelector.Value = currentValues;
        }
    }
Exemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get inline control ID from querystring
        controlId = QueryHelper.GetInteger("inlinecontrolid", 0);

        InlineControlInfo inlineControlObj = InlineControlInfoProvider.GetInlineControlInfo(controlId);

        EditedObject = inlineControlObj;

        if (controlId > 0)
        {
            // Get the active sites
            DataSet ds = InlineControlSiteInfoProvider.GetInlineControlSites("SiteID", "ControlID = " + controlId, null, 0);
            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "SiteID"));
            }

            if (!RequestHelper.IsPostBack())
            {
                usSites.Value = currentValues;
            }
        }

        usSites.OnSelectionChanged += usSites_OnSelectionChanged;
    }
Exemplo n.º 7
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(System.Web.Http.GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);


            //Apply schema changes
            //RepositoryContext.Current.System.ApplySchemaChanges();

            //Setup infopage configuration

            InfoPageConfigurator.Configure(c => {
                c.ApplicationName = "Wlog";
            });


            JobStorage.Current = new MemoryStorage();
            //Hangfire.GlobalConfiguration.Configuration.UseNLogLogProvider();
            _backgroundJobServer = new BackgroundJobServer();



            RecurringJob.AddOrUpdate(() => LogQueue.Current.Run(), "*/1 * * * *");

            SystemDataHelper.InsertRoles();
            SystemDataHelper.EnsureSampleData();
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblAvialable.Text = GetString("com.department.usersavailable");
        mDepartmentId     = QueryHelper.GetInteger("departmentid", 0);
        if (mDepartmentId > 0)
        {
            mDepartmentInfoObj = DepartmentInfoProvider.GetDepartmentInfo(mDepartmentId);
            EditedObject       = mDepartmentInfoObj;

            if (mDepartmentInfoObj != null)
            {
                CheckEditedObjectSiteID(mDepartmentInfoObj.DepartmentSiteID);

                // Get the active users
                string where = "UserID IN (SELECT UserID FROM COM_UserDepartment WHERE DepartmentID = " + mDepartmentId + ")";
                DataSet ds = UserInfoProvider.GetUsers(where, null, 0, "UserID");
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "UserID"));
                }

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

        uniSelector.IconPath            = GetObjectIconUrl("cms.user", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.WhereCondition      = GetWhereCondition();
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        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(";", SystemDataHelper.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();
    }
Exemplo n.º 10
0
    private string GetSavedItemIds()
    {
        DataSet items = BundleInfoProvider.GetBundles("BundleID = " + SKUID, "SKUID");

        if (!DataHelper.DataSourceIsEmpty(items))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(items.Tables[0], "SKUID")));
        }
        return(null);
    }
    /// <summary>
    /// Reloads the cultures in UniSelector.
    /// </summary>
    protected void ReloadCultures()
    {
        DataTable dt = UserCultureInfoProvider.GetUserCultures(userId, SiteID, null, null);

        if (!DataHelper.DataSourceIsEmpty(dt))
        {
            currentValues     = TextHelper.Join(";", SystemDataHelper.GetStringValues(dt, "CultureID"));
            uniSelector.Value = currentValues;
            uniSelector.Reload(true);
        }
    }
Exemplo n.º 12
0
    /// <summary>
    /// Returns string with culture sites.
    /// </summary>
    private string GetCultureSites()
    {
        DataSet cultures = CultureSiteInfoProvider.GetCultureSites("SiteID", "CultureID = " + culture.CultureID, null, 0);

        if (!DataHelper.DataSourceIsEmpty(cultures))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(cultures.Tables[0], "SiteID")));
        }

        return(string.Empty);
    }
Exemplo n.º 13
0
    private static string GetContactListValues()
    {
        DataSet ignoreList = IgnoreListInfoProvider.GetIgnoreList(CMSContext.CurrentUser.UserID, null, null, 0, "UserName,UserNickname,IgnoreListIgnoredUserID");

        if (!DataHelper.DataSourceIsEmpty(ignoreList))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ignoreList.Tables[0], "IgnoreListIgnoredUserID")));
        }

        return(String.Empty);
    }
    /// <summary>
    /// Returns string with site ids where user is member.
    /// </summary>
    private string GetUserSites()
    {
        DataSet ds = UserSiteInfoProvider.GetUserSites("SiteID", "UserID = " + userId, null, 0);

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "SiteID")));
        }

        return(String.Empty);
    }
Exemplo n.º 15
0
    /// <summary>
    /// Returns users related to membership.
    /// </summary>
    private string GetMembershipUsers()
    {
        DataSet ds = MembershipUserInfoProvider.GetMembershipUsers("MembershipID = " + membershipID, null, 0, "UserID");

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "UserID")));
        }

        return(String.Empty);
    }
Exemplo n.º 16
0
    /// <summary>
    /// Returns string with conversions ids
    /// </summary>
    private string GetConversions()
    {
        DataSet ds = ConversionCampaignInfoProvider.GetConversionCampaigns("CampaignID = " + campaignID, null, 0, "ConversionID");

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "ConversionID")));
        }

        return(String.Empty);
    }
    protected string GetCurrentValues()
    {
        string  currentValues = null;
        DataSet ds            = BadWordCultureInfoProvider.GetBadWordCultures("WordID=" + badWordId, null);

        // Initialize selector
        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "CultureID"));
        }
        return(currentValues);
    }
Exemplo n.º 18
0
    /// <summary>
    /// Returns string with poll sites.
    /// </summary>
    private string GetPollSites()
    {
        //DataSet ds = PollSiteInfoProvider.GetPollSites("SiteID", "PollID = " + pollId, null, 0, null);
        DataSet ds = PollInfoProvider.GetPollSites(pollId, null, null, -1, "CMS_Site.SiteID");

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "SiteID")));
        }

        return(String.Empty);
    }
Exemplo n.º 19
0
    /// <summary>
    /// Returns ID of users who are moderators to this forum.
    /// </summary>
    protected string GetModerators()
    {
        // Get all message board moderators
        DataSet ds = ForumInfoProvider.GetModerators(mForumId);

        if (!DataHelper.DataSourceIsEmpty(ds))
        {
            return(TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "UserID")));
        }

        return(String.Empty);
    }
Exemplo n.º 20
0
    /// <summary>
    /// Loads current sites from DB.
    /// </summary>
    private void GetCurrentSites()
    {
        string where = string.Format("ServerID = {0}", smtpServer.ServerID);
        serverSites  = SMTPServerSiteInfoProvider.GetSMTPServerSites(where, "SiteID");

        if (!DataHelper.DataSourceIsEmpty(serverSites))
        {
            currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(serverSites.Tables[0], "SiteID"));
        }
        else
        {
            currentValues = string.Empty;
        }
    }
Exemplo n.º 21
0
    /// <summary>
    /// Gets roles for current user.
    /// </summary>
    private void LoadCurrentRoles()
    {
        if (gmi != null)
        {
            // Get user roles
            DataSet ds = UserRoleInfoProvider.GetUserRoles("UserID = " + gmi.MemberUserID + "AND RoleID IN (SELECT RoleID FROM CMS_Role WHERE RoleGroupID = " + gmi.MemberGroupID + ")", null, 0, "RoleID");
            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "RoleID"));
            }

            currentRolesLoaded = true;
        }
    }
Exemplo n.º 22
0
    /// <summary>
    /// Loads current templates from DB.
    /// </summary>
    private void GetCurrentNewsletters()
    {
        string where        = string.Format("NewsletterID = {0}", newsletterInfo.NewsletterID);
        templateNewsletters = EmailTemplateNewsletterInfoProvider.GetEmailTemplatesNewsletters(where, "TemplateID");

        if (!DataHelper.DataSourceIsEmpty(templateNewsletters))
        {
            currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(templateNewsletters.Tables[0], "TemplateID"));
        }
        else
        {
            currentValues = String.Empty;
        }
    }
Exemplo n.º 23
0
    /// <summary>
    /// Returns ID of users who are moderators to this board.
    /// </summary>
    protected string GetModerators()
    {
        if (String.IsNullOrEmpty(currentValues))
        {
            // Get all message board moderators
            DataSet ds = BoardModeratorInfoProvider.GetBoardModerators(BoardID, "UserID", null, null, 0);
            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "UserID"));
            }
        }

        return(currentValues);
    }
Exemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        bool offerGlobalPaymentMethods = false;

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

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

                // Offer global payment methods when allowed or configuring global shipping option
                if (editedSiteId != 0)
                {
                    SiteInfo si = SiteInfoProvider.GetSiteInfo(editedSiteId);
                    if (si != null)
                    {
                        offerGlobalPaymentMethods = ECommerceSettings.AllowGlobalPaymentMethods(si.SiteName);
                    }
                }
                // Configuring global shipping option
                else
                {
                    offerGlobalPaymentMethods = true;
                }

                DataSet ds = PaymentOptionInfoProvider.GetPaymentOptionsForShipping(mShippingOptionId, false);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "PaymentOptionID"));
                }

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

        uniSelector.IconPath            = GetObjectIconUrl("ecommerce.paymentoption", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.WhereCondition      = GetSelectorWhereCondition(offerGlobalPaymentMethods);
    }
        // should we cache the value of the given property from the given item?
        internal static bool ShouldCache(object item, PropertyDescriptor pd)
        {
            // custom property descriptors returning IBindingList (bug 1190076)
            if (SystemDataHelper.IsDataSetCollectionProperty(pd))
            {
                return(true);
            }

            // XLinq's property descriptors for the Elements and Descendants properties
            if (SystemXmlLinqHelper.IsXLinqCollectionProperty(pd))
            {
                return(true);
            }

            return(false);       // everything else is treated normally
        }
Exemplo n.º 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get the site info
        si = SiteInfoProvider.GetSiteInfo(QueryHelper.GetInteger("siteId", 0));
        if (si != null)
        {
            bool multilingual  = LicenseHelper.CheckFeature(URLHelper.GetDomainName(si.DomainName), FeatureEnum.Multilingual);
            bool cultureOnSite = CultureInfoProvider.IsCultureOnSite(CultureHelper.GetDefaultCulture(si.SiteName), si.SiteName);
            if (!multilingual && !cultureOnSite)
            {
                lnkAssignDefault.Text    = GetString("sitecultures.assigntodefault");
                lnkAssignDefault.Visible = true;
                plcAll.Visible           = false;
            }
            else
            {
                // Redirect only if cultures not exceeded => to be able to unassign
                if (!CultureInfoProvider.LicenseVersionCheck(si.DomainName, FeatureEnum.Multilingual, VersionActionEnum.Edit))
                {
                    LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetDomainName(si.DomainName), FeatureEnum.Multilingual);
                }
            }

            lblAvialable.Text = GetString("site_edit_cultures.culturetitle");


            siteName = si.SiteName;

            // Store default culture (it can't be removed)
            defaultCulture = CultureHelper.GetDefaultCulture(siteName);

            // Get the active cultures from DB
            DataSet ds = CultureInfoProvider.GetCultures("CultureID IN (SELECT CultureID FROM CMS_SiteCulture WHERE SiteID = " + si.SiteID + ")", null, 0, "CultureCode");
            if (!DataHelper.DataSourceIsEmpty(ds))
            {
                currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "CultureCode"));
            }

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

        uniSelector.ReturnColumnName    = "CultureCode";
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
    }
Exemplo n.º 27
0
    private void SetTheValue()
    {
        // Get binding object
        BaseInfo bindingObj = CMSObjectHelper.GetObject(BindingObjectType);

        // Build where condition (select only bindings of the current site)
        string where = bindingObj.TypeInfo.SiteIDColumn + "=" + SiteID;

        // Initialize selector from retrieved data
        DataSet ds = bindingObj.Generalized.GetData(null, where, null, 0, null, false);

        currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], bindingObj.TypeInfo.ParentIDColumn));
        if (!RequestHelper.IsPostBack())
        {
            Value = currentValues;
        }
    }
    /// <summary>
    /// Loads list of roles authorized for form access.
    /// </summary>
    protected void LoadRoles()
    {
        DataSet ds = BizFormInfoProvider.GetFormAuthorizedRoles(formId);

        addRoles.CurrentSelector.Value = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "RoleID"));

        lstRoles.Items.Clear();
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            string name = Convert.ToString(dr["RoleDisplayName"]);
            if (ValidationHelper.GetInteger(dr["SiteID"], 0) == 0)
            {
                name += " " + GetString("general.global");
            }
            lstRoles.Items.Add(new ListItem(name, Convert.ToString(dr["RoleID"])));
        }
    }
Exemplo n.º 29
0
    /// <summary>
    /// Returns default culture translation.
    /// </summary>
    private DataSet GetDefaultCulture(DataSet completeResult)
    {
        DataSet result = null;
        string  existingTranslations = TextHelper.Join("', '", SystemDataHelper.GetStringValues(completeResult.Tables[0], "UICultureCode"));

        // Get default culture translation
        if (chkDefaultCulture.Checked || existingTranslations.Contains(CultureHelper.DefaultUICulture))
        {
            string filterWhere = null;

            // Set WHERE condition
            filterWhere = "(StringID = " + ValidationHelper.GetInteger(hdnID.Value, 0) + ")";
            filterWhere = SqlHelperClass.AddWhereCondition(filterWhere, "UICultureCode LIKE '" + CultureHelper.DefaultUICulture + "'");

            result = ConnectionHelper.ExecuteQuery("cms.resourcestring.selecttranslated", null, filterWhere, null, -1, "UICultureName, UICultureCode, TranslationText");
        }
        return(result);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        mDiscountCouponId = QueryHelper.GetInteger("discountid", 0);
        if (mDiscountCouponId > 0)
        {
            mDiscountCouponInfoObj = DiscountCouponInfoProvider.GetDiscountCouponInfo(mDiscountCouponId);
            EditedObject           = mDiscountCouponInfoObj;

            if (mDiscountCouponInfoObj != null)
            {
                // Check if edited object belongs to configured site
                CheckEditedObjectSiteID(mDiscountCouponInfoObj.DiscountCouponSiteID);

                // Get the active skus
                DataSet ds = SKUInfoProvider.GetCouponProducts(mDiscountCouponId);
                if (!DataHelper.DataSourceIsEmpty(ds))
                {
                    mCurrentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "SKUID"));
                }

                if (!RequestHelper.IsPostBack())
                {
                    uniSelector.Value    = mCurrentValues;
                    radFollowing.Checked = true;
                    radExcept.Checked    = false;

                    if (mDiscountCouponInfoObj.DiscountCouponIsExcluded)
                    {
                        radFollowing.Checked = false;
                        radExcept.Checked    = true;
                    }
                }
            }
        }

        // Init selector
        uniSelector.IconPath            = GetObjectIconUrl("ecommerce.sku", "object.png");
        uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
        uniSelector.WhereCondition      = GetWhereCondition();

        lblApplies.Text   = GetString("Discount_Product.Applies");
        radExcept.Text    = GetString("Discount_Product.radExcept");
        radFollowing.Text = GetString("Discount_Product.radFollowing");
    }