Show / Hide Table of Contents

Class AssociateMDOProviderBase

Base class for the MDO providers that use the associate table as the source for their data.

Inheritance
Object
MDOProviderBase
AssociateMDOProviderBase
AssociateMDOProvider
AssociateRestrictionsMDOProviderBase
DiaryOwnerMDOProvider
ProjectAssociateMDOProvider
QuoteApprovalAssociateMDOProvider
ResourceMDOProvider
ServiceAssociateMDOProvider
VisibleForAssociateMDOProvider
Implements
ISoListProvider
ISoList
IEnumerable<ISoListItem>
IEnumerable
Inherited Members
MDOProviderBase._historyIds
MDOProviderBase._searchValue
MDOProviderBase._forceFlatList
MDOProviderBase._rootCollection
MDOProviderBase._historyCollection
MDOProviderBase._headingCollection
MDOProviderBase._declaredListName
MDOProviderBase._tableRows
MDOProviderBase._nodeType
MDOProviderBase._listName
MDOProviderBase._tableName
MDOProviderBase._tableListInfo
MDOProviderBase._listInfo
MDOProviderBase.FillList()
MDOProviderBase.AddSimpleListOrderBy(ListTableRows.CustomSearch)
MDOProviderBase.GetItemsAndHeadingsQuery(Boolean, Int32[])
MDOProviderBase.AddGroupLinkJoin(Int32[], ListTableRows.CustomSearch)
MDOProviderBase.GetItemId(ListTableRow)
MDOProviderBase.GetItemRank(ListTableRow)
MDOProviderBase.GetItemDeleted(ListTableRow)
MDOProviderBase.GetItemColor(ListTableRow)
MDOProviderBase.GetItemStyleHint(ListTableRow)
MDOProviderBase.GetItemExtraInfo(ListTableRow)
MDOProviderBase.GetGroupingAllowedForList()
MDOProviderBase.OnAddRootElementToCollection(SoListItem)
MDOProviderBase.GetListLowerLimit()
MDOProviderBase.GetPreferredSortOrder()
MDOProviderBase.BuildMdoCollections()
MDOProviderBase.IEnumerable<ISoListItem>.GetEnumerator()
MDOProviderBase.IEnumerable.GetEnumerator()
MDOProviderBase.IncludeDeletedItems
MDOProviderBase.InhibitResortOnFlattening
MDOProviderBase.IsFinalListFlat
MDOProviderBase.HistoryItems
MDOProviderBase.RootItems
MDOProviderBase.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
[MDOAdditionalInfoSeparator(";")]
[MDOAdditionalInfo("heading_id", "Associates linked to this heading", 2)]
[MDOAdditionalInfo("group_idx", "Associates belonging to this user group (primary or secondary groups)", 2)]
[MDOAdditionalInfo("project_id", "Associates that are members of this project", 231)]
[MDOAdditionalInfo("get_deleted", "Associates that are retired", false)]
public abstract class AssociateMDOProviderBase : MDOProviderBase, ISoListProvider, ISoList, IPlugin, IEnumerable<ISoListItem>, IEnumerable
Remarks

The one thing to understand here is that, basically, associates are fetched by this class, while resources are fetched by the base class, and we try to combine those queries as well as possible. In fact, usually both queries are executed, but if we don't want resources then the resource query is 'sabotaged' by including a restriction that is always false, thereby making it collapse... and vice versa for associates. This design was reasonable enough when the provider was simple, but has now outlived its usefulness... however there is no time to fix it now, so we'll live with it for a while.

We should probably split into type-specific subproviders, not use the MDOProviderBase at all, and instead do some creative merging similar to what the archives do. Suggestions welcome to marek.

AdditionalInfo group_idx=-1 will retrive the MDO list for the logged on users main group.

Constructors

AssociateMDOProviderBase(AssociateMDOProviderType)

Initialize the class

Declaration
public AssociateMDOProviderBase(AssociateMDOProviderType type)
Parameters
Type Name Description
AssociateMDOProviderType type

