Show / Hide Table of Contents

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
Object
NestedPersist
QuoteData
Implements
INestedPersist
Inherited Members
NestedPersist._saveOwner
NestedPersist._isSaving
NestedPersist.SetSaveOwner(INestedPersist)
NestedPersist.INestedPersist.OnPreIdUpdate()
NestedPersist.INestedPersist.OnPrimaryKeyRequest(PKContainer)
NestedPersist.INestedPersist.OnPrimaryKeyUpdate(PKContainer)
NestedPersist.INestedPersist.OnIdUpdate()
NestedPersist.INestedPersist.OnSave(BatchSave)
NestedPersist.INestedPersist.OnSaved(Boolean)
NestedPersist.OnPreIdUpdate()
NestedPersist.OnPrimaryKeyRequest(PKContainer)
NestedPersist.OnPrimaryKeyUpdate(PKContainer)
NestedPersist.OnIdUpdate()
NestedPersist.OnSave(BatchSave)
NestedPersist.OnSaved(Boolean)
NestedPersist.IsSaving
NestedPersist.IsMarkedForDelete
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.Sale
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
Int32 saleId

Id of the sale.

Properties

ActiveQuoteVersionRow

Get the QuoteVersionRow marked as active.

Declaration
public QuoteVersionRow ActiveQuoteVersionRow { get; }
Property Value
Type Description
QuoteVersionRow

AllRowObjects

Declaration
public IEnumerable<TableRowBase> AllRowObjects { get; }
Property Value
Type Description
IEnumerable<TableRowBase>

ContactInfo

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
Type Description
IContactInfo

IsDeleted

Returns true if the QuoteRow is deleted.

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

IsDirty

Returns true if the QuoteRow or any versionrows or alternativerows isDirty.

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

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
Type Description
IPersonInfo

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
Type Description
IProjectInfo

QuoteRow

The main quote row.

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

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
Type Description
Dictionary<QuoteVersionRow, List<QuoteAlternativeRow>>

SaleInfo

Get Sale information for this quote. The Sale Info will be created when first asked for.

Declaration
public ISaleInfo SaleInfo { get; }
Property Value
Type Description
ISaleInfo

SaleRow

The main Sale row the quote is connected to.

Declaration
public SaleRow SaleRow { get; }
Property Value
Type Description
SaleRow

UserInfo

Returns 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
Type Description
Dictionary<QuoteVersionRow, QuoteVersionAttachmentRows>

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
Type Description
QuoteAlternativeRow

AddQuoteAlternative(QuoteVersionRow, QuoteAlternativeRow)

Adds an existing QuoteAlternativeRow to the dictionary.

Declaration
public QuoteAlternativeRow AddQuoteAlternative(QuoteVersionRow quoteVersionRow, QuoteAlternativeRow quoteAlternativeRow)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
QuoteAlternativeRow quoteAlternativeRow
Returns
Type Description
QuoteAlternativeRow

AddQuoteVersion()

Create a QuoteVersionRow and adds it to the QuoteVersions dictionary.

Declaration
public QuoteVersionRow AddQuoteVersion()
Returns
Type Description
QuoteVersionRow

QuoteVersionRow

AddQuoteVersion(QuoteVersionRow)

Adds an existing QuoteVersionRow to the QuoteVersions dictionary.

Declaration
public QuoteVersionRow AddQuoteVersion(QuoteVersionRow quoteVersionRow)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
Returns
Type Description
QuoteVersionRow

ApplyErpChangesToQuote(QuoteInfo)

Apply changes to quote.

Declaration
public bool ApplyErpChangesToQuote(QuoteInfo quoteInfo)
Parameters
Type Name Description
QuoteInfo quoteInfo
Returns
Type Description
Boolean

ApplyErpChangesToQuote(QuoteInfo, Boolean)

Apply changes to quote.

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
Type Description
Boolean

ApplyErpChangesToQuote(QuoteVersionContextInfo)

Apply changes to quote.

Declaration
public bool ApplyErpChangesToQuote(QuoteVersionContextInfo quoteVersionContextInfo)
Parameters
Type Name Description
QuoteVersionContextInfo quoteVersionContextInfo

QuoteVersionContextInfo with the QuoteInfo instance to save.

Returns
Type Description
Boolean

ApplyErpChangesToQuoteAlternative(QuoteAlternativeContextInfo)

Declaration
public bool ApplyErpChangesToQuoteAlternative(QuoteAlternativeContextInfo quoteContextInfo)
Parameters
Type Name Description
QuoteAlternativeContextInfo quoteContextInfo
Returns
Type Description
Boolean

true if the alternative has been changed

ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo)

Declaration
public bool ApplyErpChangesToQuoteAlternative(QuoteAlternativeInfo quoteAlternativeInfo)
Parameters
Type Name Description
QuoteAlternativeInfo quoteAlternativeInfo
Returns
Type Description
Boolean

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
Type Description
Boolean

