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)"Inherited Members
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
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
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
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
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.GetMainQuery()
Get the main query for the list.
Declaration
protected override Select GetMainQuery()
Returns
Type | Description |
---|---|
Select |
Overrides
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.Init()
Initiate the provider after the Construct(string, string, int[], bool, string, bool) method is called.
Declaration
protected override void Init()
Overrides
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.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
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
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.SetSearchRestriction(Select, string)
Set the search restriction on the list.
Declaration
protected override void SetSearchRestriction(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. |
Overrides
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.