Fields

_AdditionalInfo

Any additional parameters to be used in the associate search

Declaration
protected Dictionary<string, string> _AdditionalInfo
Field Value
Type Description
Dictionary<String, String>

_additionalInfo_GetDeleted

Declaration
public const string _additionalInfo_GetDeleted = "get_deleted"
Field Value
Type Description
String

Properties

HistoryInfo

Declaration
public override HistoryInfo HistoryInfo { get; }
Property Value
Type Description
HistoryInfo
Overrides
MDOProviderBase.HistoryInfo

PersonTableInfo

Declaration
protected PersonTableInfo PersonTableInfo { get; }
Property Value
Type Description
PersonTableInfo

Methods

AcceptHistoryRow(ListTableRow)

Test if a history row is to be accepted into the collection

Declaration
protected override bool AcceptHistoryRow(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
Boolean
Overrides
MDOProviderBase.AcceptHistoryRow(ListTableRow)

Construct(String, String, Int32[], Boolean, String, Boolean)

Phase two of the two-phase construction

Declaration
public override void Construct(string tableName, string additionalInfo, int[] historyIDs, bool onlyReadHistory, string searchValue, bool forceFlatList)
Parameters
Type Name Description
String tableName
String additionalInfo
Int32[] historyIDs
Boolean onlyReadHistory
String searchValue
Boolean forceFlatList
Overrides
MDOProviderBase.Construct(String, String, Int32[], Boolean, String, Boolean)

ExecuteQuery(Select, List<Int32>)

Execute the query in the database.

Declaration
protected void ExecuteQuery(Select sql, List<int> resultIds)
Parameters
Type Name Description
Select sql

The query to execute in the database.

List<Int32> resultIds

Collection holding the results of the query.

ExecuteReader(SoCommand)

Perform the execute reader on the command fetching the first 500 items.

Declaration
protected 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.

GenerateCommonQuery(ListTableRows.CustomSearch, ListInfo)

Declaration
protected virtual void GenerateCommonQuery(ListTableRows.CustomSearch query, ListInfo li)
Parameters
Type Name Description
ListTableRows.CustomSearch query
ListInfo li

GetAssociateFlatList()

Declaration
protected ListTableRows.CustomSearch GetAssociateFlatList()
Returns
Type Description
ListTableRows.CustomSearch

GetAssociateHeadingAndItems()

Associate headings are located in group

Declaration
protected ListTableRows.CustomSearch GetAssociateHeadingAndItems()
Returns
Type Description
ListTableRows.CustomSearch

GetHeadingIconHint(ListTableRow)

Get the icon hint text for a heading item

Declaration
protected override string GetHeadingIconHint(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetHeadingIconHint(ListTableRow)

GetHeadingType(ListTableRow)

Get the type of the heading

Declaration
protected override string GetHeadingType(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetHeadingType(ListTableRow)

GetHistoryCollection()

Get History collection for associate list. History is both resource and associates, and field extra_id in history table indicate that the history is for the associatechooser.

Declaration
protected override ListTableRows.CustomSearch GetHistoryCollection()
Returns
Type Description
ListTableRows.CustomSearch

ListTableRows.CustomSearch

Overrides
MDOProviderBase.GetHistoryCollection()

GetHistoryIconHint(ListTableRow)

Get the icon hint for a history item

Declaration
protected override string GetHistoryIconHint(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetHistoryIconHint(ListTableRow)

GetItemIconHint(ListTableRow)

Get the icon hint for an item

Declaration
protected override string GetItemIconHint(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetItemIconHint(ListTableRow)

GetItemName(ListTableRow)

Get the name of an item

Declaration
protected override string GetItemName(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetItemName(ListTableRow)

GetItemsAndHeadingsQuery()

Get the query for the resources (associates are fetched separately)

Declaration
protected override ListTableRows.CustomSearch GetItemsAndHeadingsQuery()
Returns
Type Description
ListTableRows.CustomSearch
Overrides
MDOProviderBase.GetItemsAndHeadingsQuery()

GetItemTooltip(ListTableRow)

Use dynamic tooltips for associates, since that gives more information; use static tooltip text for other types

Declaration
protected override string GetItemTooltip(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetItemTooltip(ListTableRow)

GetItemType(ListTableRow)

Get the type of an item

Declaration
protected override string GetItemType(ListTableRow row)
Parameters
Type Name Description
ListTableRow row
Returns
Type Description
String
Overrides
MDOProviderBase.GetItemType(ListTableRow)

GetSimpleListQuery()

Get a query to return a flat list if preference grouping allowed == false. This might happen for the associate chooser list if Admin Grouped list/Associate/Resources" is set to No.

Declaration
protected override ListTableRows.CustomSearch GetSimpleListQuery()
Returns
Type Description
ListTableRows.CustomSearch

CustomSearch query for the simple list

Overrides
MDOProviderBase.GetSimpleListQuery()

OnAddHeadingElementToCollection(SoListHeading)

Called when a heading item is added to the final collection

Declaration
protected override void OnAddHeadingElementToCollection(SoListHeading heading)
Parameters
Type Name Description
SoListHeading heading
Overrides
MDOProviderBase.OnAddHeadingElementToCollection(SoListHeading)

OnAddHistoryElementToCollection(SoListItem)

Called when a history element is added to the final collection

Declaration
protected override void OnAddHistoryElementToCollection(SoListItem item)
Parameters
Type Name Description
SoListItem item
Overrides
MDOProviderBase.OnAddHistoryElementToCollection(SoListItem)

OnAddSubItemToCollection(SoListItem, List<ISoListItem>)

Called when an item is added to the item list of a heading

Declaration
protected override void OnAddSubItemToCollection(SoListItem item, List<ISoListItem> headingItemsCollection)
Parameters
Type Name Description
SoListItem item
List<ISoListItem> headingItemsCollection
Overrides
MDOProviderBase.OnAddSubItemToCollection(SoListItem, List<ISoListItem>)

ReadItemsAndHeadings()

Read heading and items. Special for associate is the combination of associates and resources in the same list. This means there will have to be two queries to get the items for the list.

Declaration
protected override void ReadItemsAndHeadings()
Overrides
MDOProviderBase.ReadItemsAndHeadings()

ReadSimpleList()

For diaryowner list, get the associate list and return it as a flat list if Admin Grouped list/Associate/Resources" is set to No.

Declaration
protected override void ReadSimpleList()
Overrides
MDOProviderBase.ReadSimpleList()

ResortFlattenedList()

Override sorting of the associate list if it has been flattened

Declaration
protected override void ResortFlattenedList()
Overrides
MDOProviderBase.ResortFlattenedList()

Implements

ISoListProvider
ISoList
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
IEnumerableExtensions.ForEach<T>(System.Collections.Generic.IEnumerable<T>, System.Action<T>)
IEnumerableExtensions.ContainsAny<T>(System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IEnumerable<T>)
IEnumerableExtensions.Batch<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
IEnumerableExtensions.IndexOf<T>(System.Collections.Generic.IEnumerable<T>, T, System.Int32)
IEnumerableExtensions.IndexOf<T>(System.Collections.Generic.IEnumerable<T>, System.Func<T, System.Boolean>, System.Int32)
IEnumerableExtensions.Permute<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
IEnumerableExtensions.PermissiveToDictionary<T, K, V>(System.Collections.Generic.IEnumerable<T>, System.Func<T, K>, System.Func<T, V>)
IEnumerableExtensions.PermissiveToDictionary<T, K, V>(System.Collections.Generic.IEnumerable<T>, System.Func<T, K>, System.Func<T, V>, System.Collections.Generic.IEqualityComparer<K>)
IEnumerableExtensions.GetDifferentCombinations<T>(System.Collections.Generic.IEnumerable<T>, System.Int32)
CollectionOps.AtLeastOne<T>(IEnumerable<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