/// <summary> /// Gets the level. /// </summary> /// <param name="category">The category.</param> /// <returns></returns> public int GetLevel(tbl_PublicationCategory category) { var level = 0; while (category != null) { level++; category = category.tbl_PublicationCategory2; } return(level); }
/// <summary> /// Gets the full name of the category. /// </summary> /// <param name="category">The category.</param> /// <param name="delimetr">The delimetr.</param> /// <returns></returns> public string GetCategoryFullName(tbl_PublicationCategory category, string delimetr) { var result = string.Empty; while (category != null) { if (String.IsNullOrEmpty(result)) { result = category.Title; } else { result = delimetr + result; } category = category.tbl_PublicationCategory2; } return(result); }