Show / Hide Table of Contents

Class ProjectMember

Link-table between person and project

Entity Object for table 'projectmember'. Entity objects represent full entities with both the base table object and all related objects, such as and things like owner associate and whatever else is logically related to the base object.
Inheritance
Object
NestedPersist
EntityBase
ProjectMember
Implements
INestedPersist
ISoItem
ITableRowLoadHandler
Inherited Members
EntityBase._onGetRelatedObjects
EntityBase.GetAdditionalRelatedNestedPersistViaBaseClass(List<INestedPersist>, Boolean)
EntityBase.GetAdditionalRelatedNestedPersist(List<INestedPersist>, Boolean)
EntityBase.OnPrimaryKeyRequest(PKContainer)
EntityBase.OnPrimaryKeyUpdate(PKContainer)
EntityBase.OnSave(BatchSave)
EntityBase.OnSaved(Boolean)
EntityBase.SetMarkedForDeleteOnRelatedObjects(Boolean)
EntityBase.ITableRowLoadHandler.OnRowLoad(SoDataReader, TableRowBase)
EntityBase.ITableRowLoadHandler.OnRowLoaded()
EntityBase.OnPreIdUpdateImplementation()
EntityBase.OnIdUpdateImplementation()
EntityBase.UpdateSentryRelatedTableInfoInstance<MainTableInfoType>(SentryCollection, TableInfo)
EntityBase.IsDirty
EntityBase.OnGetRelatedObjects
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.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 class ProjectMember : EntityBase, INestedPersist, ISoItem, ITableRowLoadHandler
Remarks

Entity objects can be created in several ways.

  • Use the static CreateNew() method to create a new, empty object. After populating it with values, you call the method and corresponding row(s) in the database are created, and the objects' primary key field updated. This is the preferred way to insert new entities into the database.
  • You can create a (nested) ProjectMember ProjectMember.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(ProjectMember.CustomSearch) method to apply the query to the database and obtain the result as an Entity object. This is how you select existing entities from the database when you have a query that does not correspond to any of the existing database indexes.
  • For each unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy. Note that if you try to fetch a row that does not exist (for instance, by using the primary key index and specifying a primary key that does not exist in the database), you will get a Row object with the and properties set to true. Such an Entity object is called a 'ghost' and cannot be updated, saved or deleted. You can also get a ghost if the row does exist in the database, but the Sentry system denies Select rights to the row.
Non-unique indexes are handled through the ProjectMemberCollection collection, which has nested classes and GetFromIdx methods for each non-unique index. There are no 'GetFromReader' methods, since that would be rather complex (multiple TableInfo objects required).

Unique indexes on ProjectMember are:

Index fieldsNested index class name
ProjectmemberIdProjectmemberId:

Primary key

Nested index class: ProjectMember.IdxProjectmemberId

Static Get method: GetFromIdxProjectmemberId(Int32)

Non-unique indexes on table ProjectMember are:
Index fieldsNested index class name
PersonIdPersonId:

person_id

Nested index class: ProjectMemberCollection.IdxPersonId

Static Get method: GetFromIdxPersonId(Int32)

ContactIdContactId:

contact_id of person (denormalisation!)

Nested index class: ProjectMemberCollection.IdxContactId

Static Get method: GetFromIdxContactId(Int32)

ProjectId, RankProjectId:

Parent project

Rank:

Rank in list (starts over for each project)

Nested index class: ProjectMemberCollection.IdxProjectIdRank

Static Get method: GetFromIdxProjectIdRank(Int32, Int16)

Constructors

ProjectMember(ProjectMember.ProjectMemberIdxBase)

Constructor for class ProjectMember.
This object represents a row in table 'projectmember'. Table contact: Project members

Declaration
protected ProjectMember(ProjectMember.ProjectMemberIdxBase idx)
Parameters
Type Name Description
ProjectMember.ProjectMemberIdxBase idx

ContactRowProjectMemberRow.ProjectMemberRowIdx object that the Contact encapsulates.

ProjectMember(ProjectMemberRow, ProjectMember.ProjectMemberIdxBase)

Declaration
protected ProjectMember(ProjectMemberRow row, ProjectMember.ProjectMemberIdxBase idx)
Parameters
Type Name Description
ProjectMemberRow row
ProjectMember.ProjectMemberIdxBase idx

Fields

_contact

Related HDB object(s).

Declaration
protected Contact _contact
Field Value
Type Description
Contact

_createdAssociate

Related HDB object(s).