ApplyErpChangesToQuoteVersion(QuoteAlternativeContextInfo)

Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteAlternativeContextInfo quoteAlternativeContextInfo)
Parameters
Type Name Description
QuoteAlternativeContextInfo quoteAlternativeContextInfo
Returns
Type Description
Boolean

ApplyErpChangesToQuoteVersion(QuoteVersionContextInfo)

Apply changes to version.

Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteVersionContextInfo quoteContextInfo)
Parameters
Type Name Description
QuoteVersionContextInfo quoteContextInfo
Returns
Type Description
Boolean

true of the version has been changed

ApplyErpChangesToQuoteVersion(QuoteVersionInfo)

Apply changes to version.

Declaration
public bool ApplyErpChangesToQuoteVersion(QuoteVersionInfo quoteVersionInfo)
Parameters
Type Name Description
QuoteVersionInfo quoteVersionInfo
Returns
Type Description
Boolean

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
Type Description
Boolean

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
Type Name Description
QuoteManager copyFromQuoteManager

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

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
Type Description
QuoteLineRows

CloneQuoteVersion(QuoteVersionRow)

Declaration
public QuoteVersionRow CloneQuoteVersion(QuoteVersionRow existingQuoteVersionRow)
Parameters
Type Name Description
QuoteVersionRow existingQuoteVersionRow
Returns
Type Description
QuoteVersionRow

CopyQuoteAlternative(Int32, Int32)

Copy a quotealternative row

Declaration
public QuoteAlternativeRow CopyQuoteAlternative(int quoteVersionId, int copyFromQuoteAlternativeId)
Parameters
Type Name Description
Int32 quoteVersionId

Quote version id

Int32 copyFromQuoteAlternativeId
Returns
Type Description
QuoteAlternativeRow

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
String alternativeName
Returns
Type Description
QuoteAlternativeRow

CreateQuoteAlternative(Int32, String)

Creates a new QuoteAlternative for a Quote version

Declaration
public QuoteAlternativeRow CreateQuoteAlternative(int quoteVersionId, string alternativeName)
Parameters
Type Name Description
Int32 quoteVersionId
String alternativeName
Returns
Type Description
QuoteAlternativeRow

CreateQuoteLine(Int32)

Add a new quoteline to an existing alternative

Declaration
public QuoteLineRow CreateQuoteLine(int quoteAlternativeId)
Parameters
Type Name Description
Int32 quoteAlternativeId

Alternative to add new quote line to

Returns
Type Description
QuoteLineRow

The blank, unsaved quote line

CreateQuoteVersion(String)

Create a Quoteversion for the current Quote.

Declaration
public QuoteVersionRow CreateQuoteVersion(string firstAlternativeName)
Parameters
Type Name Description
String firstAlternativeName

Name to be given to the default alternative

Returns
Type Description
QuoteVersionRow

The created and unsaved QuoteVersionRow

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.

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
Type Description
QuoteVersionRow

The new quote version row

DeleteQuote(Int32)

Declaration
public void DeleteQuote(int quoteId)
Parameters
Type Name Description
Int32 quoteId

DeleteQuoteAlternative(Int32)

Mark a quotealternative row to be deleted

Declaration
public void DeleteQuoteAlternative(int quoteAlternativeId)
Parameters
Type Name Description
Int32 quoteAlternativeId

DeleteQuoteLine(Int32)

Deletes a QuoteLine

Declaration
public void DeleteQuoteLine(int quoteLineId)
Parameters
Type Name Description
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
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
List<QuoteLineInfo> quoteLineInfosBefore
List<QuoteLineInfo> quoteLineInfosAfter
Returns
Type Description
QuoteAlternativeRecalculatedHelper

GetAlternativeRow(Int32)

Get QuoteAlternativeRow from the dictionary based on its id.

Declaration
public QuoteAlternativeRow GetAlternativeRow(int alternativeId)
Parameters
Type Name Description
Int32 alternativeId
Returns
Type Description
QuoteAlternativeRow

GetAlternativeRows(QuoteVersionRow)

Get a list of QuoteAlternativeRows belonging to a QuoteVersionRow

Declaration
public List<QuoteAlternativeRow> GetAlternativeRows(QuoteVersionRow quoteVersionRow)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
Returns
Type Description
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
Int32 quoteVersionId
Returns
Type Description
List<QuoteAlternativeRow>

List of QuoteAlternativeRow. Null if the quoteVersionInfo is not valid.

GetBillingAddress(Int32)

Declaration
public AddressRow GetBillingAddress(int quoteVersionId)
Parameters
Type Name Description
Int32 quoteVersionId
Returns
Type Description
AddressRow

GetLikelyAlternativeRow(QuoteVersionRow)

Get the most likely quotealternative for the QuoteVersionRow

