Class ActivityLinksHelper
Helper class for links to activite
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public sealed class ActivityLinksHelper : LinksHelper, INestedPersist
Constructors
ActivityLinksHelper(TableRowBase, TableRowBase)
Default constructor setting the activity link source info
Declaration
public ActivityLinksHelper(TableRowBase sourceEntityRow, TableRowBase activeLinksRow)
Parameters
Type | Name | Description |
---|---|---|
TableRowBase | sourceEntityRow | The row object of the source entity |
TableRowBase | activeLinksRow |
Methods
AddAppointmentLink(AppointmentRow)
Adds a link to an existing appointment
Declaration
public RelationsRow AddAppointmentLink(AppointmentRow row)
Parameters
Type | Name | Description |
---|---|---|
AppointmentRow | row | The appointment that is linked to |
Returns
Type | Description |
---|---|
RelationsRow | The new link |
AddDocumentLink(DocumentRow)
Adds a link to an existing document
Declaration
public RelationsRow AddDocumentLink(DocumentRow row)
Parameters
Type | Name | Description |
---|---|---|
DocumentRow | row | The document that is linked to |
Returns
Type | Description |
---|---|
RelationsRow | The new link |
AddLinks(RelationsRows)
Adds link relations to the entity. If the source does not match the LinkHelper source an exception is thrown.
Declaration
public override RelationsRows AddLinks(RelationsRows relationsRows)
Parameters
Type | Name | Description |
---|---|---|
RelationsRows | relationsRows | Collection Relations Rows to save |
Returns
Type | Description |
---|---|
RelationsRows | The saved RelationsRows |
Overrides
AddSaleLink(SaleRow)
Adds a link to an existing sale
Declaration
public RelationsRow AddSaleLink(SaleRow row)
Parameters
Type | Name | Description |
---|---|---|
SaleRow | row | The sale that is linked to |
Returns
Type | Description |
---|---|
RelationsRow | The new link |
DeleteLinks(params int[])
Deletes the links if the link belongs to the source entity
Declaration
public override void DeleteLinks(params int[] linkIds)
Parameters
Type | Name | Description |
---|---|---|
int[] | linkIds |
Overrides
GetFacadingItems()
Implement this method to expose items that needs to be persisted.
Declaration
protected override IEnumerable<INestedPersist> GetFacadingItems()
Returns
Type | Description |
---|---|
IEnumerable<INestedPersist> | Collection of items that needs to be persisted. |
Overrides
OnPreIdUpdate()
Allow for "fake id's" to be forced upon related objects.
Declaration
protected override void OnPreIdUpdate()
Overrides
Remarks
In order to figure out which objects taking part of the nested save operation that actually needs to be saved, this method allows for "fake id's" to be forced upon related objects. Upon receiving the "fake id", the objects receiving such an id can determine if they needs to be persisted (e.g. saved) to the database. However, the fake id's forced upon related objects must be set to correct id's in the OnIdUpdate method taking place later in the save operation.
OnPrimaryKeyRequest(PKContainer)
Force a primary key request to set the sqltype of the target row, even if it is not actually a full member of our nestedpersist tree
Declaration
protected override void OnPrimaryKeyRequest(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer |
Overrides
OnSaved(bool)
Called after the save operation has completed. A boolean value is passed to notify whether or not the save operation succeeded. The complete save operation is rolled back if Save operation failed.
Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type | Name | Description |
---|---|---|
bool | bSucceeded | True if the save operation succeeded and false if the save operation failed and rolled back. |
Overrides
SetLinks(RelationsRows)
Sets link relations to the entity. Existing relations are deleted or updated If the source does not match the LinkHelper source an exception is thrown.
Declaration
public override void SetLinks(RelationsRows relationsRows)
Parameters
Type | Name | Description |
---|---|---|
RelationsRows | relationsRows | Collection of Relation Rows to save |