Example #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);
            }
        }
        private static DiscountLimitationCollection DBMapping(DBDiscountLimitationCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new DiscountLimitationCollection();

            foreach (var dbItem in dbCollection)
            {
                var item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }