Show / Hide Table of Contents

Class GenericTableInfo

'Generic' tableinfo class, that can be used to represent any table that is defined in the runtime dictionary in the database. These can be both system tables and user-defined tables. It does not provide a typed interface to the individual fields.

Inheritance
object
TableInfo
GenericTableInfo
Implements
ICloneable
Inherited Members
TableInfo.ToString()
TableInfo.RegisterFields(params FieldInfo[])
TableInfo.FieldInfoFromSoField(SoField)
TableInfo.Clone()
TableInfo.IsSameTable(TableInfo)
TableInfo.FindField(string)
TableInfo.ProtAll
TableInfo.HashCheckFields
TableInfo.TableName
TableInfo.DbName
TableInfo.Definition
TableInfo.IsDictionaryTable
TableInfo.All
TableInfo.this[string]
TableInfo.PrimaryKeyField
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Data
Assembly: SoDataBase.dll
Syntax
public class GenericTableInfo : TableInfo, ICloneable
Remarks

When the table layout is known in advance, either because a table is defined by SuperOffice, or because a tableinfo has been generated by the Web Service, a typed tableinfo is to be preferred. However, sometimes it is necessary to work in a more generic manner, and that is where this class is useful.

A GenericTableInfo can be created by name through the TablesInfo.GetTableInfo(SoTable) method. Note that GetTableInfo will return a typed object for Superoffice system tables.

Since this class does not provide members for fields, one must use the FindField method to look up fields by name, or simply use the All property to get an array of fields and index by position.

This class can be used anywhere a TableInfo is expected - in queries, etc.
TableInfo myTab = TablesInfo.GetTableInfo( "userDefinedTable" );
Select sql = S.NewSelect();
FieldInfo myFieldInfo = myTab.FindField( "myField" );
sql.ReturnFields.Add( myFieldInfo );
sql.Restriction = myTab.FindField( "theKey" ).Equal( S.Parameter( 2 ) );
using( QueryExecutionHelper qeh = new QueryExecutionHelper( sql ) )
{
	while( qeh.Reader.Read() )
	{
		int myField = qeh.Reader.GetInt32( myFieldInfo );
		// use the value
	}
}
The example above fetches the int field 'myField' from 'userDefinedTable', restricting the rows to those that have 'theKey' equal to 2.

Implements

ICloneable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top