private TreeNode GetNodesChilds(Supplier Supplier, List<Supplier> Suppliers)
{
TreeNode oNode;
oNode = new TreeNode(Supplier.ID + ": " + Supplier.Name, Convert.ToString(Supplier.ID));
//oNode.ImageUrl = GetPublishImage(menu.ID);
if (ViewState[CMSViewStateManager.SupplierID] != null)
{
int SupplierSelected = Convert.ToInt32(ViewState[CMSViewStateManager.SupplierID]);
if (SupplierSelected > 0 && oNode.Value == SupplierSelected.ToString())
{
oNode.Selected = true;
}
}
List<Supplier> SupplierChilds = Suppliers.Where(m => m.ParentSupplierID == Supplier.ID).ToList();
if (SupplierChilds.Count > 0)
{
foreach (AJH.CMS.Core.Entities.Supplier SupplierChild in SupplierChilds)
{
oNode.ChildNodes.Add(GetNodesChilds(SupplierChild, Suppliers));
}
}
return oNode;
}
#endregion