Class Project
Projects
Entity Object for table 'project'. Entity objects represent full entities with both the base table object and all related objects, such as udef, publish, and things like owner associate and whatever else is logically related to the base object.Inherited Members
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public class Project : EntityBase, INestedPersist, ISoItem, ITableRowLoadHandler, IEntityUdefHelperContainer
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) Project Project.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(Project.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.
Unique indexes on Project are:
Index fields | Nested index class name |
---|---|
ProjectId | ProjectId: Primary key Nested index class: Project.IdxProjectIdStatic Get method: GetFromIdxProjectId(Int32) |
Index fields | Nested index class name |
---|---|
SoundEx | SoundEx: What the name sounds like, for duplicate detection Nested index class: ProjectCollection.IdxSoundExStatic Get method: GetFromIdxSoundEx(String) |
Source | Source: How did we get this project? For future integration needs Nested index class: ProjectCollection.IdxSourceStatic Get method: GetFromIdxSource(Int16) |
ProjectNumber | ProjectNumber: Automatically generated number Nested index class: ProjectCollection.IdxProjectNumberStatic Get method: GetFromIdxProjectNumber(String) |
Userdef2Id | Userdef2Id: User-defined table record 2 Nested index class: ProjectCollection.IdxUserdef2IdStatic Get method: GetFromIdxUserdef2Id(Int32) |
Name | Name: Project name Nested index class: ProjectCollection.IdxNameStatic Get method: GetFromIdxName(String) |
Constructors
Project(Project.ProjectIdxBase)
Constructor for class Project.
This object represents a row in table 'project'.
Table contact: Projects
Declaration
protected Project(Project.ProjectIdxBase idx)
Parameters
Type | Name | Description |
---|---|---|
Project.ProjectIdxBase | idx | ContactRowProjectRow.ProjectRowIdx object that the Contact encapsulates. |
Project(ProjectRow, Project.ProjectIdxBase)
Declaration
protected Project(ProjectRow row, Project.ProjectIdxBase idx)
Parameters
Type | Name | Description |
---|---|---|
ProjectRow | row | |
Project.ProjectIdxBase | idx |
Fields
_appointments
Related HDB object(s).
Declaration
protected AppointmentCollection _appointments
Field Value
Type | Description |
---|---|
AppointmentCollection |
_associate
Related HDB object(s).
Declaration
protected AssociateRow _associate
Field Value
Type | Description |
---|---|
AssociateRow |
_createdAssociate
Related HDB object(s).
Declaration
protected AssociateRow _createdAssociate
Field Value
Type | Description |
---|---|
AssociateRow |
_emails
Related HDB object(s).
Declaration
protected EmailRows _emails
Field Value
Type | Description |
---|---|
EmailRows |
_info
Related HDB object(s).
Declaration
protected TextRow _info
Field Value
Type | Description |
---|---|
TextRow |
_members
Related HDB object(s).
Declaration
protected ProjectMemberCollection _members
Field Value
Type | Description |
---|---|
ProjectMemberCollection |
_projectStatus
Related HDB object(s).
Declaration
protected ProjStatusRow _projectStatus
Field Value
Type | Description |
---|---|
ProjStatusRow |
_projectText
Related HDB object(s).
Declaration
protected TextRow _projectText
Field Value
Type | Description |
---|---|
TextRow |
_projectType
Related HDB object(s).
Declaration
protected ProjTypeRow _projectType
Field Value
Type | Description |
---|---|
ProjTypeRow |
_row
HDB object this entity is a facade for.
Declaration
protected ProjectRow _row
Field Value
Type | Description |
---|---|
ProjectRow |
_rowIdx
Declaration
protected Project.ProjectIdxBase _rowIdx
Field Value
Type | Description |
---|---|
Project.ProjectIdxBase |
_saintCounterValue
Related HDB object(s).
Declaration
protected CounterValueRows _saintCounterValue
Field Value
Type | Description |
---|---|
CounterValueRows |
_saintStatusValue
Related HDB object(s).
Declaration
protected StatusValueRows _saintStatusValue
Field Value
Type | Description |
---|---|
StatusValueRows |
_saleHistory
Related HDB object(s).
Declaration
protected SaleHistRows _saleHistory
Field Value
Type | Description |
---|---|
SaleHistRows |
_sales
Related HDB object(s).
Declaration
protected SaleCollection _sales
Field Value
Type | Description |
---|---|
SaleCollection |
_udefLarge
Related HDB object(s).
Declaration
protected UDProjectLargeRow _udefLarge
Field Value
Type | Description |
---|---|
UDProjectLargeRow |
_udefSmall
Related HDB object(s).
Declaration
protected UDProjectSmallRow _udefSmall
Field Value
Type | Description |
---|---|
UDProjectSmallRow |
_updatedAssociate
Related HDB object(s).
Declaration
protected AssociateRow _updatedAssociate
Field Value
Type | Description |
---|---|
AssociateRow |
_urls
Related HDB object(s).
Declaration
protected URLRows _urls
Field Value
Type | Description |
---|---|
URLRows |
_userGroup
Related HDB object(s).
Declaration
protected UserGroupRow _userGroup
Field Value
Type | Description |
---|---|
UserGroupRow |
Properties
ActiveLinks
Number of active links to documents and such
Declaration
public uint ActiveLinks { get; set; }
Property Value
Type | Description |
---|---|
UInt32 |
Appointments
Related object AppointmentCollection: "Tasks, appointments, followups, phone calls; and documents"
Declaration
public AppointmentCollection Appointments { get; }
Property Value
Type | Description |
---|---|
AppointmentCollection |
Associate
Related object AssociateRow: Employees, resources and other users - except for External persons
Declaration
public AssociateRow Associate { get; set; }
Property Value
Type | Description |
---|---|
AssociateRow |
CreatedAssociate
Related object AssociateRow: Employees, resources and other users - except for External persons
Declaration
public AssociateRow CreatedAssociate { get; set; }
Property Value
Type | Description |
---|---|
AssociateRow |
CustomFields
Declaration
public EntityCustomFieldsHelper CustomFields { get; }
Property Value
Type | Description |
---|---|
EntityCustomFieldsHelper |
Done
Declaration
public short Done { get; set; }
Property Value
Type | Description |
---|---|
Int16 |
Emails
Related object EmailRows: Email addresses
Declaration
public EmailRows Emails { get; }
Property Value
Type | Description |
---|---|
EmailRows |
ExtraFields
Declaration
public EntityExtraFieldsHelper ExtraFields { get; }
Property Value
Type | Description |
---|---|
EntityExtraFieldsHelper |
Info
Related object TextRow: Long text fields from all over the system
Declaration
public TextRow Info { get; set; }
Property Value
Type | Description |
---|---|
TextRow |
IsDeleted
Is the row deleted?
Declaration
public override bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
Boolean |
Overrides
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 |
|
Overrides
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
LinksHelper
Links helper The helper manages the links belonging to the project Helper updates the project's ActiveLinks property
Declaration
public ActivityLinksHelper LinksHelper { get; }
Property Value
Type | Description |
---|---|
ActivityLinksHelper |
MainRow
Return the main row for the Entity.
Declaration
protected override TableRowBase MainRow { get; }
Property Value
Type | Description |
---|---|
TableRowBase |
Overrides
Members
Related object ProjectMemberCollection: Project members
Declaration
public ProjectMemberCollection Members { get; }
Property Value
Type | Description |
---|---|
ProjectMemberCollection |
Name
Project name
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
ProjectId
Primary key
Declaration
public int ProjectId { get; }
Property Value
Type | Description |
---|---|
Int32 |
ProjectNumber
Automatically generated number
Declaration
public string ProjectNumber { get; set; }
Property Value
Type | Description |
---|---|
String |
ProjectStatus
Related object ProjStatusRow: ProjStatus list table
Declaration
public ProjStatusRow ProjectStatus { get; set; }
Property Value
Type | Description |
---|---|
ProjStatusRow |
ProjectText
Related object TextRow: Long text fields from all over the system
Declaration
public TextRow ProjectText { get; set; }
Property Value
Type | Description |
---|---|
TextRow |
ProjectType
Related object ProjTypeRow: ProjType list table
Declaration
public ProjTypeRow ProjectType { get; set; }
Property Value
Type | Description |
---|---|
ProjTypeRow |
PublishHelper
Get the helper class for working with the publish-state of the entity.
Published means that it is available for external persons in applications
like SuperOffice Audience.
Declaration
public EntityPublishHelper PublishHelper { get; }
Property Value
Type | Description |
---|---|
EntityPublishHelper |
Registered
Registered date
Declaration
public DateTime Registered { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Row
The encapsulated object ProjectRow.
Declaration
public ProjectRow Row { get; }
Property Value
Type | Description |
---|---|
ProjectRow |
SaintCounterValue
Related object CounterValueRows: Visible for rights
Declaration
public CounterValueRows SaintCounterValue { get; }
Property Value
Type | Description |
---|---|
CounterValueRows |
SaintStatusValue
Related object StatusValueRows: Values for statuses
Declaration
public StatusValueRows SaintStatusValue { get; }
Property Value
Type | Description |
---|---|
StatusValueRows |
SaleHistory
Related object SaleHistRows: Mirror image of the Sale table, providing a full transaction history
Declaration
public SaleHistRows SaleHistory { get; }
Property Value
Type | Description |
---|---|
SaleHistRows |
Sales
Related object SaleCollection: Sales
Declaration
public SaleCollection Sales { get; }
Property Value
Type | Description |
---|---|
SaleCollection |
SoundEx
What the name sounds like, for duplicate detection
Declaration
public string SoundEx { get; set; }
Property Value
Type | Description |
---|---|
String |
Source
How did we get this project? For future integration needs
Declaration
public short Source { get; set; }
Property Value
Type | Description |
---|---|
Int16 |
TableInfo
Get a TableInfo object for the project table.
Declaration
public ProjectTableInfo TableInfo { get; }
Property Value
Type | Description |
---|---|
ProjectTableInfo |
Tooltip
Get tooltip for the project.
Declaration
public string Tooltip { get; }
Property Value
Type | Description |
---|---|
String |
UdefHelper
Get the Udef class of EntityUdefHelper for working with udef fields
Declaration
public EntityUdefHelper UdefHelper { get; }
Property Value
Type | Description |
---|---|
EntityUdefHelper |
UdefLarge
Related object UDProjectLargeRow: User-defined fields
Declaration
public UDProjectLargeRow UdefLarge { get; set; }
Property Value
Type | Description |
---|---|
UDProjectLargeRow |
UdefSmall
Related object UDProjectSmallRow: User-defined fields
Declaration
public UDProjectSmallRow UdefSmall { get; set; }
Property Value
Type | Description |
---|---|
UDProjectSmallRow |
Updated
Last updated date
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 |
Urls
Related object URLRows: Unified Resource Locators
Declaration
public URLRows Urls { get; }
Property Value
Type | Description |
---|---|
URLRows |
UserGroup
Related object UserGroupRow: Secondary user groups
Declaration
public UserGroupRow UserGroup { get; set; }
Property Value
Type | Description |
---|---|
UserGroupRow |
Methods
CreateNew()
Create a new instance of the Project entity.
Declaration
public static Project CreateNew()
Returns
Type | Description |
---|---|
Project | A new instance of the Project entity. |
CreateNew(Project.ProjectIdxBase)
Create a new instance of the Project entity, by reading from the database using the specified index (represented by a nested index class).
Declaration
public static Project CreateNew(Project.ProjectIdxBase idx)
Parameters
Type | Name | Description |
---|---|---|
Project.ProjectIdxBase | idx | Index search, represented by a subclass if the Project.ProjectIdxBase nested index class |
Returns
Type | Description |
---|---|
Project | A new instance of the Project entity. |
Delete()
Delete the row.
Declaration
public override void Delete()
Overrides
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
FromProjectRow(ProjectRow)
Operator asigning a Project from a ProjectRow.
Declaration
public static Project FromProjectRow(ProjectRow row)
Parameters
Type | Name | Description |
---|---|---|
ProjectRow | row | ProjectRow object |
Returns
Type | Description |
---|---|
Project | Project Entity |
FromProjectRow(ProjectRow, Project.ProjectIdxBase)
Declaration
public static Project FromProjectRow(ProjectRow row, Project.ProjectIdxBase idx)
Parameters
Type | Name | Description |
---|---|---|
ProjectRow | row | |
Project.ProjectIdxBase | idx |
Returns
Type | Description |
---|---|
Project |
GetAdditionalRelatedNestedPersist(List<INestedPersist>, Boolean)
Add the Links Helper to the list of related nestedpersist objects, to ensure it gets a chance to do its save operations
Declaration
protected override void GetAdditionalRelatedNestedPersist(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded)
Parameters
Type | Name | Description |
---|---|---|
List<INestedPersist> | relatedObjects | |
Boolean | lacyFetchIfNeeded |
Overrides
GetFromCustomSearch(Project.CustomSearch)
Create a new instance of the Project 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 Project object representing the first row will be returned. Any further rows in the result will be ignored.
Declaration
public static Project GetFromCustomSearch(Project.CustomSearch query)
Parameters
Type | Name | Description |
---|---|---|
Project.CustomSearch | query | The custom search to execute against the database |
Returns
Type | Description |
---|---|
Project | A new instance of the Project object, reflecting the result of the query. |
GetFromIdxProjectId(Int32)
Create a new instance of the Project object, by querying the database table via the index 'IDXProjId'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static Project GetFromIdxProjectId(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | Primary key |
Returns
Type | Description |
---|---|
Project | 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 Project table. Non-unique indexes have corresponding inner classes and methods in the ProjectCollection 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
IsNumberValid()
Validate ProjectNumber field - is it unique/blank according to numbering rules?
Declaration
public bool IsNumberValid()
Returns
Type | Description |
---|---|
Boolean | true if ProjectNumber is ok |
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
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
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
OnRowLoaded()
Declaration
protected override void OnRowLoaded()
Overrides
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
Operators
Explicit(ProjectRow to Project)
Operator assigning a Project from a ProjectRow.
Declaration
public static explicit operator Project(ProjectRow row)
Parameters
Type | Name | Description |
---|---|---|
ProjectRow | row | ProjectRow object |
Returns
Type | Description |
---|---|
Project | Project Entity |
Explicit Interface Implementations
IEntityUdefHelperContainer.UDefLarge
Declaration
TableRowBase IEntityUdefHelperContainer.UDefLarge { get; }
Returns
Type | Description |
---|---|
TableRowBase |
IEntityUdefHelperContainer.UDefSmall
Declaration
TableRowBase IEntityUdefHelperContainer.UDefSmall { get; }
Returns
Type | Description |
---|---|
TableRowBase |