Show / Hide Table of Contents

Class ListsHelper

Utility class for lists helper methods.

Inheritance
object
ListsHelper
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
public static class ListsHelper

Fields

ContactWithoutPersonsRootItemType

Utility class for lists helper methods.

Declaration
public const string ContactWithoutPersonsRootItemType = "ContactWithoutPersons"
Field Value
Type Description
string

OrphanRootItemType

Utility class for lists helper methods.

Declaration
public const string OrphanRootItemType = "Orphans"
Field Value
Type Description
string

Methods

FilterDuplicateId(List<ISoListItem>)

Utility class for lists helper methods.

Declaration
public static List<ISoListItem> FilterDuplicateId(List<ISoListItem> list)
Parameters
Type Name Description
List<ISoListItem> list
Returns
Type Description
List<ISoListItem>

FindCreateListItemAsync(string, string, bool, bool, Dictionary<string, Dictionary<string, MDOCacheElement>>, string, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task<int> FindCreateListItemAsync(string tableName, string value, bool add, bool fakeAdd, Dictionary<string, Dictionary<string, MDOListTableCacheBase.MDOCacheElement>> cache, string culture, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName
string value
bool add
bool fakeAdd
Dictionary<string, Dictionary<string, MDOListTableCacheBase.MDOCacheElement>> cache
string culture
CancellationToken cancellationToken
Returns
Type Description
Task<int>

GetHeadingCustomSearchAsync(int, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task<HeadingRows.CustomSearch> GetHeadingCustomSearchAsync(int udListDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int udListDefinitionId
CancellationToken cancellationToken
Returns
Type Description
Task<HeadingRows.CustomSearch>

GetLinkTableName(string)

Utility class for lists helper methods.

Declaration
public static string GetLinkTableName(string listTableName)
Parameters
Type Name Description
string listTableName
Returns
Type Description
string

GetMdoTableName(int, int)

Returns MDO List name: "category", "associate", "udlist123"

Declaration
public static string GetMdoTableName(int listTableId, int udefListDefId)
Parameters
Type Name Description
int listTableId

table number

int udefListDefId

udef list definition id

Returns
Type Description
string

MDO List name ("category", "associate", "webpanel", "chat", "udlist123"), or NULL if no list found

GetNextRankAsync(int, CancellationToken)

Find the next rank (max + 1) in a list

Declaration
public static Task<int> GetNextRankAsync(int udListDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int udListDefinitionId

Id to the UDListDefinition list

CancellationToken cancellationToken
Returns
Type Description
Task<int>

void

GetNextRankAsync(string, CancellationToken)

Find the next rank (max + 1) in a list

Declaration
public static Task<int> GetNextRankAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Table name

CancellationToken cancellationToken
Returns
Type Description
Task<int>

void

GetQueryFromListDefinitionAsync(int, Select, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task<ListsHelper.ListTableInfo> GetQueryFromListDefinitionAsync(int udListDefinitionId, Select select, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int udListDefinitionId
Select select
CancellationToken cancellationToken
Returns
Type Description
Task<ListsHelper.ListTableInfo>

GetQueryFromTableName(string, Select)

Utility class for lists helper methods.

Declaration
public static TableInfo GetQueryFromTableName(string tableName, Select select)
Parameters
Type Name Description
string tableName
Select select
Returns
Type Description
TableInfo

GetTableName(int, bool)

Utility class for lists helper methods.

Declaration
public static string GetTableName(int listTableId, bool getRealTable = false)
Parameters
Type Name Description
int listTableId
bool getRealTable
Returns
Type Description
string

GetUDListDefinitionAsync(int, CancellationToken)

Gets the UDListDefintion by primary key or by list table id.

Declaration
public static Task<UDListDefinitionRow> GetUDListDefinitionAsync(int udListDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int udListDefinitionId

Positive ints are the primary key. Negative ints are list table id.

CancellationToken cancellationToken
Returns
Type Description
Task<UDListDefinitionRow>

UDListDefinition that matches id from the database, if any. Returns NEW item if not found.

GetUDListDefinitionFromNameAsync(string, CancellationToken)

Gets the UDListDefintion by name. First looks for exact match, then tries exact match for language specific name. (i.e. tries to handle multi-language strings properly). Finally looks for partial match if nothing else matches. Returns if there is exactly 1 match.

Declaration
public static Task<UDListDefinitionRow> GetUDListDefinitionFromNameAsync(string udListName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string udListName

Name of list

CancellationToken cancellationToken
Returns
Type Description
Task<UDListDefinitionRow>

UDListDefinition row for match, or NULL if not found. SoAmbiguousException if more than 1 match

GetUdListDefinitionIdForSoTable(SoTable)

Utility class for lists helper methods.

Declaration
public static string GetUdListDefinitionIdForSoTable(SoTable table)
Parameters
Type Name Description
SoTable table
Returns
Type Description
string

LoadAllListItemsAsync(Select, TableInfo, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task<List<ListsHelper.ItemRow>> LoadAllListItemsAsync(Select query, TableInfo tableInfo, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Select query
TableInfo tableInfo
CancellationToken cancellationToken
Returns
Type Description
Task<List<ListsHelper.ItemRow>>

RefreshListRankAsync(int, CancellationToken)

Make unique ranks for all items in a list

Declaration
public static Task RefreshListRankAsync(int udListDefinitionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int udListDefinitionId

Id to the UDListDefinition list

CancellationToken cancellationToken
Returns
Type Description
Task

void

RefreshListRankAsync(string, CancellationToken)

Make unique ranks for all items in a table

Declaration
public static Task RefreshListRankAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Table name

CancellationToken cancellationToken
Returns
Type Description
Task

void

SetHeadingRestrictionsAsync(int, Select, HeadingTableInfo)

Utility class for lists helper methods.

Declaration
public static Task SetHeadingRestrictionsAsync(int udListDefinitionId, Select select, HeadingTableInfo headingTableInfo)
Parameters
Type Name Description
int udListDefinitionId
Select select
HeadingTableInfo headingTableInfo
Returns
Type Description
Task

SetListItemsForHeadingAsync(int, string, int[], bool, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task SetListItemsForHeadingAsync(int headingId, string tablename, int[] listItemIds, bool enable, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int headingId
string tablename
int[] listItemIds
bool enable
CancellationToken cancellationToken
Returns
Type Description
Task

SetListItemsForUserGroupAsync(int, string, int[], bool, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task SetListItemsForUserGroupAsync(int groupId, string tablename, int[] listItemIds, bool enable, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int groupId
string tablename
int[] listItemIds
bool enable
CancellationToken cancellationToken
Returns
Type Description
Task

SetVisibleForUserGroupAsync(int, string, int[], bool, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task SetVisibleForUserGroupAsync(int listItemId, string tablename, int[] userGroupId, bool enable, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int listItemId
string tablename
int[] userGroupId
bool enable
CancellationToken cancellationToken
Returns
Type Description
Task

UpdateListItemRankAsync(TableInfo, int, int, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task UpdateListItemRankAsync(TableInfo tableInfo, int primaryKey, int newRank, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TableInfo tableInfo
int primaryKey
int newRank
CancellationToken cancellationToken
Returns
Type Description
Task

UpdateRankOnListItemsAsync(TableInfo, List<ItemRow>, CancellationToken)

Utility class for lists helper methods.

Declaration
public static Task UpdateRankOnListItemsAsync(TableInfo tableInfo, List<ListsHelper.ItemRow> items, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TableInfo tableInfo
List<ListsHelper.ItemRow> items
CancellationToken cancellationToken
Returns
Type Description
Task
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top