Ejemplo n.º 1
0
        //-------------------------------------------------------------------
        public void AssocieDocument(CDocumentGED document)
        {
            CRelationDocumentGED_Categorie relation = new CRelationDocumentGED_Categorie(document.ContexteDonnee);
            CFiltreData filtre = new CFiltreData(CDocumentGED.c_champId + "=@1 and " +
                                                 c_champId + "=@2",
                                                 document.Id,
                                                 Id);

            if (relation.ReadIfExists(filtre))
            {
                return;
            }
            relation.CreateNewInCurrentContexte();
            relation.Categorie = this;
            relation.Document  = document;
        }
Ejemplo n.º 2
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;
            }
        }