Show / Hide Table of Contents

Class SaleListProvider

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Inheritance
object
AnyTableListProviderBase
SaleListProvider
Implements
ISoListProvider
ISoList
Inherited Members
AnyTableListProviderBase._historyListSize
AnyTableListProviderBase.ConstructAsync(string, string, int[], bool, string, bool, CancellationToken)
AnyTableListProviderBase.GetHistoryItemsAsync(CancellationToken)
AnyTableListProviderBase.ClearHistoryItems()
AnyTableListProviderBase.GetRootItemsAsync(CancellationToken)
AnyTableListProviderBase.GetHeadingItemsAsync(CancellationToken)
AnyTableListProviderBase.GetHistoryItemsFromDbAsync(CancellationToken)
AnyTableListProviderBase.GetRootItemsAsync()
AnyTableListProviderBase.OnPreGetRootItemsAsync(List<ISoListItem>)
AnyTableListProviderBase.SetHistoryRestriction(Select)
AnyTableListProviderBase.SetHistoryListSizeFromPreference()
AnyTableListProviderBase.ExecuteQueryAsync(Select, List<ISoListItem>, CancellationToken)
AnyTableListProviderBase.ListName
AnyTableListProviderBase.AdditionalInfo
AnyTableListProviderBase.HistoryIDs
AnyTableListProviderBase.OnlyReadHistory
AnyTableListProviderBase.ExcludeHistory
AnyTableListProviderBase.SearchValue
AnyTableListProviderBase.ForceFlatList
AnyTableListProviderBase.HistoryInfo
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[MDOProviderPlugin("sale_new")]
[MDOAdditionalInfoSeparator(";")]
[MDOAdditionalInfo("stakeholderOnly", "Only Sales with stakeholders", "1")]
[MDOAdditionalInfo("hasQuoteOnly", "Only Sales with quotes", "1")]
[MDOAdditionalInfo("hasCurrency", "Only Sales with currency id = value", "234")]
public class SaleListProvider : AnyTableListProviderBase, ISoListProvider, ISoList
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

Constructors

SaleListProvider()

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
public SaleListProvider()
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

Fields

HasCurrency

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
public const string HasCurrency = "hasCurrency"
Field Value
Type Description
string
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

HasQuoteOnly

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
public const string HasQuoteOnly = "hasQuoteOnly"
Field Value
Type Description
string
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

ProviderName

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
public const string ProviderName = "sale_new"
Field Value
Type Description
string
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

StakeholderOnly

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
public const string StakeholderOnly = "stakeholderOnly"
Field Value
Type Description
string
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

Properties

TableInfo

The main table info of the query. This is used by subclasses (e.g. this class) when restricting history data.

Declaration
protected override TableInfo TableInfo { get; }
Property Value
Type Description
TableInfo
Overrides
AnyTableListProviderBase.TableInfo
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

Methods

ExecuteReaderAsync(SoCommand, CancellationToken)

Read whole resultset - no paging here, since we do scoring and filtering of results, and highest scoring hit might be #501. Unless we are not doing a search, then we just read the first 500 matches.

Declaration
protected override Task<SoDataReader> ExecuteReaderAsync(SoCommand cmd, CancellationToken cancellationToken = default)
Parameters
Type Name Description
SoCommand cmd
CancellationToken cancellationToken
Returns
Type Description
Task<SoDataReader>
Overrides
AnyTableListProviderBase.ExecuteReaderAsync(SoCommand, CancellationToken)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

GetMainQueryAsync(CancellationToken)

Get the main query for the list.

Declaration
protected override Task<Select> GetMainQueryAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<Select>
Overrides
AnyTableListProviderBase.GetMainQueryAsync(CancellationToken)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

InitAsync(CancellationToken)

Initiate the provider after the ConstructAsync(string, string, int[], bool, string, bool, CancellationToken) method is called.

Declaration
protected override Task InitAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
AnyTableListProviderBase.InitAsync(CancellationToken)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

OnPostGetRootItemsAsync(List<ISoListItem>)

Sort the matches into rank order, so that the best matches are listed first, if there are search terms. If no search terms, then we do not modify the list.

Declaration
protected override Task OnPostGetRootItemsAsync(List<ISoListItem> items)
Parameters
Type Name Description
List<ISoListItem> items

Results - will be re-ordered if there are search terms, and capped at 500 items

Returns
Type Description
Task
Overrides
AnyTableListProviderBase.OnPostGetRootItemsAsync(List<ISoListItem>)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

OnRead(SoDataReader, short)

Raised every time a new row has been read from the database.
The implementation should read tthe results from the reader and populate an object implementing ISoListItem.

Declaration
protected override ISoListItem OnRead(SoDataReader reader, short lastRank)
Parameters
Type Name Description
SoDataReader reader

Reader to reaf from.

short lastRank

Value of the last rank populated.

Returns
Type Description
ISoListItem

Data read from the reader.

Overrides
AnyTableListProviderBase.OnRead(SoDataReader, short)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SetContactSearchRestriction(Select, bool)

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
protected void SetContactSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
bool individualTerms
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SetPersonSearchRestriction(Select)

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
protected void SetPersonSearchRestriction(Select sql)
Parameters
Type Name Description
Select sql
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SetProjectSearchRestriction(Select, bool)

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
protected void SetProjectSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
bool individualTerms
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SetSaleSearchRestriction(Select, bool)

List of sales. Searches sale + company names + person names.

Skips completed sales SkipCompletedSales userpref is set.

Skips sales without quotes if AdditionalInfo contains "hasQuoteOnline=1".

Skips sales without stakeholders if AdditionalInfo contains "stakeholderOnly=1".

Filter sales according to currency if AdditionalInfo contains "hasCurrency=(currency-id)"
Declaration
protected void SetSaleSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
bool individualTerms
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SetSearchRestrictionAsync(Select, string)

Set the search restriction on the list.

Declaration
protected override Task SetSearchRestrictionAsync(Select sql, string searchValue)
Parameters
Type Name Description
Select sql

Query to set the search restriction on.

string searchValue

The value of the search restriction.

Returns
Type Description
Task
Overrides
AnyTableListProviderBase.SetSearchRestrictionAsync(Select, string)
Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

SortItemsByScore(List<ISoListItem>)

Sort the matches into rank order, so that the best matches are listed first, if there are search terms. If no search terms, then we do not modify the list.

Declaration
protected void SortItemsByScore(List<ISoListItem> items)
Parameters
Type Name Description
List<ISoListItem> items

Results - will be re-ordered if there are search terms

Remarks

Returns sale items only: Id = sale-id, Name = Sale name (company name,dept or project name), Type = "Sale", ExtraInfo = sale heading name.

Completed/Done sales are marked with stylehint = "deleted_item" (but item.deleted = false)

Not complete Lost/Stalled/Sold sales are marked with corresponding style hints.

Implements

ISoListProvider
ISoList

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
ObjectExtensions.AssignByReflection<T>(T, T)
ObjectExtensions.GraphCopy<T>(T)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top