Show / Hide Table of Contents

Class ContactCollection

Companies and Organisations.

This table features a special record containing information about the contact that owns the database.

Collection of Contact. Each element of the collection represents one entity based on Contact.
Inheritance
Object
NestedPersist
NestedPersistFacade
NestedCollectionPersist
EntityCollectionBase
ContactCollection
Implements
INestedPersist
IEnumerable<INestedPersist>
ISoCollection
IList
ICollection
IEnumerable
INotifyCollectionChanged
IBindingList
Inherited Members
EntityCollectionBase._innerList
EntityCollectionBase.Delete()
EntityCollectionBase.GetEnumerator()
EntityCollectionBase.Add(EntityBase)
EntityCollectionBase.ISoCollection.Add(ISoItem)
EntityCollectionBase.ISoCollection.AddNew()
EntityCollectionBase.Remove(EntityBase)
EntityCollectionBase.IList.get_Item(Int32)
EntityCollectionBase.IList.set_Item(Int32, Object)
EntityCollectionBase.CopyTo(Array, Int32)
EntityCollectionBase.IList.Add(Object)
EntityCollectionBase.IList.Remove(Object)
EntityCollectionBase.IndexOf(Object)
EntityCollectionBase.Contains(Object)
EntityCollectionBase.IList.Clear()
EntityCollectionBase.IList.Insert(Int32, Object)
EntityCollectionBase.IList.RemoveAt(Int32)
EntityCollectionBase.AddIndex(PropertyDescriptor)
EntityCollectionBase.ApplySort(PropertyDescriptor, ListSortDirection)
EntityCollectionBase.Find(PropertyDescriptor, Object)
EntityCollectionBase.RemoveIndex(PropertyDescriptor)
EntityCollectionBase.RemoveSort()
EntityCollectionBase.IsDirty
EntityCollectionBase.Count
EntityCollectionBase.IList.Item[Int32]
EntityCollectionBase.ICollection.Count
EntityCollectionBase.IsFixedSize
EntityCollectionBase.IsReadOnly
EntityCollectionBase.ICollection.IsSynchronized
EntityCollectionBase.ICollection.SyncRoot
EntityCollectionBase.AllowEdit
EntityCollectionBase.AllowNew
EntityCollectionBase.AllowRemove
EntityCollectionBase.IsSorted
EntityCollectionBase.SortDirection
EntityCollectionBase.SortProperty
EntityCollectionBase.SupportsChangeNotification
EntityCollectionBase.SupportsSearching
EntityCollectionBase.SupportsSorting
EntityCollectionBase.CollectionChanged
EntityCollectionBase.ListChanged
NestedCollectionPersist.GetFacadingItems()
NestedCollectionPersist.IEnumerable<INestedPersist>.GetEnumerator()
NestedCollectionPersist.IsDeleted
NestedPersistFacade.OnPreIdUpdate()
NestedPersistFacade.OnPrimaryKeyRequest(PKContainer)
NestedPersistFacade.OnPrimaryKeyUpdate(PKContainer)
NestedPersistFacade.OnIdUpdate()
NestedPersistFacade.OnSave(BatchSave)
NestedPersistFacade.OnSaved(Boolean)
NestedPersist._saveOwner
NestedPersist._isSaving
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.Save()
NestedPersist.INestedPersist.OnPreIdUpdate()
NestedPersist.INestedPersist.OnPrimaryKeyRequest(PKContainer)
NestedPersist.INestedPersist.OnPrimaryKeyUpdate(PKContainer)
NestedPersist.INestedPersist.OnIdUpdate()
NestedPersist.INestedPersist.OnSave(BatchSave)
NestedPersist.INestedPersist.OnSaved(Boolean)
NestedPersist.IsSaving
NestedPersist.IsMarkedForDelete
NestedPersist.OnElementSaved
NestedPersist.OnElementIdUpdate
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public class ContactCollection : EntityCollectionBase, INestedPersist, IEnumerable<INestedPersist>, ISoCollection, IList, ICollection, IEnumerable, ITableRowLoadHandlerFactory, INotifyCollectionChanged, IBindingList
Remarks

Entity 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 to it, and use methods like to operate on the whole collection.
  • You can create a (nested) ContactCollection ContactCollection.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(ContactCollection.CustomSearch) method to apply the query to the database and obtain the result as an EntityCollection 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.
