Show / Hide Table of Contents

Class PersonCollection

Persons in a company or an organization

Collection of Person. Each element of the collection represents one entity based on Person.
Inheritance
object
NestedPersist
NestedPersistFacade
NestedCollectionPersist
EntityCollectionBase
PersonCollection
Implements
INestedPersist
IEnumerableINestedPersist
INotifyCollectionChanged
IBindingList
IList
ICollection
IEnumerable
Inherited Members
EntityCollectionBase._innerList
EntityCollectionBase.DeleteAsync()
EntityCollectionBase.GetEnumerator()
EntityCollectionBase.Add(EntityBase)
EntityCollectionBase.Remove(EntityBase)
EntityCollectionBase.CopyTo(Array, int)
EntityCollectionBase.IndexOf(object)
EntityCollectionBase.Contains(object)
EntityCollectionBase.AddIndex(PropertyDescriptor)
EntityCollectionBase.ApplySort(PropertyDescriptor, ListSortDirection)
EntityCollectionBase.Find(PropertyDescriptor, object)
EntityCollectionBase.RemoveIndex(PropertyDescriptor)
EntityCollectionBase.RemoveSort()
EntityCollectionBase.IsDirty
EntityCollectionBase.Count
EntityCollectionBase.IsFixedSize
EntityCollectionBase.IsReadOnly
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.IsDeleted
NestedPersistFacade.OnPreIdUpdateAsync()
NestedPersistFacade.OnPrimaryKeyRequestAsync(PKContainer)
NestedPersistFacade.OnPrimaryKeyUpdateAsync(PKContainer)
NestedPersistFacade.OnIdUpdateAsync()
NestedPersistFacade.OnSaveAsync(BatchSave)
NestedPersistFacade.OnSavedAsync(bool)
NestedPersist._saveOwner
NestedPersist._isSaving
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.SaveAsync()
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: SuperOfficeCRMEntities
Assembly: SoDataBase.dll
Syntax
public class PersonCollection : EntityCollectionBase, INestedPersist, IEnumerable<INestedPersist>, INotifyCollectionChanged, IBindingList, IList, ICollection, IEnumerable
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 SuperOffice.CRM.Rows.Person to it, and use methods like Save to operate on the whole collection.
  • You can create a (nested) PersonCollection PersonCollection.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 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 Person object directly, which has nested classes and GetFromIdx methods for each unique index.

Unique indexes on table Person are:

Index fieldsNested index class name
PersonIdPersonId:

Primary key

Nested index class: Person.IdxPersonId

Static Get method: GetFromIdxPersonId(int)

Non-unique indexes on table Person are:
Index fieldsNested index class name
CategoryIdxCategoryIdx:

Category if this is a B2C person, otherwise mirror of contact.category_idx

Nested index class: PersonCollection.IdxCategoryIdx

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxCategoryIdx

PersonNumberPersonNumber:

Alphanumeric user-field

Nested index class: PersonCollection.IdxPersonNumber

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxPersonNumber

BusinessIdxBusinessIdx:

Business if this is a B2C person, otherwise mirror of contact.business_idx

Nested index class: PersonCollection.IdxBusinessIdx

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxBusinessIdx

UserdefIdUserdefId:

User-defined table record 1

Nested index class: PersonCollection.IdxUserdefId

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxUserdefId

KanalnameKanalname:

JPN

Nested index class: PersonCollection.IdxKanalname

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxKanalname

LastnameLastname:

Last name

Nested index class: PersonCollection.IdxLastname

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxLastname

ContactIdContactId:

Owning contact ID, 0 is not allowed

Nested index class: PersonCollection.IdxContactId

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxContactId

Userdef2IdUserdef2Id:

User-defined table record 2

Nested index class: PersonCollection.IdxUserdef2Id

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxUserdef2Id

FirstnameFirstname:

First name

Nested index class: PersonCollection.IdxFirstname

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxFirstname

SourceSource:

How did we get this person? For future integration requirements

Nested index class: PersonCollection.IdxSource

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxSource

KanafnameKanafname:

JPN

Nested index class: PersonCollection.IdxKanafname

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxKanafname

ContactId, RankContactId:

Owning contact ID, 0 is not allowed

Rank:

Display sort sequence; person with rank 1 has special role in selections (rank is unique within each contact and starts on 1).

Nested index class: PersonCollection.IdxContactIdRank

Static Get method: SuperOffice.CRM.Entities.PersonCollection.GetFromIdxContactIdRank

Constructors

PersonCollection(PersonCollectionIdx)

Constructor for class PersonCollection.
This object represents a collection of rows in table 'person'. Table contact: Persons in a company or an organisation

