Esempio n. 1
0
        private void FillDropDowns()
        {
            this.ddlDiscountType.Items.Clear();
            DiscountTypeCollection discountTypes = DiscountManager.GetAllDiscountTypes();

            foreach (DiscountType discountType in discountTypes)
            {
                ListItem item2 = new ListItem(discountType.Name, discountType.DiscountTypeId.ToString());
                this.ddlDiscountType.Items.Add(item2);
            }

            this.ddlDiscountRequirement.Items.Clear();
            DiscountRequirementCollection discountRequirements = DiscountManager.GetAllDiscountRequirements();

            foreach (DiscountRequirement discountRequirement in discountRequirements)
            {
                ListItem item2 = new ListItem(discountRequirement.Name, discountRequirement.DiscountRequirementId.ToString());
                this.ddlDiscountRequirement.Items.Add(item2);
            }

            this.ddlDiscountLimitation.Items.Clear();
            DiscountLimitationCollection discountLimitations = DiscountManager.GetAllDiscountLimitations();

            foreach (DiscountLimitation discountLimitation in discountLimitations)
            {
                ListItem item2 = new ListItem(discountLimitation.Name, discountLimitation.DiscountLimitationId.ToString());
                this.ddlDiscountLimitation.Items.Add(item2);
            }
        }
Esempio n. 2
0
        private void FillDropDowns()
        {
            //discunt types
            this.ddlDiscountType.Items.Clear();
            var discountTypes = DiscountManager.GetAllDiscountTypes();

            foreach (DiscountType discountType in discountTypes)
            {
                ListItem item2 = new ListItem(discountType.Name, discountType.DiscountTypeId.ToString());
                this.ddlDiscountType.Items.Add(item2);
            }

            //discount requirements
            this.ddlDiscountRequirement.Items.Clear();
            var discountRequirements = DiscountManager.GetAllDiscountRequirements();

            foreach (DiscountRequirement discountRequirement in discountRequirements)
            {
                ListItem item2 = new ListItem(discountRequirement.Name, discountRequirement.DiscountRequirementId.ToString());
                this.ddlDiscountRequirement.Items.Add(item2);
            }

            //discount limitations
            this.ddlDiscountLimitation.Items.Clear();
            var discountLimitations = DiscountManager.GetAllDiscountLimitations();

            foreach (DiscountLimitation discountLimitation in discountLimitations)
            {
                ListItem item2 = new ListItem(discountLimitation.Name, discountLimitation.DiscountLimitationId.ToString());
                this.ddlDiscountLimitation.Items.Add(item2);
            }

            //required billing countries
            this.ddlRequirementBillingCountryIs.Items.Clear();
            ListItem rbciEmpty = new ListItem(GetLocaleResourceString("Admin.DiscountInfo.RequirementBillingCountryIs.SelectCountry"), "0");

            this.ddlRequirementBillingCountryIs.Items.Add(rbciEmpty);
            var billingCountries = CountryManager.GetAllCountriesForBilling();

            foreach (Country country in billingCountries)
            {
                ListItem ddlCountryItem2 = new ListItem(country.Name, country.CountryId.ToString());
                this.ddlRequirementBillingCountryIs.Items.Add(ddlCountryItem2);
            }

            //required shipping countries
            this.ddlRequirementShippingCountryIs.Items.Clear();
            ListItem rsciEmpty = new ListItem(GetLocaleResourceString("Admin.DiscountInfo.RequirementShippingCountryIs.SelectCountry"), "0");

            this.ddlRequirementShippingCountryIs.Items.Add(rsciEmpty);
            var shippingCountries = CountryManager.GetAllCountriesForShipping();

            foreach (Country country in shippingCountries)
            {
                ListItem ddlCountryItem2 = new ListItem(country.Name, country.CountryId.ToString());
                this.ddlRequirementShippingCountryIs.Items.Add(ddlCountryItem2);
            }
        }