Class ListsHelper
Utility class for lists helper methods.
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
public static class ListsHelper : Object
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> |
FindCreateListItem(String, String, Boolean, Boolean, ref Dictionary<String, Dictionary<String, MDOListTableCacheBase.MDOCacheElement>>, String)
Utility class for lists helper methods.
Declaration
public static int FindCreateListItem(string tableName, string value, bool add, bool fakeAdd, ref Dictionary<string, Dictionary<string, MDOListTableCacheBase.MDOCacheElement>> cache, string culture)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | |
String | value | |
Boolean | add | |
Boolean | fakeAdd | |
Dictionary<String, Dictionary<String, MDOListTableCacheBase.MDOCacheElement>> | cache | |
String | culture |
Returns
Type | Description |
---|---|
Int32 |
GetHeadingCustomSearch(Int32)
Utility class for lists helper methods.
Declaration
public static HeadingRows.CustomSearch GetHeadingCustomSearch(int udListDefinitionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId |
Returns
Type | Description |
---|---|
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(Int32, Int32)
Returns MDO List name: "category", "associate", "udlist123"
Declaration
public static string GetMdoTableName(int listTableId, int udefListDefId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listTableId | table number |
Int32 | udefListDefId | udef list definition id |
Returns
Type | Description |
---|---|
String | MDO List name ("category", "associate", "webpanel", "chat", "udlist123"), or NULL if no list found |
GetNextRank(Int32)
Find the next rank (max + 1) in a list
Declaration
public static int GetNextRank(int udListDefinitionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | Id to the UDListDefinition list |
Returns
Type | Description |
---|---|
Int32 | void |
GetNextRank(String)
Find the next rank (max + 1) in a list
Declaration
public static int GetNextRank(string tableName)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name |
Returns
Type | Description |
---|---|
Int32 | void |
GetQueryFromListDefinition(Int32, Select)
Utility class for lists helper methods.
Declaration
public static TableInfo GetQueryFromListDefinition(int udListDefinitionId, Select select)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | |
Select | select |
Returns
Type | Description |
---|---|
TableInfo |
GetQueryFromListDefinition(Int32, Select, out Int32)
Utility class for lists helper methods.
Declaration
public static TableInfo GetQueryFromListDefinition(int udListDefinitionId, Select select, out int retListTableId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | |
Select | select | |
Int32 | retListTableId |
Returns
Type | Description |
---|---|
TableInfo |
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(Int32, Boolean)
Utility class for lists helper methods.
Declaration
public static string GetTableName(int listTableId, bool getRealTable = false)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listTableId | |
Boolean | getRealTable |
Returns
Type | Description |
---|---|
String |
GetUDListDefinition(Int32)
Gets the UDListDefintion by primary key or by list table id.
Declaration
public static UDListDefinitionRow GetUDListDefinition(int udListDefinitionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | Positive ints are the primary key. Negative ints are list table id. |
Returns
Type | Description |
---|---|
UDListDefinitionRow | UDListDefinition that matches id from the database, if any. Returns NEW item if not found. |
GetUDListDefinitionFromName(String)
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 UDListDefinitionRow GetUDListDefinitionFromName(string udListName)
Parameters
Type | Name | Description |
---|---|---|
String | udListName | Name of list |
Returns
Type | Description |
---|---|
UDListDefinitionRow | UDListDefinition row for match, or NULL if not found. SoAmbiguousException if more than 1 match |
LoadAllListItems(Select, TableInfo)
Utility class for lists helper methods.
Declaration
public static List<ListsHelper.ItemRow> LoadAllListItems(Select query, TableInfo tableInfo)
Parameters
Type | Name | Description |
---|---|---|
Select | query | |
TableInfo | tableInfo |
Returns
Type | Description |
---|---|
List<ListsHelper.ItemRow> |
RefreshListRank(Int32)
Make unique ranks for all items in a list
Declaration
public static void RefreshListRank(int udListDefinitionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | Id to the UDListDefinition list |
RefreshListRank(String)
Make unique ranks for all items in a table
Declaration
public static void RefreshListRank(string tableName)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name |
SetHeadingRestrictions(Int32, Select, HeadingTableInfo)
Utility class for lists helper methods.
Declaration
public static void SetHeadingRestrictions(int udListDefinitionId, Select select, HeadingTableInfo headingTableInfo)
Parameters
Type | Name | Description |
---|---|---|
Int32 | udListDefinitionId | |
Select | select | |
HeadingTableInfo | headingTableInfo |
SetListItemsForHeading(Int32, String, Int32[], Boolean)
Utility class for lists helper methods.
Declaration
public static void SetListItemsForHeading(int headingId, string tablename, int[] listItemIds, bool enable)
Parameters
Type | Name | Description |
---|---|---|
Int32 | headingId | |
String | tablename | |
Int32[] | listItemIds | |
Boolean | enable |
SetListItemsForUserGroup(Int32, String, Int32[], Boolean)
Utility class for lists helper methods.
Declaration
public static void SetListItemsForUserGroup(int groupId, string tablename, int[] listItemIds, bool enable)
Parameters
Type | Name | Description |
---|---|---|
Int32 | groupId | |
String | tablename | |
Int32[] | listItemIds | |
Boolean | enable |
SetVisibleForUserGroup(Int32, String, Int32[], Boolean)
Utility class for lists helper methods.
Declaration
public static void SetVisibleForUserGroup(int listItemId, string tablename, int[] userGroupId, bool enable)
Parameters
Type | Name | Description |
---|---|---|
Int32 | listItemId | |
String | tablename | |
Int32[] | userGroupId | |
Boolean | enable |
UpdateListItemRank(TableInfo, Int32, Int32)
Utility class for lists helper methods.
Declaration
public static void UpdateListItemRank(TableInfo tableInfo, int primaryKey, int newRank)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | tableInfo | |
Int32 | primaryKey | |
Int32 | newRank |
UpdateRankOnListItems(TableInfo, List<ListsHelper.ItemRow>)
Utility class for lists helper methods.
Declaration
public static void UpdateRankOnListItems(TableInfo tableInfo, List<ListsHelper.ItemRow> items)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | tableInfo | |
List<ListsHelper.ItemRow> | items |