Code: Select all
SELECT cp.ParentId FROM ac_CatalogNodes cn INNER JOIN ac_CategoryParents cp ON cn.CategoryId = cp.CategoryId WHERE cn.CatalogNodeId = @productID AND cn.CatalogNodeTypeId = 1 AND cp.ParentLevel = 1
Code: Select all
SELECT cp.ParentId FROM ac_CatalogNodes cn INNER JOIN ac_CategoryParents cp ON cn.CategoryId = cp.CategoryId WHERE cn.CatalogNodeId = @productID AND cn.CatalogNodeTypeId = 1 AND cp.ParentLevel = 1
Code: Select all
int categoryId = PageHelper.GetCategoryId(true);
Code: Select all
protected void InitializeCategoryTree()
{
int st = 1;
if(_CatalogNodeType == CatalogNodeType.Category)
{
ListItem item = new ListItem("Top Level","0");
NewPath.Items.Add(item);
st = 0;
}
CategoryLevelNodeCollection categories = CategoryParentDataSource.GetCategoryLevels((_CatalogNodeType == CatalogNodeType.Category ? _CatalogNodeId : 0));
foreach (CategoryLevelNode node in categories)
{
string prefix = string.Empty;
for (int i = st; i <= node.CategoryLevel; i++) prefix += " . . ";
NewPath.Items.Add(new ListItem(prefix + node.Name, node.CategoryId.ToString()));
if (IsInExistingCategories(node.CategoryId))
{
// ADD TO CURRENT CATEGORIES LIST AS WELL
CurrentCategories.Items.Add(new ListItem(node.Name, node.CategoryId.ToString()));
}
}
//FIND CURRENT CATEGORY AND REMOVE
ListItem current = NewPath.Items.FindByValue(_CategoryId.ToString());
if (current != null) NewPath.SelectedIndex = NewPath.Items.IndexOf(current);
}