Class EntityBase
Summary description for EntityBase.
Inheritance
Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public abstract class EntityBase : NestedPersist, INestedPersist, ISoItem, ITableRowLoadHandler
Constructors
EntityBase()
Default constructor.
Declaration
protected EntityBase()
Fields
_onGetRelatedObjects
Summary description for EntityBase.
Declaration
protected GetRelatedObjects _onGetRelatedObjects
Field Value
Type | Description |
---|---|
GetRelatedObjects |
Properties
IsDirty
Check if any of the related objects are dirty.
Declaration
public override bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
IsNew
Is the row new, e.g. not been inserted to the database?
Declaration
public abstract bool IsNew { get; }
Property Value
Type | Description |
---|---|
bool |
MainRow
Get the main row for the entity.
Declaration
protected abstract TableRowBase MainRow { get; }
Property Value
Type | Description |
---|---|
TableRowBase |
Methods
Delete()
Delete the object.
Declaration
public abstract void Delete()
ForceEntityUpdate()
This method is called when only related objects are changed in order for the entity to force the Updated and UpdatedAssociate to be modified on the entity.
Declaration
protected abstract void ForceEntityUpdate()
GetAdditionalRelatedNestedPersist(List<INestedPersist>, bool)
Hand-implemented partial class code should override this method to add to the list of related nestedpersist objects
Declaration
protected virtual void GetAdditionalRelatedNestedPersist(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type | Name | Description |
---|---|---|
List<INestedPersist> | relatedObjects | |
bool | lacyFetchIfNeeded |
GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist>, bool)
Summary description for EntityBase.
Declaration
protected void GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type | Name | Description |
---|---|---|
List<INestedPersist> | relatedObjects | |
bool | lacyFetchIfNeeded |
GetRelatedNestedPersist(List<INestedPersist>, bool)
Generated code should override this method to return its list of related nestedpersist objects
Declaration
protected abstract void GetRelatedNestedPersist(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type | Name | Description |
---|---|---|
List<INestedPersist> | relatedObjects | |
bool | lacyFetchIfNeeded | Lacy fetch objects that is not allready loaded if needed |
OnIdUpdate()
Summary description for EntityBase.
Declaration
protected override void OnIdUpdate()
Overrides
OnIdUpdateImplementation()
Summary description for EntityBase.
Declaration
protected virtual void OnIdUpdateImplementation()
OnPreIdUpdate()
Summary description for EntityBase.
Declaration
protected override void OnPreIdUpdate()
Overrides
OnPreIdUpdateImplementation()
Summary description for EntityBase.
Declaration
protected virtual void OnPreIdUpdateImplementation()
OnPrimaryKeyRequest(PKContainer)
Summary description for EntityBase.
Declaration
protected override void OnPrimaryKeyRequest(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer |
Overrides
OnPrimaryKeyUpdate(PKContainer)
Summary description for EntityBase.
Declaration
protected override void OnPrimaryKeyUpdate(PKContainer pkContainer)
Parameters
Type | Name | Description |
---|---|---|
PKContainer | pkContainer |
Overrides
OnRowLoad(SoDataReader, TableRowBase)
Summary description for EntityBase.
Declaration
protected abstract void OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | |
TableRowBase | row |
OnRowLoaded()
Summary description for EntityBase.
Declaration
protected abstract void OnRowLoaded()
OnSave(BatchSave)
Summary description for EntityBase.
Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Type | Name | Description |
---|---|---|
BatchSave | batchSave |
Overrides
OnSaved(bool)
Summary description for EntityBase.
Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type | Name | Description |
---|---|---|
bool | bSucceeded |
Overrides
SetMarkedForDeleteOnRelatedObjects(bool)
Call this method to set the marked for delete on related objects.
Implement this method in implementation of enteties to set marked for delete on related objects
Declaration
protected virtual void SetMarkedForDeleteOnRelatedObjects(bool isMarkedForDelete)
Parameters
Type | Name | Description |
---|---|---|
bool | isMarkedForDelete | True if the objects are to be removed from the database the next time it is saved. |
UpdateSentryRelatedTableInfoInstance<MainTableInfoType>(SentryCollection, TableInfo)
Update a TableInfo object in all sentries in the entity, with a new instance of the same kind of table
Declaration
protected void UpdateSentryRelatedTableInfoInstance<MainTableInfoType>(SentryCollection sentries, TableInfo newInstance) where MainTableInfoType : TableInfo
Parameters
Type | Name | Description |
---|---|---|
SentryCollection | sentries | |
TableInfo | newInstance |
Type Parameters
Name | Description |
---|---|
MainTableInfoType |
Remarks
This method should be called only when NEW, DEPENDENT ROW objects are being created
by a multi-row-type entity. It updates a TableInfo instance in the Sentry's SentryQueryInfo
class (the one that defines what tables the sentry should calculate rights for),
with another instance of the same type.
This has to be done so that the TableInfo in the newly created and attached Row object
matches the TableInfo in the Sentry, otherwise the Sentry will not provide any field
rights.
Calling this method in a context where a query or query results are being analyzed should be avoided,
as it only looks at the types involved and might mix up the tableinfo's from multiple
aliases of the same table in a single query.
Validate()
Check the entity and related objects for consistency and required fields, and return fields and error messages.
Declaration
public abstract Dictionary<string, string> Validate()
Returns
Type | Description |
---|---|
Dictionary<string, string> | Field names and error messages |
Events
OnGetRelatedObjects
Event raised when related objects are being collected for saving.
Declaration
public event GetRelatedObjects OnGetRelatedObjects
Event Type
Type | Description |
---|---|
GetRelatedObjects |