Unique indexes are handled through the Contact object directly, which has nested classes and GetFromIdx methods for each unique index.

Unique indexes on table Contact are:

Index fieldsNested index class name
ContactIdContactId:

Primary key

Nested index class: Contact.IdxContactId

Static Get method: GetFromIdxContactId(Int32)

Non-unique indexes on table Contact are:
Index fieldsNested index class name
SoundExSoundEx:

What the name sounds like, for duplicate detection

Nested index class: ContactCollection.IdxSoundEx

Static Get method: GetFromIdxSoundEx(String)

KananameKananame:

JPN

Nested index class: ContactCollection.IdxKananame

Static Get method: GetFromIdxKananame(String)

MotherIdMotherId:

<not used>

Nested index class: ContactCollection.IdxMotherId

Static Get method: GetFromIdxMotherId(Int32)

BusinessIdxBusinessIdx:

List: business

Nested index class: ContactCollection.IdxBusinessIdx

Static Get method: GetFromIdxBusinessIdx(Int32)

NameName:

Name

Nested index class: ContactCollection.IdxName

Static Get method: GetFromIdxName(String)

UserdefIdUserdefId:

User-defined table record 1

Nested index class: ContactCollection.IdxUserdefId

Static Get method: GetFromIdxUserdefId(Int32)

OrgNrOrgNr:

VAT number or similar, takes dynamic lead text from Country table

Nested index class: ContactCollection.IdxOrgNr

Static Get method: GetFromIdxOrgNr(String)

Number1Number1:

Alphanumeric user field, contains auto-assigned number if numbering is in use.

Nested index class: ContactCollection.IdxNumber1

Static Get method: GetFromIdxNumber1(String)

Number2Number2:

Alphanumeric user field

Nested index class: ContactCollection.IdxNumber2

Static Get method: GetFromIdxNumber2(String)

Userdef2IdUserdef2Id:

User-defined table record 2

Nested index class: ContactCollection.IdxUserdef2Id

Static Get method: GetFromIdxUserdef2Id(Int32)

DepartmentDepartment:

Department

Nested index class: ContactCollection.IdxDepartment

Static Get method: GetFromIdxDepartment(String)

Name, DepartmentName:

Name

Department:

Department

Nested index class: ContactCollection.IdxNameDepartment

Static Get method: GetFromIdxNameDepartment(String, String)

CategoryIdxCategoryIdx:

List: category

Nested index class: ContactCollection.IdxCategoryIdx

Static Get method: GetFromIdxCategoryIdx(Int32)

SourceSource:

How did we get this contact? For future integration needs

Nested index class: ContactCollection.IdxSource

Static Get method: GetFromIdxSource(Int16)

Constructors

ContactCollection(ContactCollection.ContactCollectionIdx)

Constructor for class ContactCollection.
This object represents a collection of rows in table 'contact'. Table contact: Companies and Organisations

Declaration
protected ContactCollection(ContactCollection.ContactCollectionIdx idx)
Parameters
Type Name Description
ContactCollection.ContactCollectionIdx idx

Fields

_idx

Fetcher class the collection is based on

Declaration
protected ContactCollection.ContactCollectionIdx _idx
Field Value
Type Description
ContactCollection.ContactCollectionIdx

_rows

Row objects that the collection is based on.

Declaration
protected ContactRows _rows
Field Value
Type Description
ContactRows

Properties

Index

Retrieve the index for ContactCollection

Declaration
public ContactCollection.ContactCollectionIdx Index { get; }
Property Value
Type Description
ContactCollection.ContactCollectionIdx

Item[Int32]

Get a Contact from the collection from its zero-based index.

Declaration
public Contact this[int index] { get; }
Parameters
Type Name Description
Int32 index

Zero-based index in the collection.

Property Value
Type Description
Contact

Rows

The ecapsulated object ContactRows.

Declaration
public ContactRows Rows { get; }
Property Value
Type Description
ContactRows

Sentries

The collection of sentries that are guarding this collection of rows. This collection is used by RDB entities which return HDB collections.

For example, the contact.Faxes returns a PhoneRows collection in which each row will need to check the contact's sentry for permission to read/write their field

Declaration
public override SentryCollection Sentries { get; }
Property Value
Type Description
SentryCollection
Overrides
EntityCollectionBase.Sentries