Declaration
protected AssociateRow _createdAssociate
Field Value
Type Description
AssociateRow

_memberType

Related HDB object(s).

Declaration
protected PMembTypeRow _memberType
Field Value
Type Description
PMembTypeRow

_person

Related HDB object(s).

Declaration
protected Person _person
Field Value
Type Description
Person

_project

Related HDB object(s).

Declaration
protected Project _project
Field Value
Type Description
Project

_row

HDB object this entity is a facade for.

Declaration
protected ProjectMemberRow _row
Field Value
Type Description
ProjectMemberRow

_rowIdx

Declaration
protected ProjectMember.ProjectMemberIdxBase _rowIdx
Field Value
Type Description
ProjectMember.ProjectMemberIdxBase

_text

Related HDB object(s).

Declaration
protected TextRow _text
Field Value
Type Description
TextRow

_updatedAssociate

Related HDB object(s).

Declaration
protected AssociateRow _updatedAssociate
Field Value
Type Description
AssociateRow

Properties

Contact

Related object Contact: Companies and Organisations

Declaration
public Contact Contact { get; set; }
Property Value
Type Description
Contact

CreatedAssociate

Related object AssociateRow: Employees, resources and other users - except for External persons

Declaration
public AssociateRow CreatedAssociate { get; set; }
Property Value
Type Description
AssociateRow

IsDeleted

Is the row deleted?

Declaration
public override bool IsDeleted { get; }
Property Value
Type Description
Boolean
Overrides
NestedPersist.IsDeleted

IsMarkedForDelete

Gets or sets a value indicating whether this instance is marked for delete.

Declaration
public override bool IsMarkedForDelete { get; set; }
Property Value
Type Description
Boolean

true if this instance is marked for delete; otherwise, false.

Overrides
NestedPersist.IsMarkedForDelete

IsNew

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

Declaration
public override bool IsNew { get; }
Property Value
Type Description
Boolean
Overrides
EntityBase.IsNew

MainRow

Return the main row for the Entity.

Declaration
protected override TableRowBase MainRow { get; }
Property Value
Type Description
TableRowBase
Overrides
EntityBase.MainRow

MemberType

Related object PMembTypeRow: PMembType list table

Declaration
public PMembTypeRow MemberType { get; set; }
Property Value
Type Description
PMembTypeRow

Person

Related object Person: Persons in a company or an organisation

Declaration
public Person Person { get; set; }
Property Value
Type Description
Person

Project

Related object Project: Projects

Declaration
public Project Project { get; set; }
Property Value
Type Description
Project

ProjectmemberId

Primary key

Declaration
public int ProjectmemberId { get; }
Property Value
Type Description
Int32

Rank

Rank in list

Declaration
public short Rank { get; set; }
Property Value
Type Description
Int16

Registered

Registered when

Declaration
public DateTime Registered { get; set; }
Property Value
Type Description
DateTime

Row

The encapsulated object ProjectMemberRow.

Declaration
public ProjectMemberRow Row { get; }
Property Value
Type Description
ProjectMemberRow

TableInfo

Get a TableInfo object for the projectMember table.

Declaration
public ProjectMemberTableInfo TableInfo { get; }
Property Value
Type Description
ProjectMemberTableInfo

Text

Related object TextRow: Long text fields from all over the system

Declaration
public TextRow Text { get; set; }
Property Value
Type Description
TextRow

Updated

Last updated when

Declaration
public DateTime Updated { get; set; }
Property Value
Type Description
DateTime

UpdatedAssociate

Related object AssociateRow: Employees, resources and other users - except for External persons

Declaration
public AssociateRow UpdatedAssociate { get; set; }
Property Value
Type Description
AssociateRow

UpdatedCount

Declaration
public short UpdatedCount { get; set; }
Property Value
Type Description
Int16

Methods

CreateNew()

Create a new instance of the ProjectMember entity.

Declaration
public static ProjectMember CreateNew()
Returns
Type Description
ProjectMember

A new instance of the ProjectMember entity.

CreateNew(ProjectMember.ProjectMemberIdxBase)

Create a new instance of the ProjectMember entity, by reading from the database using the specified index (represented by a nested index class).

Declaration
public static ProjectMember CreateNew(ProjectMember.ProjectMemberIdxBase idx)
Parameters
Type Name Description
ProjectMember.ProjectMemberIdxBase idx

Index search, represented by a subclass if the ProjectMember.ProjectMemberIdxBase nested index class

Returns
Type Description
ProjectMember

