Class QuoteData
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Assembly: SoDataBase.BusinessLogic.dll
Syntax
public class QuoteData : NestedPersist, INestedPersist, IQuoteData
Properties
Get information for the Contact the sale is connected to. The Contact Info will be created when first asked for.
Declaration
public IContactInfo ContactInfo { get; }
Property Value
IsDeleted
Returns true if the QuoteRow is deleted.
Declaration
public override bool IsDeleted { get; }
Property Value
Overrides
IsDirty
Returns true if the QuoteRow or any versionrows or alternativerows isDirty.
Declaration
public override bool IsDirty { get; }
Property Value
Overrides
PersonInfo
Get information for the Contact the sale is connected to. The Contact Info will be created when first asked for.
Declaration
public IPersonInfo PersonInfo { get; }
Property Value
ProjectInfo
Get project information for this quote. If a project is not assigned to this sale, null will be returned.
Declaration
public IProjectInfo ProjectInfo { get; }
Property Value
QuoteRow
Declaration
public QuoteRow QuoteRow { get; set; }
Property Value
SaleInfo
Get Sale information for this quote. The Sale Info will be created when first asked for.
Declaration
public ISaleInfo SaleInfo { get; }
Property Value
SaleRow
The main Sale row the quote is connected to.
Declaration
public SaleRow SaleRow { get; }
Property Value
UserInfo
Declaration
public UserInfo UserInfo { get; }
Property Value
Type |
Description |
UserInfo |
username, fullname, associate id, e-mail address in one package
|
Methods
AddQuoteAlternativeAsync(QuoteVersionRow, QuoteAlternativeRow, CancellationToken)
Adds an existing QuoteAlternativeRow to the dictionary.
Declaration
public Task<QuoteAlternativeRow> AddQuoteAlternativeAsync(QuoteVersionRow quoteVersionRow, QuoteAlternativeRow quoteAlternativeRow, CancellationToken cancellationToken = default)
Parameters
Returns
AddQuoteAlternativeAsync(QuoteVersionRow, CancellationToken)
Creates a new QuoteAlternativeRow and adds it to the dictionary where quoteVersionRow is the key.
Declaration
public Task<QuoteAlternativeRow> AddQuoteAlternativeAsync(QuoteVersionRow quoteVersionRow, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
quoteVersionRow |
quoteVersionRow is the key in the dictionary. The alternative row will be added in the list for the key quoteVersionRow.
|
CancellationToken |
cancellationToken |
|
Returns
AddQuoteVersionAsync(QuoteVersionRow, CancellationToken)
Adds an existing QuoteVersionRow to the QuoteVersions dictionary.
Declaration
public Task<QuoteVersionRow> AddQuoteVersionAsync(QuoteVersionRow quoteVersionRow, CancellationToken cancellationToken = default)
Parameters
Returns
AddQuoteVersionAsync(CancellationToken)
Create a QuoteVersionRow and adds it to the QuoteVersions dictionary.
Declaration
public Task<QuoteVersionRow> AddQuoteVersionAsync(CancellationToken cancellationToken = default)
Parameters
Returns
ApplyErpChangesToQuote(QuoteInfo)
Declaration
public bool ApplyErpChangesToQuote(QuoteInfo quoteInfo)
Parameters
Returns
ApplyErpChangesToQuote(QuoteInfo, bool)
Declaration
public bool ApplyErpChangesToQuote(QuoteInfo quoteInfo, bool ignoreSentry)
Parameters
Type |
Name |
Description |
QuoteInfo |
quoteInfo |
QuoteInfo instance to save.
|
bool |
ignoreSentry |
If true, the sentry will be disabled when saving to the database.
|
Returns
ApplyErpChangesToQuote(QuoteVersionContextInfo)
Declaration
public bool ApplyErpChangesToQuote(QuoteVersionContextInfo quoteVersionContextInfo)
Parameters
Returns
ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeContextInfo, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<bool> ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeContextInfo quoteContextInfo, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<bool> |
true if the alternative has been changed
|
ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeInfo, bool, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<bool> ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeInfo quoteAlternativeInfo, bool ignoreSentry, CancellationToken cancellationToken = default)
Parameters
Returns
ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeInfo, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<bool> ApplyErpChangesToQuoteAlternativeAsync(QuoteAlternativeInfo quoteAlternativeInfo, CancellationToken cancellationToken = default)
Parameters
Returns
ApplyErpChangesToQuoteVersionAsync(QuoteAlternativeContextInfo, CancellationToken)
Declaration
public Task<bool> ApplyErpChangesToQuoteVersionAsync(QuoteAlternativeContextInfo quoteAlternativeContextInfo, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<bool> |
true if changed
|
ApplyErpChangesToQuoteVersionAsync(QuoteVersionContextInfo, CancellationToken)
Apply changes to version.
Declaration
public Task<bool> ApplyErpChangesToQuoteVersionAsync(QuoteVersionContextInfo quoteContextInfo, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<bool> |
true of the version has been changed
|
ApplyErpChangesToQuoteVersionAsync(QuoteVersionInfo, bool, CancellationToken)
Apply changes to version.
Declaration
public Task<bool> ApplyErpChangesToQuoteVersionAsync(QuoteVersionInfo quoteVersionInfo, bool ignoreSentry, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
QuoteVersionInfo |
quoteVersionInfo |
version info
|
bool |
ignoreSentry |
If true, the sentry will be disabled when saving to the database.
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
Task<bool> |
true if changed
|
ApplyErpChangesToQuoteVersionAsync(QuoteVersionInfo, CancellationToken)
Apply changes to version.
Declaration
public Task<bool> ApplyErpChangesToQuoteVersionAsync(QuoteVersionInfo quoteVersionInfo, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<bool> |
true if changed
|
ClearQuoteLineCache()
Clear the quoteline cache
Declaration
public void ClearQuoteLineCache()
CloneQuoteAlternativesAsync(QuoteVersionRow, QuoteVersionRow, List<QuoteAlternativeRow>, CancellationToken)
Clone alternatives and its quotelines in to new version.
Declaration
public Task CloneQuoteAlternativesAsync(QuoteVersionRow existingQuoteVersionRow, QuoteVersionRow newQuoteVersionRow, List<QuoteAlternativeRow> existingQuoteAlternativeRows, CancellationToken cancellationToken = default)
Parameters
Returns
CloneQuoteAsync(IQuoteManager, CancellationToken)
Create a new quote on a sale based on a quote, active version and alternatives from another sale
Declaration
public Task CloneQuoteAsync(IQuoteManager copyFromQuoteManager, CancellationToken cancellationToken = default)
Parameters
Returns
CloneQuoteLineRowsAsync(QuoteAlternativeRow, QuoteAlternativeRow, CancellationToken)
Clone all quotelines from an alternative to another alternative.
Declaration
public Task<QuoteLineRows> CloneQuoteLineRowsAsync(QuoteAlternativeRow existingAlternativeRow, QuoteAlternativeRow newAlternativeRow, CancellationToken cancellationToken = default)
Parameters
Returns
CloneQuoteVersionAsync(QuoteVersionRow, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<QuoteVersionRow> CloneQuoteVersionAsync(QuoteVersionRow existingQuoteVersionRow, CancellationToken cancellationToken = default)
Parameters
Returns
CopyQuoteAlternativeAsync(int, int, CancellationToken)
Copy a quotealternative row
Declaration
public Task<QuoteAlternativeRow> CopyQuoteAlternativeAsync(int quoteVersionId, int copyFromQuoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
int |
quoteVersionId |
Quote version id
|
int |
copyFromQuoteAlternativeId |
|
CancellationToken |
cancellationToken |
|
Returns
CreateAsync(int, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public static Task<QuoteData> CreateAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
Returns
CreateQuoteAlternativeAsync(QuoteVersionRow, string, CancellationToken)
Creates a new QuoteAlternative for a Quote version
Declaration
public Task<QuoteAlternativeRow> CreateQuoteAlternativeAsync(QuoteVersionRow quoteVersionRow, string alternativeName, CancellationToken cancellationToken = default)
Parameters
Returns
CreateQuoteAlternativeAsync(int, string, CancellationToken)
Creates a new QuoteAlternative for a Quote version
Declaration
public Task<QuoteAlternativeRow> CreateQuoteAlternativeAsync(int quoteVersionId, string alternativeName, CancellationToken cancellationToken = default)
Parameters
Returns
CreateQuoteLine(int)
Add a new quoteline to an existing alternative
Declaration
public QuoteLineRow CreateQuoteLine(int quoteAlternativeId)
Parameters
Type |
Name |
Description |
int |
quoteAlternativeId |
Alternative to add new quote line to
|
Returns
CreateQuoteVersionAsync(string, CancellationToken)
Create a Quoteversion for the current Quote.
Declaration
public Task<QuoteVersionRow> CreateQuoteVersionAsync(string firstAlternativeName, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
string |
firstAlternativeName |
Name to be given to the default alternative
|
CancellationToken |
cancellationToken |
|
Returns
CreateQuoteVersionCopyAsync(QuoteVersionRow, List<QuoteAlternativeRow>, CancellationToken)
Create a copy of a quote version, the copy can be placed in the same quote, or a quote on another sale.
The address and details on the quote version are also copied.
The existing quote may be marked "archived".
Declaration
public Task<QuoteVersionRow> CreateQuoteVersionCopyAsync(QuoteVersionRow existingQuoteVersionRow, List<QuoteAlternativeRow> existingQuoteAlternativeRows, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
existingQuoteVersionRow |
The existing quote, which will be marked "archived" if the alternativerows == NULL.
|
List<QuoteAlternativeRow> |
existingQuoteAlternativeRows |
Alternatives to attach to the quote version. NULL = all existing alternatives on this version. NULL implies that the existing version will be marked "archived"
|
CancellationToken |
cancellationToken |
|
Returns
DeleteQuote(int)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public void DeleteQuote(int quoteId)
Parameters
Type |
Name |
Description |
int |
quoteId |
|
DeleteQuoteAlternativeAsync(int)
Mark a quotealternative row to be deleted
Declaration
public Task DeleteQuoteAlternativeAsync(int quoteAlternativeId)
Parameters
Type |
Name |
Description |
int |
quoteAlternativeId |
|
Returns
DeleteQuoteLineAsync(int, CancellationToken)
Declaration
public Task DeleteQuoteLineAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Type |
Name |
Description |
int |
quoteLineId |
Id of the quoteline to delete.
|
CancellationToken |
cancellationToken |
|
Returns
DeleteQuoteLineRowAsync(int, CancellationToken)
Delete the quoteline from the database.
Declaration
public Task DeleteQuoteLineRowAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Returns
DetectErpQuoteLineChangesAsync(List<QuoteLineInfo>, List<QuoteLineInfo>, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<QuoteAlternativeRecalculatedHelper> DetectErpQuoteLineChangesAsync(List<QuoteLineInfo> quoteLineInfosBefore, List<QuoteLineInfo> quoteLineInfosAfter, CancellationToken cancellationToken = default)
Parameters
Returns
GetActiveQuoteVersionRowAsync(CancellationToken)
Get the QuoteVersionRow marked as active.
Declaration
public Task<QuoteVersionRow> GetActiveQuoteVersionRowAsync(CancellationToken cancellationToken = default)
Parameters
Returns
GetAllRowObjectsAsync(CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public IAsyncEnumerable<TableRowBase> GetAllRowObjectsAsync(CancellationToken cancellationToken = default)
Parameters
Returns
GetAlternativeRowAsync(int, CancellationToken)
Get QuoteAlternativeRow from the dictionary based on its id.
Declaration
public Task<QuoteAlternativeRow> GetAlternativeRowAsync(int alternativeId, CancellationToken cancellationToken = default)
Parameters
Returns
GetAlternativeRowsAsync(QuoteVersionRow, CancellationToken)
Get a list of QuoteAlternativeRows belonging to a QuoteVersionRow
Declaration
public Task<List<QuoteAlternativeRow>> GetAlternativeRowsAsync(QuoteVersionRow quoteVersionRow, CancellationToken cancellationToken = default)
Parameters
Returns
GetAlternativeRowsAsync(int, CancellationToken)
Get a list of QuoteAlternativeRows belonging to a QuoteVersionRow with given id.
Declaration
public Task<List<QuoteAlternativeRow>> GetAlternativeRowsAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Returns
GetBillingAddressAsync(int, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<AddressRow> GetBillingAddressAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Returns
GetLikelyAlternativeRowAsync(QuoteVersionRow, CancellationToken)
Get the most likely quotealternative for the QuoteVersionRow
Declaration
public Task<QuoteAlternativeRow> GetLikelyAlternativeRowAsync(QuoteVersionRow quoteVersionRow, CancellationToken cancellationToken = default)
Parameters
Returns
GetQuoteLineRowAsync(int, CancellationToken)
Declaration
public Task<QuoteLineRow> GetQuoteLineRowAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
Task<QuoteLineRow> |
The quote line row. Throws exception if quote line row does not exist
|
GetQuoteLineRowsAsync(int, CancellationToken)
Get all quotelines for a specified quote alternative
Declaration
public Task<QuoteLineRows> GetQuoteLineRowsAsync(int quoteAlternativeId, CancellationToken cancellationToken = default)
Parameters
Returns
GetQuoteVersionsAsync(CancellationToken)
Get the Dictionary of QuoteVersionRows.
A QuoteVersionRow is a key in the dictionary. The value part of the dictionary is a list of QuoteAlternativeRows.
Declaration
public Task<Dictionary<QuoteVersionRow, List<QuoteAlternativeRow>>> GetQuoteVersionsAsync(CancellationToken cancellationToken = default)
Parameters
Returns
GetShippingAddressAsync(int, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<AddressRow> GetShippingAddressAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Returns
GetVersionAttachmentRowsAsync(CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task<Dictionary<QuoteVersionRow, QuoteVersionAttachmentRows>> GetVersionAttachmentRowsAsync(CancellationToken cancellationToken = default)
Parameters
Returns
GetVersionRowAsync(int, CancellationToken)
Get a QuoteVersionRow from the QuoteData collection based on quoteVersionId
Declaration
public Task<QuoteVersionRow> GetVersionRowAsync(int quoteVersionId, CancellationToken cancellationToken = default)
Parameters
Returns
InitializeAsync(int, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task InitializeAsync(int saleId, CancellationToken cancellationToken = default)
Parameters
Returns
PopulateQuoteAlternativeRow(QuoteAlternativeRow, QuoteAlternativeInfo)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public QuoteAlternativeRow PopulateQuoteAlternativeRow(QuoteAlternativeRow quoteAlternativeRow, QuoteAlternativeInfo quoteAlternative)
Parameters
Returns
PopulateQuoteLineRow(QuoteLineRow, QuoteLineInfo)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public QuoteLineRow PopulateQuoteLineRow(QuoteLineRow quoteLineRow, QuoteLineInfo quoteLine)
Parameters
Returns
PopulateQuoteRow(QuoteRow, QuoteInfo)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public QuoteRow PopulateQuoteRow(QuoteRow quoteRow, QuoteInfo quoteInfo)
Parameters
Returns
PopulateQuoteVersionRow(QuoteVersionRow, QuoteVersionInfo)
Populates a QuoteVersionRow from a QuoteVersionInfo.
Declaration
public QuoteVersionRow PopulateQuoteVersionRow(QuoteVersionRow quoteVersionRow, QuoteVersionInfo quoteVersionInfo)
Parameters
Returns
PopulateQuoteVersionRow(QuoteVersionRow, QuoteVersionInfo, bool)
Populates a QuoteVersionRow from a QuoteVersionInfo.
Declaration
public QuoteVersionRow PopulateQuoteVersionRow(QuoteVersionRow quoteVersionRow, QuoteVersionInfo quoteVersionInfo, bool ignorNumberField)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
quoteVersionRow |
|
QuoteVersionInfo |
quoteVersionInfo |
|
bool |
ignorNumberField |
If true, the number field will not be copied from the QuoteVersionInfo object.
|
Returns
RenameQuoteAlternativeAsync(int, string, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task RenameQuoteAlternativeAsync(int quoteAlternativeId, string newName, CancellationToken cancellationToken = default)
Parameters
Returns
SaveAlternativesAsync(QuoteVersionRow)
Save all alternatives for a version
Declaration
public Task SaveAlternativesAsync(QuoteVersionRow versionRow)
Parameters
Returns
SaveAsync()
Save quote and all it's versions and alternatives
Declaration
public override Task SaveAsync()
Returns
Overrides
SaveErpQuoteLineChangesAsync(int, QuoteAlternativeRecalculatedHelper, CancellationToken)
Persist changed, added and deleted quotelines
Declaration
public Task SaveErpQuoteLineChangesAsync(int quoteAlternativeId, QuoteAlternativeRecalculatedHelper i_quoteAlternativeRecalculatedHelper, CancellationToken cancellationToken = default)
Parameters
Returns
SaveQuoteLineAsync(QuoteLineInfo, string, CancellationToken)
Declaration
public Task<QuoteLineInfo> SaveQuoteLineAsync(QuoteLineInfo quoteLine, string strImage, CancellationToken cancellationToken = default)
Parameters
Returns
SetOwnAddressAsync(QuoteVersionRow, AddressInfo, AddressType, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task SetOwnAddressAsync(QuoteVersionRow quoteVersionRow, AddressInfo addressInfo, AddressType addressType, CancellationToken cancellationToken = default)
Parameters
Returns
SetOwnAddressAsync(int, AddressRow, int, CancellationToken)
Handles all database logic for the Quote. Used by the QuoteManager to keep track of the
related quote and version and alternative objects.
This class is based on NestedPersist, and all Quote, version and alternative rows will be saved when
the Save method is invoked.
Declaration
public Task SetOwnAddressAsync(int quoteVersionId, AddressRow addressRow, int countryId, CancellationToken cancellationToken = default)
Parameters
Returns
SetQuoteLineImageAsync(QuoteLineInfo, BlobLinkType, string, string, CancellationToken)
Save an image for the QuoteLine to the Binary object tables.
Declaration
public Task SetQuoteLineImageAsync(QuoteLineInfo quoteLineInfo, BlobLinkType blobLinkType, string base64String, string conceptualType, CancellationToken cancellationToken)
Parameters
Returns
Implements
Extension Methods