Ejemplo n.º 1
0
        public void Add(string name, CacheTable table)
        {
            DataTable  dt = new DataTable(name);
            DataColumn dc = null;

            foreach (CacheColumn column in table.CacheColumnCollection.Items)
            {
                dc = new DataColumn(column.Name, column.GetDataType());
                dt.Columns.Add(dc);
            }

            cache_set.Add(dt);
        }
 public CacheTable(Cache cache, DataRow driving_data, CacheTable configuration)
 {
     SharedData            = cache;
     DrivingData           = driving_data;
     Name                  = configuration.Name;
     DrivingTableName      = configuration.DrivingTableName;
     CacheTableCollection  = configuration.CacheTableCollection;
     CacheColumnCollection = configuration.CacheColumnCollection;
     Union                 = configuration.Union;
     Join                  = configuration.Join;
     Filter                = configuration.Filter;
     Sort                  = configuration.Sort;
     Aggregate             = configuration.Aggregate;
 }
        private DataTable PerformUnion(CacheTable cache_table)
        {
            DataTable data_table1, data_table2;

            if (cache_table.Union != null)
            {
                data_table1 = PerformUnion(cache_table.Union.DataTable);

                data_table2 = SharedData.Data.Tables(cache_table.Name).Copy();

                data_table1.Merge(data_table2);

                data_table1.TableName = cache_table.Union.NewTableName;

                return(data_table1);
            }
            else
            {
                return(SharedData.Data.Tables(cache_table.Name).Copy());
            }
        }