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.Construct(String, String, Int32[], Boolean, String, Boolean)
AnyTableListProviderBase.GetHistoryItems()
AnyTableListProviderBase.GetRootItems()
AnyTableListProviderBase.OnPreGetRootItems(List<ISoListItem>)
AnyTableListProviderBase.SetHistoryRestriction(Select)
AnyTableListProviderBase.ExecuteQuery(Select, List<ISoListItem>)
AnyTableListProviderBase.ListName
AnyTableListProviderBase.AdditionalInfo
AnyTableListProviderBase.HistoryIDs
AnyTableListProviderBase.OnlyReadHistory
AnyTableListProviderBase.SearchValue
AnyTableListProviderBase.ForceFlatList
AnyTableListProviderBase.HistoryInfo
AnyTableListProviderBase.HistoryItems
AnyTableListProviderBase.RootItems
AnyTableListProviderBase.HeadingItems
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.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, IPlugin
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()

Declaration
public SaleListProvider()

Fields

HasCurrency

Declaration
public const string HasCurrency = "hasCurrency"
Field Value
Type Description
String

HasQuoteOnly

Declaration
public const string HasQuoteOnly = "hasQuoteOnly"
Field Value
Type Description
String

ProviderName

Declaration
public const string ProviderName = "sale_new"
Field Value
Type Description
String

StakeholderOnly

Declaration
public const string StakeholderOnly = "stakeholderOnly"
Field Value
Type Description
String

Properties

TableInfo

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

Methods

ExecuteReader(SoCommand)

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 SoDataReader ExecuteReader(SoCommand cmd)
Parameters
Type Name Description
SoCommand cmd
Returns
Type Description
SoDataReader
Overrides
AnyTableListProviderBase.ExecuteReader(SoCommand)

GetMainQuery()

Declaration
protected override Select GetMainQuery()
Returns
Type Description
Select
Overrides
AnyTableListProviderBase.GetMainQuery()

Init()

Declaration
protected override void Init()
Overrides
AnyTableListProviderBase.Init()

OnPostGetRootItems(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 void OnPostGetRootItems(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

Overrides
AnyTableListProviderBase.OnPostGetRootItems(List<ISoListItem>)

OnRead(SoDataReader, Int16)

Declaration
protected override ISoListItem OnRead(SoDataReader reader, short lastRank)
Parameters
Type Name Description
SoDataReader reader
Int16 lastRank
Returns
Type Description
ISoListItem
Overrides
AnyTableListProviderBase.OnRead(SoDataReader, Int16)

SetContactSearchRestriction(Select, Boolean)

Declaration
protected void SetContactSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
Boolean individualTerms

SetPersonSearchRestriction(Select)

Declaration
protected void SetPersonSearchRestriction(Select sql)
Parameters
Type Name Description
Select sql

SetProjectSearchRestriction(Select, Boolean)

Declaration
protected void SetProjectSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
Boolean individualTerms

SetSaleSearchRestriction(Select, Boolean)

Declaration
protected void SetSaleSearchRestriction(Select sql, bool individualTerms)
Parameters
Type Name Description
Select sql
Boolean individualTerms

SetSearchRestriction(Select, String)

Declaration
protected override void SetSearchRestriction(Select sql, string searchValue)
Parameters
Type Name Description
Select sql
String searchValue
Overrides
AnyTableListProviderBase.SetSearchRestriction(Select, String)

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

Implements

ISoListProvider
ISoList

Extension Methods

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