Methods

Add(Contact)

Add one Contact to the collection.

Declaration
public int Add(Contact contact)
Parameters
Type Name Description
Contact contact

An instance of Contact to be added to the collection.

Returns
Type Description
Int32

The index of the added Contact.

AddNew()

Get a new instance of Contact added to the collection.

Declaration
public Contact AddNew()
Returns
Type Description
Contact

A new instance of Contact added to the collection.

CreateChild()

Create a new instance of Contact

Declaration
protected override EntityBase CreateChild()
Returns
Type Description
EntityBase

New instance of Contact

Overrides
EntityCollectionBase.CreateChild()

CreateNew()

Create a new instance of the ContactCollection.

Declaration
public static ContactCollection CreateNew()
Returns
Type Description
ContactCollection

A new instance of the ContactCollection.

GetFromCustomSearch(ContactCollection.CustomSearch)

Create a new instance of the ContactCollection 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 ContactRow objects representing each row will be returned.

Declaration
public static ContactCollection GetFromCustomSearch(ContactCollection.CustomSearch query)
Parameters
Type Name Description
ContactCollection.CustomSearch query

The custom search to execute against the database

Returns
Type Description
ContactCollection

A new instance of the ContactCollection object, reflecting the result of the query.

GetFromIdxBusinessIdx(Int32)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxBusinessIdx(int businessIdx)
Parameters
Type Name Description
Int32 businessIdx

List: business

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContBusn_idx. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxCategoryIdx(Int32)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxCategoryIdx(int categoryIdx)
Parameters
Type Name Description
Int32 categoryIdx

List: category

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContCatg_idx. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxDepartment(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxDepartment(string department)
Parameters
Type Name Description
String department

Department

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContDept. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxKananame(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxKananame(string kananame)
Parameters
Type Name Description
String kananame

JPN

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContKname. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxMotherId(Int32)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxMotherId(int motherId)
Parameters
Type Name Description
Int32 motherId

<not used>

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContMother_id. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxName(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxName(string name)
Parameters
Type Name Description
String name

Name

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContName. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxNameDepartment(String, String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxNameDepartment(string name, string department)
Parameters
Type Name Description
String name

Name

String department

Department

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index INameDept. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxNumber1(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxNumber1(string number1)
Parameters
Type Name Description
String number1

Alphanumeric user field, contains auto-assigned number if numbering is in use.

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContNum1. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxNumber2(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxNumber2(string number2)
Parameters
Type Name Description
String number2

Alphanumeric user field

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContNum2. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxOrgNr(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxOrgNr(string orgNr)
Parameters
Type Name Description
String orgNr

VAT number or similar, takes dynamic lead text from Country table

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContOrgNr. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxSoundEx(String)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxSoundEx(string soundEx)
Parameters
Type Name Description
String soundEx

What the name sounds like, for duplicate detection

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContSoundEx. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxSource(Int16)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxSource(short source)
Parameters
Type Name Description
Int16 source

How did we get this contact? For future integration needs

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContSource. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxUserdef2Id(Int32)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxUserdef2Id(int userdef2Id)
Parameters
Type Name Description
Int32 userdef2Id

User-defined table record 2

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContUdef2_id. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

GetFromIdxUserdefId(Int32)

Create a new instance of the ContactRows object, and populate it with ContactRow objects based on the result of a query on the table Contact. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ContactCollection GetFromIdxUserdefId(int userdefId)
Parameters
Type Name Description
Int32 userdefId

User-defined table record 1

Returns
Type Description
ContactCollection

New ContactRows collection containing the result of the index query. If no rows matched, the collection will be empty.

Remarks

The query matches the fields on the non-unique index IDXContUdef_id. Unique indexes have corresponding Create methods directly on the ContactRow object, since such indexes always return zero or one rows.

Remove(Contact)

Removes the given Contact from the collection

Declaration
public void Remove(Contact contact)
Parameters
Type Name Description
Contact contact

the Contact to be removed

ToArray()

Declaration
public Contact[] ToArray()
Returns
Type Description
Contact[]

ToString()

For debugging: Number of members, and the first (up to) 5 items

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Implements

INestedPersist
System.Collections.Generic.IEnumerable<T>
ISoCollection
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Specialized.INotifyCollectionChanged
System.ComponentModel.IBindingList

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