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.
Inheritance
System.Object
QuoteData
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: SoDataBase.dll
Syntax
public class QuoteData : NestedPersist, INestedPersist
Constructors
QuoteData(Int32)
Default constructor. A saleId must be provided.
Declaration
public QuoteData(int saleId)
Parameters
Type |
Name |
Description |
System.Int32 |
saleId |
Id of the sale.
|
Properties
ActiveQuoteVersionRow
Get the QuoteVersionRow marked as active.
Declaration
public QuoteVersionRow ActiveQuoteVersionRow { get; }
Property Value
AllRowObjects
Declaration
public IEnumerable<TableRowBase> AllRowObjects { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<TableRowBase> |
|
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
QuoteVersions
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 Dictionary<QuoteVersionRow, List<QuoteAlternativeRow>> QuoteVersions { get; }
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
|
VersionAttachmentRows
Declaration
public Dictionary<QuoteVersionRow, QuoteVersionAttachmentRows> VersionAttachmentRows { get; }
Property Value
Methods
AddQuoteAlternative(QuoteVersionRow)
Creates a new QuoteAlternativeRow and adds it to the dictionary where quoteVersionRow is the key.
Declaration
public QuoteAlternativeRow AddQuoteAlternative(QuoteVersionRow quoteVersionRow)
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.
|
Returns
AddQuoteAlternative(QuoteVersionRow, QuoteAlternativeRow)
Adds an existing QuoteAlternativeRow to the dictionary.
Declaration
public QuoteAlternativeRow AddQuoteAlternative(QuoteVersionRow quoteVersionRow, QuoteAlternativeRow quoteAlternativeRow)
Parameters
Returns
AddQuoteVersion()
Create a QuoteVersionRow and adds it to the QuoteVersions dictionary.
Declaration
public QuoteVersionRow AddQuoteVersion()
Returns
AddQuoteVersion(QuoteVersionRow)
Adds an existing QuoteVersionRow to the QuoteVersions dictionary.
Declaration
public QuoteVersionRow AddQuoteVersion(QuoteVersionRow quoteVersionRow)
Parameters
Returns
ApplyErpChangesToQuote(QuoteInfo)
Declaration
public bool ApplyErpChangesToQuote(QuoteInfo quoteInfo)
Parameters
Returns
ApplyErpChangesToQuote(QuoteInfo, Boolean)
Declaration
public bool ApplyErpChangesToQuote(QuoteInfo quoteInfo, bool ignoreSentry)
Parameters
Type |
Name |
Description |
QuoteInfo |
quoteInfo |
QuoteInfo instance to save.
|
Boolean |
ignoreSentry |
If true, the sentry will be disabled when saving to the database.
|
Returns
ApplyErpChangesToQuote(QuoteVersionContextInfo)
Declaration
public bool ApplyErpChangesToQuote(QuoteVersionContextInfo quoteVersionContextInfo)
Parameters
Returns
ApplyErpChangesToQuoteAlternative(QuoteAlternativeContextInfo)
Declaration
public bool ApplyErpChangesToQuoteAlternative(QuoteAlternativeContextInfo quoteContextInfo)
Parameters
Returns
Type |
Description |
Boolean |
true if the alternative has been changed
|
ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo)
Declaration
public bool ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo quoteAlternativeInfo)
Parameters
Returns
ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo, Boolean)
Declaration
public bool ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo quoteAlternativeInfo, bool ignoreSentry)
Parameters
Type |
Name |
Description |
QuoteAlternativeInfo |
quoteAlternativeInfo |
|
Boolean |
ignoreSentry |
If true, the sentry will be disabled when saving to the database.
|
Returns
ApplyErpChangesToQuoteVersion(QuoteAlternativeContextInfo)
Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteAlternativeContextInfo quoteAlternativeContextInfo)
Parameters
Returns
ApplyErpChangesToQuoteVersion(QuoteVersionContextInfo)
Apply changes to version.
Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteVersionContextInfo quoteContextInfo)
Parameters
Returns
Type |
Description |
Boolean |
true of the version has been changed
|
ApplyErpChangesToQuoteVersion(QuoteVersionInfo)
Apply changes to version.
Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteVersionInfo quoteVersionInfo)
Parameters
Returns
ApplyErpChangesToQuoteVersion(QuoteVersionInfo, Boolean)
Apply changes to version.
Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteVersionInfo quoteVersionInfo, bool ignoreSentry)
Parameters
Type |
Name |
Description |
QuoteVersionInfo |
quoteVersionInfo |
|
Boolean |
ignoreSentry |
If true, the sentry will be disabled when saving to the database.
|
Returns
ClearQuoteLineCache()
Clear the quoteline cache
Declaration
public void ClearQuoteLineCache()
CloneQuote(QuoteManager)
Create a new quote on a sale based on a quote, active version and alternatives from another sale
Declaration
public void CloneQuote(QuoteManager copyFromQuoteManager)
Parameters
CloneQuoteAlternatives(QuoteVersionRow, QuoteVersionRow, List<QuoteAlternativeRow>)
Clone alternatives and its quotelines in to new version.
Declaration
public void CloneQuoteAlternatives(QuoteVersionRow existingQuoteVersionRow, QuoteVersionRow newQuoteVersionRow, List<QuoteAlternativeRow> existingQuoteAlternativeRows)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
existingQuoteVersionRow |
Version to clone alternatives from.
|
QuoteVersionRow |
newQuoteVersionRow |
Updated with new LikelyQuoteAlternativeId based on the cloned alternatives
|
System.Collections.Generic.List<QuoteAlternativeRow> |
existingQuoteAlternativeRows |
Alternatives to clone
|
CloneQuoteLineRows(QuoteAlternativeRow, QuoteAlternativeRow)
Clone all quotelines from an alternative to another alternative.
Declaration
public QuoteLineRows CloneQuoteLineRows(QuoteAlternativeRow existingAlternativeRow, QuoteAlternativeRow newAlternativeRow)
Parameters
Type |
Name |
Description |
QuoteAlternativeRow |
existingAlternativeRow |
The alternative where the existing quotelines are connected to.
|
QuoteAlternativeRow |
newAlternativeRow |
The alternative where the quotelines will be copied to.
|
Returns
CloneQuoteVersion(QuoteVersionRow)
Declaration
public QuoteVersionRow CloneQuoteVersion(QuoteVersionRow existingQuoteVersionRow)
Parameters
Returns
CopyQuoteAlternative(Int32, Int32)
Copy a quotealternative row
Declaration
public QuoteAlternativeRow CopyQuoteAlternative(int quoteVersionId, int copyFromQuoteAlternativeId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
Quote version id
|
System.Int32 |
copyFromQuoteAlternativeId |
|
Returns
CreateQuoteAlternative(QuoteVersionRow, String)
Creates a new QuoteAlternative for a Quote version
Declaration
public QuoteAlternativeRow CreateQuoteAlternative(QuoteVersionRow quoteVersionRow, string alternativeName)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
quoteVersionRow |
|
System.String |
alternativeName |
|
Returns
CreateQuoteAlternative(Int32, String)
Creates a new QuoteAlternative for a Quote version
Declaration
public QuoteAlternativeRow CreateQuoteAlternative(int quoteVersionId, string alternativeName)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
System.String |
alternativeName |
|
Returns
CreateQuoteLine(Int32)
Add a new quoteline to an existing alternative
Declaration
public QuoteLineRow CreateQuoteLine(int quoteAlternativeId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteAlternativeId |
Alternative to add new quote line to
|
Returns
CreateQuoteVersion(String)
Create a Quoteversion for the current Quote.
Declaration
public QuoteVersionRow CreateQuoteVersion(string firstAlternativeName)
Parameters
Type |
Name |
Description |
System.String |
firstAlternativeName |
Name to be given to the default alternative
|
Returns
CreateQuoteVersionCopy(QuoteVersionRow, List<QuoteAlternativeRow>)
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 QuoteVersionRow CreateQuoteVersionCopy(QuoteVersionRow existingQuoteVersionRow, List<QuoteAlternativeRow> existingQuoteAlternativeRows)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
existingQuoteVersionRow |
The existing quote, which will be marked "archived" if the alternativerows == NULL.
|
System.Collections.Generic.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"
|
Returns
DeleteQuote(Int32)
Declaration
public void DeleteQuote(int quoteId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteId |
|
DeleteQuoteAlternative(Int32)
Mark a quotealternative row to be deleted
Declaration
public void DeleteQuoteAlternative(int quoteAlternativeId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteAlternativeId |
|
DeleteQuoteLine(Int32)
Declaration
public void DeleteQuoteLine(int quoteLineId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteLineId |
Id of the quoteline to delete.
|
DeleteQuoteLineRow(Int32)
Delete the quoteline from the database.
Declaration
public void DeleteQuoteLineRow(int quoteLineId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteLineId |
Quote line to delete
|
DetectErpQuoteLineChanges(List<QuoteLineInfo>, List<QuoteLineInfo>)
Declaration
public QuoteAlternativeRecalculatedHelper DetectErpQuoteLineChanges(List<QuoteLineInfo> quoteLineInfosBefore, List<QuoteLineInfo> quoteLineInfosAfter)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<QuoteLineInfo> |
quoteLineInfosBefore |
|
System.Collections.Generic.List<QuoteLineInfo> |
quoteLineInfosAfter |
|
Returns
GetAlternativeRow(Int32)
Get QuoteAlternativeRow from the dictionary based on its id.
Declaration
public QuoteAlternativeRow GetAlternativeRow(int alternativeId)
Parameters
Type |
Name |
Description |
System.Int32 |
alternativeId |
|
Returns
GetAlternativeRows(QuoteVersionRow)
Get a list of QuoteAlternativeRows belonging to a QuoteVersionRow
Declaration
public List<QuoteAlternativeRow> GetAlternativeRows(QuoteVersionRow quoteVersionRow)
Parameters
Returns
Type |
Description |
System.Collections.Generic.List<QuoteAlternativeRow> |
List of QuoteAlternativeRow. Null if the quoteVersionRow is not valid.
|
GetAlternativeRows(Int32)
Get a list of QuoteAlternativeRows belonging to a QuoteVersionRow with given id.
Declaration
public List<QuoteAlternativeRow> GetAlternativeRows(int quoteVersionId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
Returns
Type |
Description |
System.Collections.Generic.List<QuoteAlternativeRow> |
List of QuoteAlternativeRow. Null if the quoteVersionInfo is not valid.
|
GetBillingAddress(Int32)
Declaration
public AddressRow GetBillingAddress(int quoteVersionId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
Returns
GetLikelyAlternativeRow(QuoteVersionRow)
Get the most likely quotealternative for the QuoteVersionRow
Declaration
public QuoteAlternativeRow GetLikelyAlternativeRow(QuoteVersionRow quoteVersionRow)
Parameters
Returns
GetQuoteLineRow(Int32)
Declaration
public QuoteLineRow GetQuoteLineRow(int quoteLineId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteLineId |
Primary key of quote line
|
Returns
Type |
Description |
QuoteLineRow |
The quote line row. Throws exception if quote line row does not exist
|
GetQuoteLineRows(Int32)
Get all quotelines for a specified quote alternative
Declaration
public QuoteLineRows GetQuoteLineRows(int quoteAlternativeId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteAlternativeId |
|
Returns
GetShippingAddress(Int32)
Declaration
public AddressRow GetShippingAddress(int quoteVersionId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
Returns
GetVersionRow(Int32)
Get a QuoteVersionRow from the QuoteData collection based on quoteVersionId
Declaration
public QuoteVersionRow GetVersionRow(int quoteVersionId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
Returns
PopulateQuoteAlternativeRow(QuoteAlternativeRow, QuoteAlternativeInfo)
Declaration
public QuoteAlternativeRow PopulateQuoteAlternativeRow(QuoteAlternativeRow quoteAlternativeRow, QuoteAlternativeInfo quoteAlternative)
Parameters
Returns
PopulateQuoteLineRow(QuoteLineRow, QuoteLineInfo)
Declaration
public QuoteLineRow PopulateQuoteLineRow(QuoteLineRow quoteLineRow, QuoteLineInfo quoteLine)
Parameters
Returns
PopulateQuoteRow(QuoteRow, QuoteInfo)
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, Boolean)
Populates a QuoteVersionRow from a QuoteVersionInfo.
Declaration
public QuoteVersionRow PopulateQuoteVersionRow(QuoteVersionRow quoteVersionRow, QuoteVersionInfo quoteVersionInfo, bool ignorNumberField)
Parameters
Type |
Name |
Description |
QuoteVersionRow |
quoteVersionRow |
|
QuoteVersionInfo |
quoteVersionInfo |
|
Boolean |
ignorNumberField |
If true, the number field will not be copied from the QuoteVersionInfo object.
|
Returns
RenameQuoteAlternative(Int32, String)
Declaration
public void RenameQuoteAlternative(int quoteAlternativeId, string newName)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteAlternativeId |
|
System.String |
newName |
|
Save()
Save quote and all it's versions and alternatives
Declaration
public override void Save()
Overrides
SaveAlternatives(QuoteVersionRow)
Save all alternatives for a version
Declaration
public void SaveAlternatives(QuoteVersionRow versionRow)
Parameters
SaveErpQuoteLineChanges(Int32, QuoteAlternativeRecalculatedHelper)
Persist changed, added and deleted quotelines
Declaration
public void SaveErpQuoteLineChanges(int quoteAlternativeId, QuoteAlternativeRecalculatedHelper i_quoteAlternativeRecalculatedHelper)
Parameters
SaveQuoteLine(QuoteLineInfo, String)
Declaration
public QuoteLineInfo SaveQuoteLine(QuoteLineInfo quoteLine, string strImage)
Parameters
Type |
Name |
Description |
QuoteLineInfo |
quoteLine |
|
System.String |
strImage |
|
Returns
SetOwnAddress(QuoteVersionRow, AddressInfo, AddressType)
Declaration
public void SetOwnAddress(QuoteVersionRow quoteVersionRow, AddressInfo addressInfo, AddressType addressType)
Parameters
SetOwnAddress(Int32, AddressRow, Int32)
Declaration
public void SetOwnAddress(int quoteVersionId, AddressRow addressRow, int countryId)
Parameters
Type |
Name |
Description |
System.Int32 |
quoteVersionId |
|
AddressRow |
addressRow |
|
System.Int32 |
countryId |
|
SetQuoteLineImage(QuoteLineInfo, BlobLinkType, String, String)
Save an image for the QuoteLine to the Binary object tables.
Declaration
public void SetQuoteLineImage(QuoteLineInfo quoteLineInfo, BlobLinkType blobLinkType, string base64String, string conceptualType)
Parameters
Implements
Extension Methods
EnumUtil.MapEnums<From, To>(From)