/// <summary> /// Pull Category Node by CategoryCode entered /// </summary> /// <param name="sCategoryCode">Category Code passed as a string</param> /// <returns>CategoryNode</returns> public CategoryNode GetMerchandiseCategory(string sCategoryCode) { Exists = false; Error = false; ErrorMessage = ""; CategoryNode cwNode = new CategoryNode(); if (NextNode.Count > 0) { string sLevelCategory = ""; cwNode = GetMerchandiseCategory(sCategoryCode, ref sLevelCategory); } else { Error = true; ErrorMessage = "CategoryNodes List not populated."; } return(cwNode); }
/// <summary> /// Dynamic Loop to retrieve Category Node from Category Code entered /// </summary> /// <param name="sCategoryCode"></param> /// <param name="cnNodes"></param> /// <param name="cnNode"></param> /// <param name="sLevelCategory"></param> /// <param name="bDone"></param> public void MerchandiseCategoryRetriever(int iCategoryCode, List <CategoryNode> cnNodes, ref CategoryNode cwNode, ref string sLevelCategory, ref bool bExist) { foreach (CategoryNode cnTmpNode1 in cnNodes) { if (cnTmpNode1.CategoryCode == iCategoryCode) { sLevelCategory = "|" + cnTmpNode1.CategoryCode + "#" + cnTmpNode1.Description; cwNode = cnTmpNode1; bExist = true; break; } if (cnTmpNode1.NextNode != null) { MerchandiseCategoryRetriever(iCategoryCode, cnTmpNode1.NextNode, ref cwNode, ref sLevelCategory, ref bExist); if (bExist) { sLevelCategory = "|" + cnTmpNode1.CategoryCode + "#" + cnTmpNode1.Description + sLevelCategory; break; } } } }