//------------------------------------------------------------------------ private static void AddSystemesCoordonnees(CContexteDonnee ctx, CMemoryDb db) { CListeObjetDonneeGenerique <CSystemeCoordonnees> lst = new CListeObjetDonneeGenerique <CSystemeCoordonnees>(ctx); lst.ReadDependances("RelationFormatsNumerotation"); foreach (CSystemeCoordonnees systemeTimos in lst) { TID.CSystemeCoordonnees systeme = new TID.CSystemeCoordonnees(db); systeme.CreateNew(systemeTimos.Id); systeme.Libelle = systemeTimos.Libelle; foreach (CRelationSystemeCoordonnees_FormatNumerotation relTimos in systemeTimos.RelationFormatsNumerotation) { TID.CRelationSystemeCoordonnees_FormatNumerotation rel = new TID.CRelationSystemeCoordonnees_FormatNumerotation(db); TID.CFormatNumerotation format = new TID.CFormatNumerotation(db); int?nId = (int?)relTimos.Row[CFormatNumerotation.c_champId, true]; if (nId == null || format.ReadIfExistsIdTimos(nId.Value)) { TID.CUniteCoordonnee unite = new TID.CUniteCoordonnee(db); nId = (int?)relTimos.Row[CUniteCoordonnee.c_champId, true]; if (nId == null || unite.ReadIfExistsIdTimos(nId.Value)) { rel.CreateNew(relTimos.Id); rel.FormatNumerotation = format; rel.Libelle = relTimos.Libelle; rel.Position = relTimos.Position; rel.Prefixes = relTimos.Prefixes; rel.SystemeDeCoordonnees = systeme; rel.Unite = unite; } } } } }
//------------------------------------------------------------------------ private static void AddFormatsNumerotation(CContexteDonnee ctx, CMemoryDb db) { CListeObjetDonneeGenerique <CFormatNumerotation> lst = new CListeObjetDonneeGenerique <CFormatNumerotation>(ctx); foreach (CFormatNumerotation formatTimos in lst) { TID.CFormatNumerotation format = new TID.CFormatNumerotation(db); format.CreateNew(formatTimos.Id); format.Libelle = formatTimos.Libelle; format.LongueurReference = formatTimos.LongueurReference; format.Romain = formatTimos.Romain; format.Sequence = formatTimos.Sequence; } }