Declaration
protected PersonCollection(PersonCollection.PersonCollectionIdx idx)
Parameters
Type Name Description
PersonCollectionPersonCollectionIdx idx

Fields

_idx

Fetcher class the collection is based on

Declaration
protected PersonCollection.PersonCollectionIdx _idx
Field Value
Type Description
PersonCollectionPersonCollectionIdx

_rows

Row objects that the collection is based on.

Declaration
protected PersonRows _rows
Field Value
Type Description
PersonRows

Properties

Index

Retrieve the index for PersonCollection

Declaration
public PersonCollection.PersonCollectionIdx Index { get; }
Property Value
Type Description
PersonCollectionPersonCollectionIdx

this[int]

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

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

Zero-based index in the collection.

Property Value
Type Description
Person

Rows

The ecapsulated object PersonRows.

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

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(Person)

Add one Person to the collection.

Declaration
public int Add(Person person)
Parameters
Type Name Description
Person person

An instance of Person to be added to the collection.

Returns
Type Description
int

The index of the added Person.

AddNew()

Get a new instance of Person added to the collection.

Declaration
public Person AddNew()
Returns
Type Description
Person

A new instance of Person added to the collection.

CreateChild()

Create a new instance of Person

Declaration
protected override EntityBase CreateChild()
Returns
Type Description
EntityBase

New instance of Person

Overrides
EntityCollectionBase.CreateChild()

CreateNew()

Create a new instance of the PersonCollection.

Declaration
public static PersonCollection CreateNew()
Returns
Type Description
PersonCollection

A new instance of the PersonCollection.

GetFromCustomSearch(CustomSearch)

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

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

The custom search to execute against the database

Returns
Type Description
PersonCollection

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

GetFromCustomSearchAsync(CustomSearch, CancellationToken)

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

Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
public static Task<PersonCollection> GetFromCustomSearchAsync(PersonCollection.CustomSearch query, CancellationToken cancellationToken = default)
Parameters
Type Name Description
PersonCollectionCustomSearch query

The custom search to execute against the database

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

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

GetFromIdxBusinessIdxAsync(int, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxBusinessIdxAsync(int businessIdx, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int businessIdx

Business if this is a B2C person, otherwise mirror of contact.business_idx

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersBusn_idx. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxCategoryIdxAsync(int, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxCategoryIdxAsync(int categoryIdx, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int categoryIdx

Category if this is a B2C person, otherwise mirror of contact.category_idx

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersCatg_idx. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxContactIdAsync(int, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxContactIdAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Owning contact ID, 0 is not allowed

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersCont_id. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxContactIdRankAsync(int, short, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxContactIdRankAsync(int contactId, short rank, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int contactId

Owning contact ID, 0 is not allowed

short rank

Display sort sequence.ToPersonCollectionAsync(cancellationToken); person with rank 1 has special role in selections (rank is unique within each contact and starts on 1).

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 ICont_idRank. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxFirstnameAsync(string, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxFirstnameAsync(string firstname, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string firstname

First name

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersFname. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxKanafnameAsync(string, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxKanafnameAsync(string kanafname, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string kanafname

JPN

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersKfname. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxKanalnameAsync(string, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxKanalnameAsync(string kanalname, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string kanalname

JPN

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersKlname. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxLastnameAsync(string, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxLastnameAsync(string lastname, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string lastname

Last name

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersLname. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxPersonNumberAsync(string, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxPersonNumberAsync(string personNumber, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string personNumber

Alphanumeric user-field

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersPnum. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxSourceAsync(short, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxSourceAsync(short source, CancellationToken cancellationToken = default)
Parameters
Type Name Description
short source

How did we get this person? For future integration requirements

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersSource. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxUserdef2IdAsync(int, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxUserdef2IdAsync(int userdef2Id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userdef2Id

User-defined table record 2

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersUdef2_id. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

GetFromIdxUserdefIdAsync(int, CancellationToken)

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

Declaration
public static Task<PersonCollection> GetFromIdxUserdefIdAsync(int userdefId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userdefId

User-defined table record 1

CancellationToken cancellationToken
Returns
Type Description
TaskPersonCollection

New PersonRows 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 IDXPersUdef_id. Unique indexes have corresponding Create methods directly on the PersonRow object, since such indexes always return zero or one rows.

Remove(Person)

Removes the given Person from the collection

Declaration
public void Remove(Person person)
Parameters
Type Name Description
Person person

the Person to be removed

ToArray()

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

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
IEnumerable<T>
INotifyCollectionChanged
IBindingList
IList
ICollection
IEnumerable

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