Class RelationsRows
Instance of a relation, in principle between any two records, as long as they are defined in RelationDefinition. All instances of relations are held in this table; their definitions are in the RelDef table (RelDef + RelTarg define which relations you can have, this table contains the relations the user has actually entered). From 6.1 all links between appointments, sales and documents are also stored in this tabel. Collection of RelationsRow. Each element of the collection represents one row in the Relations table.
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.CRM.Rows
Assembly: SoDataBase.dll
Syntax
public class RelationsRows : TableRowsBase, INestedPersist, IEnumerable<INestedPersist>, ISoCollection, INotifyCollectionChanged, IBindingList, IList, ICollection, IEnumerable
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Properties
this[int]
Get a RelationsRow given its index in the collection.
Declaration
public RelationsRow this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of the RelationsRow in the collection |
Property Value
Type | Description |
---|---|
RelationsRow |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Methods
Add(RelationsRow)
Add one RelationsRow to the collection.
Declaration
public int Add(RelationsRow row)
Parameters
Type | Name | Description |
---|---|---|
RelationsRow | row | An instance of RelationsRow to be added to the collection. |
Returns
Type | Description |
---|---|
int | The index of the added RelationsRow. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
AddNew()
Add a new instance of RelationsRow added to the collection.
Declaration
public RelationsRow AddNew()
Returns
Type | Description |
---|---|
RelationsRow | A new instance of RelationsRow added to the collection. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
AddRange(IEnumerable<RelationsRow>)
Add a range of RelationsRow to the collection.
Declaration
public RelationsRows AddRange(IEnumerable<RelationsRow> rows)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<RelationsRow> | rows |
Returns
Type | Description |
---|---|
RelationsRows | The updated RelationsRows collection object. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
CreateChild()
Create a new instance of RelationsRow
Declaration
protected override TableRowBase CreateChild()
Returns
Type | Description |
---|---|
TableRowBase | New instance of RelationsRow |
Overrides
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
CreateNew()
Create a new instance of the RelationsRows object. This collection will contain no rows.
Declaration
public static RelationsRows CreateNew()
Returns
Type | Description |
---|---|
RelationsRows | A new instance of the RelationsRows object. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Find(Predicate<RelationsRow>)
Apply the predicate to each element of the collection and return the first row that matches; if no match then return null
Declaration
public RelationsRow Find(Predicate<RelationsRow> condition)
Parameters
Type | Name | Description |
---|---|---|
Predicate<RelationsRow> | condition |
Returns
Type | Description |
---|---|
RelationsRow |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
FindAll(Predicate<RelationsRow>)
Return a new collection that contains only those elements that match the condition. Elements are shared, not clones! of the original collection
Declaration
public RelationsRows FindAll(Predicate<RelationsRow> condition)
Parameters
Type | Name | Description |
---|---|---|
Predicate<RelationsRow> | condition |
Returns
Type | Description |
---|---|
RelationsRows |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ForEach(Action<RelationsRow>)
Method that iterates over all members and applies the action parameter to each of them
Declaration
public void ForEach(Action<RelationsRow> whatToDo)
Parameters
Type | Name | Description |
---|---|---|
Action<RelationsRow> | whatToDo |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
GetFromCustomSearch(CustomSearch)
Create a new instance of the RelationsRows object, and populate it with data from a custom search. If the search returns no results, an empty collection will be returned; if the result contains rows, a collection of RelationsRow objects representing each row will be returned.
Declaration
public static RelationsRows GetFromCustomSearch(RelationsRows.CustomSearch query)
Parameters
Type | Name | Description |
---|---|---|
RelationsRows.CustomSearch | query | The custom search to execute against the database |
Returns
Type | Description |
---|---|
RelationsRows | A new instance of the RelationsRows object, reflecting the result of the query. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
GetFromIdxDestinationRecord(int)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelDestination_record'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxDestinationRecord(int destinationRecord)
Parameters
Type | Name | Description |
---|---|---|
int | destinationRecord |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxDestinationTable(short)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelDestination_table'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxDestinationTable(short destinationTable)
Parameters
Type | Name | Description |
---|---|---|
short | destinationTable |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxDestinationTableDestinationRecord(short, int)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDestination_tableDestination_recordReversed'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxDestinationTableDestinationRecord(short destinationTable, int destinationRecord)
Parameters
Type | Name | Description |
---|---|---|
short | destinationTable | |
int | destinationRecord |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxDestinationTableDestinationRecordReversed(short, int, short)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDestination_tableDestination_recordReversed'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxDestinationTableDestinationRecordReversed(short destinationTable, int destinationRecord, short reversed)
Parameters
Type | Name | Description |
---|---|---|
short | destinationTable | |
int | destinationRecord | |
short | reversed |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxReldefId(int)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelReldef_id'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxReldefId(int reldefId)
Parameters
Type | Name | Description |
---|---|---|
int | reldefId |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxReversed(short)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelReversed'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxReversed(short reversed)
Parameters
Type | Name | Description |
---|---|---|
short | reversed |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxSourceRecord(int)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelSource_record'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxSourceRecord(int sourceRecord)
Parameters
Type | Name | Description |
---|---|---|
int | sourceRecord |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxSourceTable(short)
Create a new instance of the RelationsRow object, by querying the database table via the index 'IDXRelSource_table'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxSourceTable(short sourceTable)
Parameters
Type | Name | Description |
---|---|---|
short | sourceTable |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxSourceTableSourceRecord(short, int)
Create a new instance of the RelationsRow object, by querying the database table via the index 'ISource_tableSource_recordReversed'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxSourceTableSourceRecord(short sourceTable, int sourceRecord)
Parameters
Type | Name | Description |
---|---|---|
short | sourceTable | |
int | sourceRecord |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromIdxSourceTableSourceRecordReversed(short, int, short)
Create a new instance of the RelationsRow object, by querying the database table via the index 'ISource_tableSource_recordReversed'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static RelationsRows GetFromIdxSourceTableSourceRecordReversed(short sourceTable, int sourceRecord, short reversed)
Parameters
Type | Name | Description |
---|---|---|
short | sourceTable | |
int | sourceRecord | |
short | reversed |
Returns
Type | Description |
---|---|
RelationsRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Relations table. Non-unique indexes have corresponding inner classes and methods in the RelationsRows collection, since they may return more than one row.
GetFromReader(SoDataReader, RelationsTableInfo)
Create a new instance of the RelationsRows object, and populate it with data from a reader. If the search returns no results, an empty collection will be returned; if the result contains rows, a collection of RelationsRow objects representing each row will be returned.
Note that the internal logic starts by calling reader.Read(), which is correct if you hand the method the result of an ExecuteReader(), but if the reader has already been advanced one or more rows, the current row will be skipped and collection population will start with the next row.Declaration
public static RelationsRows GetFromReader(SoDataReader reader, RelationsTableInfo tableInfo)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | SoDataReader positioned to a valid database row. |
RelationsTableInfo | tableInfo | RelationsTableInfo instance used in the query that is the source of the reader. The fields used from the reader will be those owned by this tableinfo object. |
Returns
Type | Description |
---|---|
RelationsRows |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Remove(RelationsRow)
Removes the given RelationsRow from the collection
Declaration
public void Remove(RelationsRow row)
Parameters
Type | Name | Description |
---|---|---|
RelationsRow | row | the RelationsRow to be removed |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ToArray()
Instance of a relation, in principle between any two records, as long as they are defined in RelationDefinition. All instances of relations are held in this table; their definitions are in the RelDef table (RelDef + RelTarg define which relations you can have, this table contains the relations the user has actually entered). From 6.1 all links between appointments, sales and documents are also stored in this tabel. Collection of RelationsRow. Each element of the collection represents one row in the Relations table.
Declaration
public RelationsRow[] ToArray()
Returns
Type | Description |
---|---|
RelationsRow[] |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ToString()
For debugging: Number of members, and the first (up to) 5 items
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type RelationsRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) RelationsRows RelationsRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.