Class AnyTableListProviderBase
Base class for flat "MDO Lists" for any tables, that does not support filtering through group and heading link, etc...
Inheritance
Inherited Members
Namespace: SuperOffice.CRM.Lists
Assembly: SoDataBase.dll
Syntax
public abstract class AnyTableListProviderBase : ISoListProvider, ISoList
Constructors
AnyTableListProviderBase()
Default Constructor
Declaration
protected AnyTableListProviderBase()
Properties
AdditionalInfo
Additional information to provider
Declaration
protected string AdditionalInfo { get; set; }
Property Value
Type | Description |
---|---|
string |
ExcludeHistory
if true, history will be excluded.
Declaration
protected bool ExcludeHistory { get; set; }
Property Value
Type | Description |
---|---|
bool |
ForceFlatList
If true, the returned list will be flat, though it will still be filtered if grouping/filtering has been set up for the list.
Declaration
protected bool ForceFlatList { get; set; }
Property Value
Type | Description |
---|---|
bool |
HeadingItems
This list will never have headings.
Declaration
public List<ISoListHeading> HeadingItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListHeading> |
HistoryIDs
Array of history ID's; if non-null, this will BE the history; a non-null but empty array will disable reading of history altogether; a null parameter will cause history to be read from the database.
Declaration
protected int[] HistoryIDs { get; set; }
Property Value
Type | Description |
---|---|
int[] |
HistoryInfo
History information for the supported list
Declaration
public virtual HistoryInfo HistoryInfo { get; }
Property Value
Type | Description |
---|---|
HistoryInfo |
HistoryItems
History items for the "MDO" list.
Declaration
public List<ISoListItem> HistoryItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
ListName
List name (though note that as implemented by MDOProviderBase, this actually has to be a real table name, so subclasses should override and convert from their list name to a real table name) (yes it's a bit messy)
Declaration
protected string ListName { get; set; }
Property Value
Type | Description |
---|---|
string |
OnlyReadHistory
if true, only history will be read.
Declaration
protected bool OnlyReadHistory { get; set; }
Property Value
Type | Description |
---|---|
bool |
RootItems
Root items (e.g. items) for the "MDO List".
Declaration
public List<ISoListItem> RootItems { get; }
Property Value
Type | Description |
---|---|
List<ISoListItem> |
SearchValue
If non-null, the returned list will be flat and only consist of search matches.
Declaration
protected string SearchValue { get; set; }
Property Value
Type | Description |
---|---|
string |
TableInfo
The main table info of the query. This is used by subclasses (e.g. this class) when restricting history data.
Declaration
protected abstract TableInfo TableInfo { get; }
Property Value
Type | Description |
---|---|
TableInfo |
Methods
Construct(string, string, int[], bool, string, bool)
Phase two of two-stage list construction. To be called right after the constructor, at which point all constructors have run, and the class hierarchy is initialized.
Declaration
public void Construct(string listName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList)
Parameters
Type | Name | Description |
---|---|---|
string | listName | List name (though note that as implemented by MDOProviderBase, this actually has to be a real table name, so subclasses should override and convert from their list name to a real table name) (yes it's a bit messy) |
string | additionalInfo | Additional information to provider |
int[] | historyIDs | Array of history ID's; if non-null, this will BE the history; a non-null but empty array will disable reading of history altogether; a null parameter will cause history to be read from the database. |
bool | onlyReadHistory | if true, only history will be read. |
string | searchValue | If non-null, the returned list will be flat and only consist of search matches |
bool | forceFlatList | If true, the returned list will be flat, though it will still be filtered if grouping/filtering has been set up for the list |
ExecuteQuery(Select, List<ISoListItem>)
Execute the query in the database.
Declaration
protected virtual void ExecuteQuery(Select sql, List<ISoListItem> resultCollection)
Parameters
Type | Name | Description |
---|---|---|
Select | sql | The query to execute in the database. |
List<ISoListItem> | resultCollection | Collection holding the results of the query. |
ExecuteReader(SoCommand)
Perform the execute reader on the command fetching the first 500 items.
Override this methid if filters on the amount returned needs to be handled.
Declaration
protected virtual SoDataReader ExecuteReader(SoCommand cmd)
Parameters
Type | Name | Description |
---|---|---|
SoCommand | cmd | The command toe perform the execute reader on. |
Returns
Type | Description |
---|---|
SoDataReader | The reader resulted from the execute reader method. |
GetHistoryItems()
Get all the history items from the database
Declaration
protected virtual List<ISoListItem> GetHistoryItems()
Returns
Type | Description |
---|---|
List<ISoListItem> | Root items. |
GetMainQuery()
Get the main query for the list.
Declaration
protected abstract Select GetMainQuery()
Returns
Type | Description |
---|---|
Select |
GetRootItems()
Get all the root items from the database
Declaration
protected virtual List<ISoListItem> GetRootItems()
Returns
Type | Description |
---|---|
List<ISoListItem> | History items. |
Init()
Initiate the provider after the Construct(string, string, int[], bool, string, bool) method is called.
Declaration
protected abstract void Init()
OnPostGetRootItems(List<ISoListItem>)
Event raised by GetRootItems() after values are fetched from the database.
Declaration
protected virtual void OnPostGetRootItems(List<ISoListItem> items)
Parameters
Type | Name | Description |
---|---|---|
List<ISoListItem> | items | List of items returned from GetRootItems(). |
OnPreGetRootItems(List<ISoListItem>)
Event raised by GetRootItems() before values are fetched from the database.
Declaration
protected virtual void OnPreGetRootItems(List<ISoListItem> items)
Parameters
Type | Name | Description |
---|---|---|
List<ISoListItem> | items | List of items returned from GetRootItems(). |
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 abstract 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. |
SetHistoryRestriction(Select)
Set History restriction to the query. TableInfo is used when manipulating the query.
Declaration
protected virtual void SetHistoryRestriction(Select sql)
Parameters
Type | Name | Description |
---|---|---|
Select | sql | The query to modify. |
SetSearchRestriction(Select, string)
Set the search restriction on the list.
Declaration
protected abstract 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. |