public static void RemoveRelation(InternalSetBase dataSet, InternalTableBase parent, InternalTableBase table) { var relationName = InternalSetBase.GenerateRelationName(table); if (dataSet != null) { dataSet.Relations.Remove(relationName); } }
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()); }
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 { } }
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); } } } }
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()); }