Ejemplo n.º 1
0
        public static KnowledgeBaseCategory GetKnowledgeBaseCategory(LoginUser loginUser, int categoryID)
        {
            KnowledgeBaseCategories knowledgeBaseCategories = new KnowledgeBaseCategories(loginUser);

            knowledgeBaseCategories.LoadByCategoryID(categoryID);
            if (knowledgeBaseCategories.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(knowledgeBaseCategories[0]);
            }
        }
Ejemplo n.º 2
0
        public static int?GetIDByName(LoginUser loginUser, string name, int?parentID)
        {
            KnowledgeBaseCategories categories = new KnowledgeBaseCategories(loginUser);

            categories.LoadByName(loginUser.OrganizationID, name);
            if (categories.IsEmpty)
            {
                return(null);
            }
            else
            {
                return(categories[0].CategoryID);
            }
        }
Ejemplo n.º 3
0
        public static string GetKnowledgeBaseCategoryDisplayString(LoginUser loginUser, int categoryID)
        {
            KnowledgeBaseCategories knowledgeBaseCategories     = new KnowledgeBaseCategories(loginUser);
            KnowledgeBaseCategories knowledgeBaseParentCategory = new KnowledgeBaseCategories(loginUser);

            knowledgeBaseCategories.LoadByCategoryID(categoryID);
            if (knowledgeBaseCategories.IsEmpty)
            {
                return(null);
            }
            else if (knowledgeBaseCategories[0].ParentID > 0)
            {
                knowledgeBaseParentCategory.LoadByCategoryID(knowledgeBaseCategories[0].ParentID);
                return(knowledgeBaseParentCategory[0].CategoryName + " -> " + knowledgeBaseCategories[0].CategoryName);
            }
            else
            {
                return(knowledgeBaseCategories[0].CategoryName);
            }
        }
Ejemplo n.º 4
0
 public KnowledgeBaseCategory(DataRow row, KnowledgeBaseCategories knowledgeBaseCategories) : base(row, knowledgeBaseCategories)
 {
     _knowledgeBaseCategories = knowledgeBaseCategories;
 }