A new instance of the ProjectMember entity.

Delete()

Delete the row.

Declaration
public override void Delete()
Overrides
EntityBase.Delete()

ForceEntityUpdate()

Force Updated and UpdatedAssociate to be updated with current time and Currently logged in associate. This will again be overridden in the Database update operation by a query processor.

Declaration
protected override void ForceEntityUpdate()
Overrides
EntityBase.ForceEntityUpdate()

FromProjectMemberRow(ProjectMemberRow)

Operator asigning a ProjectMember from a ProjectMemberRow.

Declaration
public static ProjectMember FromProjectMemberRow(ProjectMemberRow row)
Parameters
Type Name Description
ProjectMemberRow row

ProjectMemberRow object

Returns
Type Description
ProjectMember

ProjectMember Entity

FromProjectMemberRow(ProjectMemberRow, ProjectMember.ProjectMemberIdxBase)

Declaration
public static ProjectMember FromProjectMemberRow(ProjectMemberRow row, ProjectMember.ProjectMemberIdxBase idx)
Parameters
Type Name Description
ProjectMemberRow row
ProjectMember.ProjectMemberIdxBase idx
Returns
Type Description
ProjectMember

GetFromCustomSearch(ProjectMember.CustomSearch)

Create a new instance of the ProjectMember object, and populate it with data from a custom search. If the search returns no results, an empty entity will be returned; if the result contains rows, one ProjectMember object representing the first row will be returned. Any further rows in the result will be ignored.

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

The custom search to execute against the database

Returns
Type Description
ProjectMember

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

GetFromIdxProjectmemberId(Int32)

Create a new instance of the ProjectMember object, by querying the database table via the index 'IDXPmembId'. This method is intended to make it easy to use efficient queries that match a database index.

Declaration
public static ProjectMember GetFromIdxProjectmemberId(int projectmemberId)
Parameters
Type Name Description
Int32 projectmemberId

Primary key

Returns
Type Description
ProjectMember

Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table

Remarks

This method represents one of the unique indexes on the ProjectMember table. Non-unique indexes have corresponding inner classes and methods in the ProjectMemberCollection collection, since they may return more than one row.

GetRelatedNestedPersist(List<INestedPersist>, Boolean)

Append all the related objects to a list of INestedPersist.

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

List to append related objects to.

Boolean lacyFetchIfNeeded
Overrides
EntityBase.GetRelatedNestedPersist(List<INestedPersist>, Boolean)

OnIdUpdate()

Update related objects with correct id's to make sure that relations are consistent before saving to the database.

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

OnPostSaveMe()

Handle actions needed to be taken after this object has been saved, but before saving objects depending upon this one.

Declaration
protected virtual void OnPostSaveMe()

OnPreIdUpdate()

Allow for "fake id's" to be forced upon related objects.

Declaration
protected override void OnPreIdUpdate()
Overrides
EntityBase.OnPreIdUpdate()
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.

OnPreSaveMe()

Handle actions needed to be taken after objects this object depends on have been saved, but before this object is saved.

Declaration
protected virtual void OnPreSaveMe()

OnRowLoad(SoDataReader, TableRowBase)

Event raised when the row is loaded from the database

Declaration
protected override void OnRowLoad(SoDataReader reader, TableRowBase row)
Parameters
Type Name Description
SoDataReader reader
TableRowBase row
Overrides
EntityBase.OnRowLoad(SoDataReader, TableRowBase)

OnRowLoaded()

Declaration
protected override void OnRowLoaded()
Overrides
EntityBase.OnRowLoaded()

SetDefaults()

Set default values for the entity.

Declaration
public void SetDefaults()

SetDefaults(DefaulterStrategy)

Set default values for the entity.

Declaration
public void SetDefaults(DefaulterStrategy strategy)
Parameters
Type Name Description
DefaulterStrategy strategy

Strategy used when appliying default values.

Validate()

Check the entity and related objects for consistency and required fields, and return fields and error messages.

Declaration
public override Dictionary<string, string> Validate()
Returns
Type Description
Dictionary<String, String>

Field names and error messages

Overrides
EntityBase.Validate()

Operators

Explicit(ProjectMemberRow to ProjectMember)

Operator assigning a ProjectMember from a ProjectMemberRow.

Declaration
public static explicit operator ProjectMember(ProjectMemberRow row)
Parameters
Type Name Description
ProjectMemberRow row

ProjectMemberRow object

Returns
Type Description
ProjectMember

ProjectMember Entity

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