Esempio n. 1
0
        private static void AddExtraRelationships(IDataTableFinder TableFinder, VirtualDataTable aData, TRelationshipList Relations, TBand band, TMasterDetailLinkList MasterDetailLinkList)
        {
            foreach (TRelationship tr in Relations)
            {
                TDataSourceInfo dParent = TableFinder.TryGetDataTable(tr.ParentTable);
                if (dParent == null || dParent.Table == null)
                {
                    FlxMessages.ThrowException(FlxErr.ErrInvalidManualRelationshipDatasetNull, tr.ParentTable);
                }

                TDataSourceInfo dChild = TableFinder.TryGetDataTable(tr.ChildTable);
                if (dChild == null || dChild.Table == null)
                {
                    FlxMessages.ThrowException(FlxErr.ErrInvalidManualRelationshipDatasetNull, tr.ChildTable);
                }

                if (SameTable(dChild.Table, aData) && SameTable(dParent.Table, band.DataSource.Data))
                {
                    GetColIndexes(dParent.Table, tr.ParentColumns, true); //we do it here so it checks all columns exist in the parent. They might not exist in our table, and that is ok if our table is a distinct for example)
                    GetColIndexes(dChild.Table, tr.ChildColumns, true);
                    int[] ChildCols  = GetColIndexes(aData, tr.ChildColumns, false);
                    int[] ParentCols = GetColIndexes(band.DataSource.Data, tr.ParentColumns, false);

                    if (ChildCols != null && ParentCols != null)
                    {
                        MasterDetailLinkList.AddRelation(band.DataSource.DataState,
                                                         new TRelation(band.DataSource.Data, aData, ParentCols,
                                                                       ChildCols));
                    }
                }
            }
        }
Esempio n. 2
0
 internal TDataSourceInfo this[string key]
 {
     get
     {
         TDataSourceInfo Result = null;
         if (FList.TryGetValue(key, out Result))
         {
             return(Result);
         }
         return(null);
     }
 }
Esempio n. 3
0
        private void DestroyItem(string key, bool OnlyTemp)
        {
            if (!OwnsObjects)
            {
                return;
            }

            TDataSourceInfo di = this[key];

            if (di != null && (di.TempTable || (!OnlyTemp && di.VirtualTableNeedsDispose)))
            {
                di.DestroyTables();
                FList.Remove(key);
            }
        }
Esempio n. 4
0
 internal void Add(string dtName, VirtualDataTable dt, bool VirtualTableNeedsDispose)
 {
     DestroyItem(dtName);
     FList[dtName] = new TDataSourceInfo(dtName, dt, "", "", VirtualTableNeedsDispose, VirtualTableNeedsDispose, TableFinder);
 }
Esempio n. 5
0
 internal void Add(string dvName, TDataSourceInfo di)
 {
     DestroyItem(dvName);
     FList[di.Name] = di;
 }
Esempio n. 6
0
 internal void Add(string dvName, DataView dv, bool DataViewNeedsDispose)
 {
     DestroyItem(dvName);
     FList[dvName] = new TDataSourceInfo(dvName, new TAdoDotNetDataTable(dvName, null, dv.Table, DataViewNeedsDispose), dv.RowFilter, dv.Sort, true, DataViewNeedsDispose, TableFinder);
 }
Esempio n. 7
0
 internal void Add(string dtName, DataTable dt, bool DataTableNeedsDispose)
 {
     DestroyItem(dtName);
     FList[dtName] = new TDataSourceInfo(dtName, new TAdoDotNetDataTable(dtName, null, dt, DataTableNeedsDispose), "", "", true, DataTableNeedsDispose, TableFinder);
 }