예제 #1
0
        public static void RemoveRelation(InternalSetBase dataSet, InternalTableBase parent, InternalTableBase table)
        {
            var relationName = InternalSetBase.GenerateRelationName(table);

            if (dataSet != null)
            {
                dataSet.Relations.Remove(relationName);
            }
        }
예제 #2
0
        public CremaDataRow[] GetChildRows(CremaDataTable childTable)
        {
            if (childTable.Parent != this.Table)
            {
                return(null);
            }

            var relationName = InternalSetBase.GenerateRelationName(childTable.InternalObject);

            return(this.InternalObject.GetChildRows(relationName).Select(item => (item as InternalDataRow).Target).ToArray());
        }
예제 #3
0
        public static void AddRelation(InternalSetBase dataSet, InternalTableBase parent, InternalTableBase table)
        {
            var relationName = InternalSetBase.GenerateRelationName(table);

            if (dataSet != null)
            {
                dataSet.Relations.Add(relationName, parent.ColumnRelation, table.ParentRelation);
            }
            else
            {
            }
        }
예제 #4
0
 public void RefreshRelation(InternalTableBase table)
 {
     for (var i = 0; i < this.Relations.Count; i++)
     {
         var item = this.Relations[i];
         if (item.ParentTable == table || item.ChildTable == table)
         {
             if (item.ParentTable is InternalTableBase parentTable && item.ChildTable is InternalTableBase childTable)
             {
                 item.RelationName = InternalSetBase.GenerateRelationName(childTable);
             }
         }
     }
 }
예제 #5
0
        public CremaDataRow[] GetChildRows(string childTableName)
        {
            var relationName = InternalSetBase.GenerateRelationName(childTableName, this.Table.Namespace);

            return(this.InternalObject.GetChildRows(relationName).Select(item => (item as InternalDataRow).Target).ToArray());
        }