//-------------------------------------------------------
 private void AddCategory(CCategorieGED cat, HashSet <int> setCats)
 {
     setCats.Add(cat.Id);
     if (IncludeSubCategories)
     {
         foreach (CCategorieGED subCat in cat.CategoriesFilles)
         {
             AddCategory(subCat, setCats);
         }
     }
 }
Exemple #2
0
        public bool IsInCategory(CCategorieGED category)
        {
            if (category == null)
            {
                return(false);
            }
            CListeObjetsDonnees lstCats = RelationsCategories;

            lstCats.Filtre = new CFiltreData(CCategorieGED.c_champId + "=@1", category.Id);
            return(lstCats.Count != 0);
        }
Exemple #3
0
        public void RemoveCategory(CCategorieGED category)
        {
            if (category == null)
            {
                return;
            }
            CListeObjetsDonnees lstCats = RelationsCategories;

            lstCats.Filtre = new CFiltreData(CCategorieGED.c_champId + "=@1", category.Id);
            if (lstCats.Count > 0)
            {
                CObjetDonneeAIdNumerique.Delete(lstCats, true);
            }
        }
Exemple #4
0
        public void AddCategory(CCategorieGED category)
        {
            if (category == null)
            {
                return;
            }
            CListeObjetsDonnees lstCats = RelationsCategories;

            lstCats.Filtre = new CFiltreData(CCategorieGED.c_champId + "=@1", category.Id);
            if (lstCats.Count == 0)
            {
                CRelationDocumentGED_Categorie rel = new CRelationDocumentGED_Categorie(ContexteDonnee);
                rel.CreateNewInCurrentContexte();
                rel.Document  = this;
                rel.Categorie = category;
            }
        }