/// <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; } }
/// <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; } }