Class Sale
Sales
For every Sale record edited through the SuperOffice GUI, a copy of the previous version of the record will be saved in the SaleHist table. This also applies to editing done through the SaleModel COM interface, but not to editing done through the OLE DB Provider or other channels.
Entity Object for table 'sale'. Entity objects represent full entities with both the base table object and all related objects, such as udef, publish, visiblefor, and things like owner associate and whatever else is logically related to the base object.Inherited Members
Namespace: SuperOfficeCRMEntities
Assembly: SoDataBase.dll
Syntax
public class Sale : EntityBase, INestedPersist, 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 SuperOffice.CRM.Data.Sale.Save 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) Sale Sale.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 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 SuperOffice.CRM.Data.Sale.IsNew and SuperOffice.CRM.Data.Sale.IsDirty 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 Sale are:
| Index fields | Nested index class name |
|---|---|
| SaleId | SaleId: Primary key Nested index class: Sale.IdxSaleIdStatic Get method: GetFromIdxSaleIdAsync(int, CancellationToken) |
| Index fields | Nested index class name |
|---|---|
| Status | Status: Status (open, closed, lost) Nested index class: SaleCollection.IdxStatusStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxStatus |
| Done | Done: Done (0 = don’t know; 1 = No; 2 = yes) Nested index class: SaleCollection.IdxDoneStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxDone |
| UserdefId | UserdefId: User-defined fields reference Nested index class: SaleCollection.IdxUserdefIdStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxUserdefId |
| Userdef2Id | Userdef2Id: User-defined fields reference Nested index class: SaleCollection.IdxUserdef2IdStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxUserdef2Id |
| ProjectId | ProjectId: Optional project reference Nested index class: SaleCollection.IdxProjectIdStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxProjectId |
| Source | Source: For future integration use; source of record Nested index class: SaleCollection.IdxSourceStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxSource |
| Heading | Heading: Sale heading (short description) Nested index class: SaleCollection.IdxHeadingStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxHeading |
| ProjectId, AssociateId, Saledate | ProjectId: Optional project reference AssociateId:Owning associate Saledate:(expected | lost | won) sales date Nested index class: SaleCollection.IdxProjectIdAssociateIdSaledateStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxProjectIdAssociateIdSaledate |
| PersonId | PersonId: Optional person reference Nested index class: SaleCollection.IdxPersonIdStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxPersonId |
| AssociateId, Done, Saledate | AssociateId: Owning associate Done:Done (0 = don’t know; 1 = No; 2 = yes) Saledate:(expected | lost | won) sales date Nested index class: SaleCollection.IdxAssociateIdDoneSaledateStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxAssociateIdDoneSaledate |
| ContactId | ContactId: Optional contact reference Nested index class: SaleCollection.IdxContactIdStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxContactId |
| Saledate | Saledate: (expected | lost | won) sales date Nested index class: SaleCollection.IdxSaledateStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxSaledate |
| Number1 | Number1: Alphanumeric user field Nested index class: SaleCollection.IdxNumber1Static Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxNumber1 |
| AssociateId, ContactId, Saledate | AssociateId: Owning associate ContactId:Optional contact reference Saledate:(expected | lost | won) sales date Nested index class: SaleCollection.IdxAssociateIdContactIdSaledateStatic Get method: SuperOffice.CRM.Entities.SaleCollection.GetFromIdxAssociateIdContactIdSaledate |
Constructors
Sale(SaleIdxBase)
Constructor for class Sale.
This object represents a row in table 'sale'.
Table contact: Sales
Declaration
protected Sale(Sale.SaleIdxBase idx)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleSaleIdxBase | idx | ContactRowSaleRow.SaleRowIdx object that the Contact encapsulates. |
Sale(SaleRow, SaleIdxBase)
Declaration
protected Sale(SaleRow row, Sale.SaleIdxBase idx)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleRow | row | |
| SaleSaleIdxBase | idx |
Fields
_associate
Related HDB object(s).
Declaration
protected AssociateRow _associate
Field Value
| Type | Description |
|---|---|
| AssociateRow |
_competitor
Related HDB object(s).
Declaration
protected ComptrRow _competitor
Field Value
| Type | Description |
|---|---|
| ComptrRow |
_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 |
_credited
Related HDB object(s).
Declaration
protected CreditedRow _credited
Field Value
| Type | Description |
|---|---|
| CreditedRow |
_currency
Related HDB object(s).
Declaration
protected CurrencyRow _currency
Field Value
| Type | Description |
|---|---|
| CurrencyRow |
_person
Related HDB object(s).
Declaration
protected Person _person
Field Value
| Type | Description |
|---|---|
| Person |
_postit
Related HDB object(s).
Declaration
protected TextRow _postit
Field Value
| Type | Description |
|---|---|
| TextRow |
_probabilityRow
Related HDB object(s).
Declaration
protected ProbRow _probabilityRow
Field Value
| Type | Description |
|---|---|
| ProbRow |
_project
Related HDB object(s).
Declaration
protected Project _project
Field Value
| Type | Description |
|---|---|
| Project |
_quote
Declaration
protected QuoteRow _quote
Field Value
| Type | Description |
|---|---|
| QuoteRow |
_reason
Related HDB object(s).
Declaration
protected ReasonRow _reason
Field Value
| Type | Description |
|---|---|
| ReasonRow |
_reasonSold
Declaration
protected ReasonSoldRow _reasonSold
Field Value
| Type | Description |
|---|---|
| ReasonSoldRow |
_reasonStalled
Declaration
protected ReasonStalledRow _reasonStalled
Field Value
| Type | Description |
|---|---|
| ReasonStalledRow |
_row
HDB object this entity is a facade for.
Declaration
protected SaleRow _row
Field Value
| Type | Description |
|---|---|
| SaleRow |
_rowIdx
Declaration
protected Sale.SaleIdxBase _rowIdx
Field Value
| Type | Description |
|---|---|
| SaleSaleIdxBase |
_saleHistory
Related HDB object(s).
Declaration
protected SaleHistRows _saleHistory
Field Value
| Type | Description |
|---|---|
| SaleHistRows |
_saleText
Related HDB object(s).
Declaration
protected TextRow _saleText
Field Value
| Type | Description |
|---|---|
| TextRow |
_saleType
Related HDB object(s).
Declaration
protected SaleTypeRow _saleType
Field Value
| Type | Description |
|---|---|
| SaleTypeRow |
_sourceRow
Related HDB object(s).
Declaration
protected SourceRow _sourceRow
Field Value
| Type | Description |
|---|---|
| SourceRow |
_stakeholders
Declaration
protected SaleStakeholderRows _stakeholders
Field Value
| Type | Description |
|---|---|
| SaleStakeholderRows |
_udefLarge
Related HDB object(s).
Declaration
protected UDSaleLargeRow _udefLarge
Field Value
| Type | Description |
|---|---|
| UDSaleLargeRow |
_udefSmall
Related HDB object(s).
Declaration
protected UDSaleSmallRow _udefSmall
Field Value
| Type | Description |
|---|---|
| UDSaleSmallRow |
_updatedAssociate
Related HDB object(s).
Declaration
protected AssociateRow _updatedAssociate
Field Value
| Type | Description |
|---|---|
| AssociateRow |
_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 |
|---|---|
| uint |
Amount
Total sale amount
Declaration
public double Amount { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Associate
Related object AssociateRow: Employees, resources and other users - except for External persons
Declaration
public AssociateRow Associate { get; set; }
Property Value
| Type | Description |
|---|---|
| AssociateRow |
Competitor
Related object ComptrRow: Comptr list table
Declaration
public ComptrRow Competitor { get; set; }
Property Value
| Type | Description |
|---|---|
| ComptrRow |
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 |
Credited
Related object CreditedRow: Credited list table
Declaration
public CreditedRow Credited { get; set; }
Property Value
| Type | Description |
|---|---|
| CreditedRow |
Currency
Related object CurrencyRow: Currency list table
Declaration
public CurrencyRow Currency { get; set; }
Property Value
| Type | Description |
|---|---|
| CurrencyRow |
CustomFields
Declaration
public EntityCustomFieldsHelper CustomFields { get; }
Property Value
| Type | Description |
|---|---|
| EntityCustomFieldsHelper |
Done
Done (0=don't know, 1 = No, 2=Yes)
Declaration
public SaleDone Done { get; set; }
Property Value
| Type | Description |
|---|---|
| SaleDone |
Earning
Earning on sale
Declaration
public double Earning { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
EarningPercent
Earning as percent of total
Declaration
public double EarningPercent { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
ExtraFields
Declaration
public EntityExtraFieldsHelper ExtraFields { get; }
Property Value
| Type | Description |
|---|---|
| EntityExtraFieldsHelper |
Heading
Sale heading (short description?)
Declaration
public string Heading { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
IsDeleted
Is the row deleted?
Declaration
public override bool IsDeleted { get; }
Property Value
| Type | Description |
|---|---|
| bool |
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 |
|---|---|
| bool |
|
Overrides
IsNew
Is the row new, e.g. not been inserted to the database?
Declaration
public override bool IsNew { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
MainRow
Return the main row for the Entity.
Declaration
protected override TableRowBase MainRow { get; }
Property Value
| Type | Description |
|---|---|
| TableRowBase |
Overrides
NextDueDate
Declaration
public DateTime NextDueDate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Number1
Alphanumeric user field
Declaration
public string Number1 { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Person
Related object Person: Persons in a company or an organisation
Declaration
public Person Person { get; set; }
Property Value
| Type | Description |
|---|---|
| Person |
Postit
Related object TextRow: Long text fields from all over the system
Declaration
public TextRow Postit { get; set; }
Property Value
| Type | Description |
|---|---|
| TextRow |
Probability
Actual probability, may differ from the one in the list
Declaration
public short Probability { get; set; }
Property Value
| Type | Description |
|---|---|
| short |
ProbabilityRow
Related object ProbRow: Prob list table
Declaration
public ProbRow ProbabilityRow { get; set; }
Property Value
| Type | Description |
|---|---|
| ProbRow |
Project
Related object Project: Projects
Declaration
public Project Project { get; set; }
Property Value
| Type | Description |
|---|---|
| Project |
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 |
Quote
Related object Quote: Quote fields
Declaration
public QuoteRow Quote { get; set; }
Property Value
| Type | Description |
|---|---|
| QuoteRow |
Reason
Related object ReasonRow: Reason list table
Declaration
public ReasonRow Reason { get; set; }
Property Value
| Type | Description |
|---|---|
| ReasonRow |
ReasonSold
Declaration
public ReasonSoldRow ReasonSold { get; set; }
Property Value
| Type | Description |
|---|---|
| ReasonSoldRow |
ReasonStalled
Declaration
public ReasonStalledRow ReasonStalled { get; set; }
Property Value
| Type | Description |
|---|---|
| ReasonStalledRow |
Registered
Registered date
Declaration
public DateTime Registered { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Row
The encapsulated object SaleRow.
Declaration
public SaleRow Row { get; }
Property Value
| Type | Description |
|---|---|
| SaleRow |
SaleId
Primary key
Declaration
public int SaleId { get; }
Property Value
| Type | Description |
|---|---|
| int |
SaleText
Related object TextRow: Long text fields from all over the system
Declaration
public TextRow SaleText { get; set; }
Property Value
| Type | Description |
|---|---|
| TextRow |
SaleType
Related object ProjTypeRow: ProjType list table
Declaration
public SaleTypeRow SaleType { get; set; }
Property Value
| Type | Description |
|---|---|
| SaleTypeRow |
Saledate
(expected | lost | won) sales date
Declaration
public DateTime Saledate { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
Source
"For future integration use; source of record"
Declaration
public short Source { get; set; }
Property Value
| Type | Description |
|---|---|
| short |
SourceRow
Related object SourceRow: Source list table
Declaration
public SourceRow SourceRow { get; set; }
Property Value
| Type | Description |
|---|---|
| SourceRow |
Status
Status (open, closed, lost)
Declaration
public SaleStatus Status { get; set; }
Property Value
| Type | Description |
|---|---|
| SaleStatus |
TableInfo
Get a TableInfo object for the sale table.
Declaration
public SaleTableInfo TableInfo { get; }
Property Value
| Type | Description |
|---|---|
| SaleTableInfo |
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 UDSaleLargeRow: User-defined fields
Declaration
public UDSaleLargeRow UdefLarge { get; set; }
Property Value
| Type | Description |
|---|---|
| UDSaleLargeRow |
UdefSmall
Related object UDSaleSmallRow: User-defined fields
Declaration
public UDSaleSmallRow UdefSmall { get; set; }
Property Value
| Type | Description |
|---|---|
| UDSaleSmallRow |
Updated
Last updated
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 |
|---|---|
| short |
UserGroup
Related object UserGroupRow: Secondary user groups
Declaration
public UserGroupRow UserGroup { get; set; }
Property Value
| Type | Description |
|---|---|
| UserGroupRow |
Visibility
OBSOLETE - the VisibleFor table is used instead
Declaration
public short Visibility { get; set; }
Property Value
| Type | Description |
|---|---|
| short |
VisibleForHelper
Get the helper class for working with the visible-for of the entity.
Declaration
public EntityVisibleForHelper VisibleForHelper { get; }
Property Value
| Type | Description |
|---|---|
| EntityVisibleForHelper |
Methods
CreateNew()
Create a new instance of the Sale entity.
Declaration
public static Sale CreateNew()
Returns
| Type | Description |
|---|---|
| Sale | A new instance of the Sale entity. |
CreateNew(SaleIdxBase)
Create a new instance of the Sale entity, by reading from the database using the specified index (represented by a nested index class).
Declaration
public static Sale CreateNew(Sale.SaleIdxBase idx)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleSaleIdxBase | idx | Index search, represented by a subclass if the Sale.SaleIdxBase nested index class |
Returns
| Type | Description |
|---|---|
| Sale | A new instance of the Sale entity. |
DeleteAsync()
Delete the row.
Declaration
public override Task DeleteAsync()
Returns
| Type | Description |
|---|---|
| Task |
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
FromSaleRow(SaleRow)
Operator asigning a Sale from a SaleRow.
Declaration
public static Sale FromSaleRow(SaleRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleRow | row | SaleRow object |
Returns
| Type | Description |
|---|---|
| Sale | Sale Entity |
FromSaleRow(SaleRow, SaleIdxBase)
Declaration
public static Sale FromSaleRow(SaleRow row, Sale.SaleIdxBase idx)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleRow | row | |
| SaleSaleIdxBase | idx |
Returns
| Type | Description |
|---|---|
| Sale |
GetAdditionalRelatedNestedPersistAsync(List<INestedPersist>, bool, CancellationToken)
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 Task GetAdditionalRelatedNestedPersistAsync(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ListINestedPersist | relatedObjects | |
| bool | lacyFetchIfNeeded | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
GetFromCustomSearchAsync(CustomSearch, CancellationToken)
Create a new instance of the Sale 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 Sale object representing the first row will be returned. Any further rows in the result will be ignored.
Declaration
public static Task<Sale> GetFromCustomSearchAsync(Sale.CustomSearch query, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleCustomSearch | query | The custom search to execute against the database |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskSale | A new instance of the Sale object, reflecting the result of the query. |
GetFromIdxSaleIdAsync(int, CancellationToken)
Create a new instance of the Sale object, by querying the database table via the index 'IDXSaleId'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static Task<Sale> GetFromIdxSaleIdAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | saleId | Primary key |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskSale | 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 Sale table. Non-unique indexes have corresponding inner classes and methods in the SaleCollection collection, since they may return more than one row.
GetLinksHelperAsync(CancellationToken)
Links helper The helper manages the links belonging to the sale. Helper updates the sale's ActiveLinks property
Declaration
public Task<ActivityLinksHelper> GetLinksHelperAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskActivityLinksHelper |
GetRelatedNestedPersistAsync(List<INestedPersist>, bool, CancellationToken)
Append all the related objects to a list of INestedPersist.
Declaration
protected override Task GetRelatedNestedPersistAsync(List<INestedPersist> relatedObjects, bool lacyFetchIfNeeded, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ListINestedPersist | relatedObjects | List to append related objects to. |
| bool | lacyFetchIfNeeded | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
GetSaleHistoryAsync(CancellationToken)
Related object SaleHistRows: Mirror image of the Sale table, providing a full transaction history
Declaration
public Task<SaleHistRows> GetSaleHistoryAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskSaleHistRows |
GetStakeholdersAsync(CancellationToken)
Related object Stakeholders: all the "project members" involved in the sale.
Declaration
public Task<SaleStakeholderRows> GetStakeholdersAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskSaleStakeholderRows |
IsNumberValidAsync(CancellationToken)
Validate number field - is it unique/blank according to numbering rules?
Declaration
public Task<bool> IsNumberValidAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool | true if Number is ok |
OnIdUpdateAsync()
Update related objects with correct id's to make sure that relations are consistent before saving to the database.
Declaration
protected override Task OnIdUpdateAsync()
Returns
| Type | Description |
|---|---|
| Task |
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()
OnPreIdUpdateAsync()
Allow for "fake id's" to be forced upon related objects.
Declaration
protected override Task OnPreIdUpdateAsync()
Returns
| Type | Description |
|---|---|
| Task |
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.
OnPreIdUpdateImplementationAsync()
Declaration
protected override Task OnPreIdUpdateImplementationAsync()
Returns
| Type | Description |
|---|---|
| Task |
Overrides
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
OnSaveAsync(BatchSave)
Declaration
protected override Task OnSaveAsync(BatchSave batchSave)
Parameters
| Type | Name | Description |
|---|---|---|
| BatchSave | batchSave |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
SetDefaultsAsync(DefaulterStrategy, CancellationToken)
Set default values for the entity.
Declaration
public Task SetDefaultsAsync(DefaulterStrategy strategy, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaulterStrategy | strategy | Strategy used when appliying default values. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetDefaultsAsync(CancellationToken)
Set default values for the entity.
Declaration
public Task SetDefaultsAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ValidateAsync(CancellationToken)
Check the entity and related objects for consistency and required fields, and return fields and error messages.
Declaration
public override Task<Dictionary<string, string>> ValidateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| TaskDictionarystringstring | Field names and error messages |
Overrides
Operators
explicit operator Sale(SaleRow)
Operator assigning a Sale from a SaleRow.
Declaration
public static explicit operator Sale(SaleRow row)
Parameters
| Type | Name | Description |
|---|---|---|
| SaleRow | row | SaleRow object |
Returns
| Type | Description |
|---|---|
| Sale | Sale Entity |