Show / Hide Table of Contents

Class EntityBase

Summary description for EntityBase.

Inheritance
Object
NestedPersist
EntityBase
Appointment
Contact
Document
Person
Project
ProjectMember
Sale
Selection
Implements
INestedPersist
ISoItem
ITableRowLoadHandler
Inherited Members
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.IsDeleted
NestedPersist.IsMarkedForDelete
NestedPersist.OnElementSaved
NestedPersist.OnElementIdUpdate
Object.ToString()
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 abstract class EntityBase : NestedPersist, INestedPersist, ISoItem, ITableRowLoadHandler

Constructors

EntityBase()

Default constructor.

Declaration
protected EntityBase()

Fields

_onGetRelatedObjects

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
Boolean
Overrides
NestedPersist.IsDirty

IsNew

Is the row new, e.g. not been inserted to the database?

Declaration
public abstract bool IsNew { get; }
Property Value
Type Description
Boolean

MainRow

Get the main row for the entity.

Declaration
protected abstract TableRowBase MainRow { get; }
Property Value
Type Description
TableRowBase

Methods

Delete()

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>, Boolean)

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
Boolean lacyFetchIfNeeded

GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist>, Boolean)

Declaration
protected void GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type Name Description
List<INestedPersist> relatedObjects
Boolean lacyFetchIfNeeded

GetRelatedNestedPersist(List<INestedPersist>, Boolean)

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
Boolean lacyFetchIfNeeded

Lacy fetch objects that is not allready loaded if needed

OnIdUpdate()

Declaration
protected override void OnIdUpdate()
Overrides
NestedPersist.OnIdUpdate()

OnIdUpdateImplementation()

Declaration
protected virtual void OnIdUpdateImplementation()

OnPreIdUpdate()

Declaration
protected override void OnPreIdUpdate()
Overrides
NestedPersist.OnPreIdUpdate()

OnPreIdUpdateImplementation()

Declaration
protected virtual void OnPreIdUpdateImplementation()

OnPrimaryKeyRequest(PKContainer)

Declaration
protected override void OnPrimaryKeyRequest(PKContainer pkContainer)
Parameters
Type Name Description
PKContainer pkContainer
Overrides
NestedPersist.OnPrimaryKeyRequest(PKContainer)

OnPrimaryKeyUpdate(PKContainer)

Declaration
protected override void OnPrimaryKeyUpdate(PKContainer pkContainer)
Parameters
Type Name Description
PKContainer pkContainer
Overrides
NestedPersist.OnPrimaryKeyUpdate(PKContainer)

OnRowLoad(SoDataReader, TableRowBase)

Declaration
protected abstract void OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
Type Name Description
SoDataReader reader
TableRowBase row

OnRowLoaded()

Declaration
protected abstract void OnRowLoaded()

OnSave(BatchSave)

Declaration
protected override void OnSave(BatchSave batchSave)
Parameters
Type Name Description
BatchSave batchSave
Overrides
NestedPersist.OnSave(BatchSave)

OnSaved(Boolean)

Declaration
protected override void OnSaved(bool bSucceeded)
Parameters
Type Name Description
Boolean bSucceeded
Overrides
NestedPersist.OnSaved(Boolean)

SetMarkedForDeleteOnRelatedObjects(Boolean)

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
Boolean 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

Explicit Interface Implementations

ITableRowLoadHandler.OnRowLoad(SoDataReader, TableRowBase)

Declaration
void ITableRowLoadHandler.OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
Type Name Description
SoDataReader reader
TableRowBase row

ITableRowLoadHandler.OnRowLoaded()

Declaration
void ITableRowLoadHandler.OnRowLoaded()

Implements

INestedPersist
ISoItem
ITableRowLoadHandler

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