Declaration
public QuoteAlternativeRow GetLikelyAlternativeRow(QuoteVersionRow quoteVersionRow)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
Returns
Type Description
QuoteAlternativeRow

GetQuoteLineRow(Int32)

Return quoteline row

Declaration
public QuoteLineRow GetQuoteLineRow(int quoteLineId)
Parameters
Type Name Description
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
Int32 quoteAlternativeId
Returns
Type Description
QuoteLineRows

Quotelines collection

Remarks

The quotelines will be cached for the lifetime of the QuoteData instance.

GetShippingAddress(Int32)

Declaration
public AddressRow GetShippingAddress(int quoteVersionId)
Parameters
Type Name Description
Int32 quoteVersionId
Returns
Type Description
AddressRow

GetVersionRow(Int32)

Get a QuoteVersionRow from the QuoteData collection based on quoteVersionId

Declaration
public QuoteVersionRow GetVersionRow(int quoteVersionId)
Parameters
Type Name Description
Int32 quoteVersionId
Returns
Type Description
QuoteVersionRow

PopulateQuoteAlternativeRow(QuoteAlternativeRow, QuoteAlternativeInfo)

Declaration
public QuoteAlternativeRow PopulateQuoteAlternativeRow(QuoteAlternativeRow quoteAlternativeRow, QuoteAlternativeInfo quoteAlternative)
Parameters
Type Name Description
QuoteAlternativeRow quoteAlternativeRow
QuoteAlternativeInfo quoteAlternative
Returns
Type Description
QuoteAlternativeRow

PopulateQuoteLineRow(QuoteLineRow, QuoteLineInfo)

Declaration
public QuoteLineRow PopulateQuoteLineRow(QuoteLineRow quoteLineRow, QuoteLineInfo quoteLine)
Parameters
Type Name Description
QuoteLineRow quoteLineRow
QuoteLineInfo quoteLine
Returns
Type Description
QuoteLineRow

PopulateQuoteRow(QuoteRow, QuoteInfo)

Declaration
public QuoteRow PopulateQuoteRow(QuoteRow quoteRow, QuoteInfo quoteInfo)
Parameters
Type Name Description
QuoteRow quoteRow
QuoteInfo quoteInfo
Returns
Type Description
QuoteRow

PopulateQuoteVersionRow(QuoteVersionRow, QuoteVersionInfo)

Populates a QuoteVersionRow from a QuoteVersionInfo.

Declaration
public QuoteVersionRow PopulateQuoteVersionRow(QuoteVersionRow quoteVersionRow, QuoteVersionInfo quoteVersionInfo)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
QuoteVersionInfo quoteVersionInfo
Returns
Type Description
QuoteVersionRow

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
Type Description
QuoteVersionRow

RenameQuoteAlternative(Int32, String)

Declaration
public void RenameQuoteAlternative(int quoteAlternativeId, string newName)
Parameters
Type Name Description
Int32 quoteAlternativeId
String newName

Save()

Save quote and all it's versions and alternatives

Declaration
public override void Save()
Overrides
NestedPersist.Save()

SaveAlternatives(QuoteVersionRow)

Save all alternatives for a version

Declaration
public void SaveAlternatives(QuoteVersionRow versionRow)
Parameters
Type Name Description
QuoteVersionRow versionRow

SaveErpQuoteLineChanges(Int32, QuoteAlternativeRecalculatedHelper)

Persist changed, added and deleted quotelines

Declaration
public void SaveErpQuoteLineChanges(int quoteAlternativeId, QuoteAlternativeRecalculatedHelper i_quoteAlternativeRecalculatedHelper)
Parameters
Type Name Description
Int32 quoteAlternativeId
QuoteAlternativeRecalculatedHelper i_quoteAlternativeRecalculatedHelper

SaveQuoteLine(QuoteLineInfo, String)

Save a Quote line

Declaration
public QuoteLineInfo SaveQuoteLine(QuoteLineInfo quoteLine, string strImage)
Parameters
Type Name Description
QuoteLineInfo quoteLine
String strImage
Returns
Type Description
QuoteLineInfo

SetOwnAddress(QuoteVersionRow, AddressInfo, AddressType)

Declaration
public void SetOwnAddress(QuoteVersionRow quoteVersionRow, AddressInfo addressInfo, AddressType addressType)
Parameters
Type Name Description
QuoteVersionRow quoteVersionRow
AddressInfo addressInfo
AddressType addressType

SetOwnAddress(Int32, AddressRow, Int32)

Declaration
public void SetOwnAddress(int quoteVersionId, AddressRow addressRow, int countryId)
Parameters
Type Name Description
Int32 quoteVersionId
AddressRow addressRow
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
Type Name Description
QuoteLineInfo quoteLineInfo
BlobLinkType blobLinkType

Must be either QuoteLineImage or QuoteLineThumbnail

String base64String
String conceptualType

Implements

INestedPersist

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 |  Back to top