コード例 #1
0
ファイル: sku.ascx.cs プロジェクト: zahedbri/dashcommerce-3
        /// <summary>
        /// Creates the skus.
        /// </summary>
        /// <param name="associatedAttribute">The associated attribute.</param>
        /// <param name="level">The level.</param>
        /// <param name="tempSku">The temp sku.</param>
        private void CreateSkus(AssociatedAttribute associatedAttribute, int level, string tempSku)
        {
            int    oldLevel = level;
            string oldSku   = tempSku;

            for (int i = 0; i < associatedAttribute.AttributeItemCollection.Count; i++)
            {
                tempSku += "-" + associatedAttribute.AttributeItemCollection[i].SkuSuffix;
                level   += 1;
                if (level < associatedAttributeCollection.Count)
                {
                    CreateSkus(associatedAttributeCollection[level], level, tempSku);
                }
                if (level == associatedAttributeCollection.Count)
                {
                    skus.Add(tempSku);
                }
                tempSku = oldSku;
                level   = oldLevel;
            }
        }
コード例 #2
0
ファイル: sku.ascx.cs プロジェクト: 89sos98/dashcommerce-3
 /// <summary>
 /// Creates the skus.
 /// </summary>
 /// <param name="associatedAttribute">The associated attribute.</param>
 /// <param name="level">The level.</param>
 /// <param name="tempSku">The temp sku.</param>
 private void CreateSkus(AssociatedAttribute associatedAttribute, int level, string tempSku)
 {
     int oldLevel = level;
       string oldSku = tempSku;
       for (int i = 0;i < associatedAttribute.AttributeItemCollection.Count;i++) {
     tempSku += "-" + associatedAttribute.AttributeItemCollection[i].SkuSuffix;
     level += 1;
     if (level < associatedAttributeCollection.Count) {
       CreateSkus(associatedAttributeCollection[level], level, tempSku);
     }
     if (level == associatedAttributeCollection.Count) {
       skus.Add(tempSku);
     }
     tempSku = oldSku;
     level = oldLevel;
       }
 }