Class ListsHelper
Utility class for lists helper methods.
Assembly: SoDataBase.dll
Syntax
public static class ListsHelper
Methods
FindCreateListItem(String, String, Boolean, Boolean, ref Dictionary<String, Dictionary<String, MDOListTableCache.MDOCacheElement>>, String)
Declaration
public static int FindCreateListItem(string tableName, string value, bool add, bool fakeAdd, ref Dictionary<string, Dictionary<string, MDOListTableCache.MDOCacheElement>> cache, string culture)
Parameters
Returns
GetHeadingCustomSearch(Int32)
Declaration
public static HeadingRows.CustomSearch GetHeadingCustomSearch(int udListDefinitionId)
Parameters
Type |
Name |
Description |
Int32 |
udListDefinitionId |
|
Returns
GetLinkTableName(String)
Declaration
public static string GetLinkTableName(string listTableName)
Parameters
Type |
Name |
Description |
String |
listTableName |
|
Returns
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
|
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
|
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)
Declaration
public static TableInfo GetQueryFromListDefinition(int udListDefinitionId, Select select)
Parameters
Type |
Name |
Description |
Int32 |
udListDefinitionId |
|
Select |
select |
|
Returns
GetQueryFromListDefinition(Int32, Select, out Int32)
Declaration
public static TableInfo GetQueryFromListDefinition(int udListDefinitionId, Select select, out int retListTableId)
Parameters
Type |
Name |
Description |
Int32 |
udListDefinitionId |
|
Select |
select |
|
Int32 |
retListTableId |
|
Returns
GetQueryFromTableName(String, Select)
Declaration
public static TableInfo GetQueryFromTableName(string tableName, Select select)
Parameters
Returns
GetTableName(Int32, Boolean)
Declaration
public static string GetTableName(int listTableId, bool getRealTable = false)
Parameters
Type |
Name |
Description |
Int32 |
listTableId |
|
Boolean |
getRealTable |
|
Returns
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)
Declaration
public static List<ListsHelper.ItemRow> LoadAllListItems(Select query, TableInfo tableInfo)
Parameters
Returns
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)
Declaration
public static void SetHeadingRestrictions(int udListDefinitionId, Select select, HeadingTableInfo headingTableInfo)
Parameters
SetListItemsForHeading(Int32, String, Int32[], Boolean)
Declaration
public static void SetListItemsForHeading(int headingId, string tablename, int[] listItemIds, bool enable)
Parameters
SetListItemsForUserGroup(Int32, String, Int32[], Boolean)
Declaration
public static void SetListItemsForUserGroup(int groupId, string tablename, int[] listItemIds, bool enable)
Parameters
SetVisibleForUserGroup(Int32, String, Int32[], Boolean)
Declaration
public static void SetVisibleForUserGroup(int listItemId, string tablename, int[] userGroupId, bool enable)
Parameters
UpdateListItemRank(TableInfo, Int32, Int32)
Declaration
public static void UpdateListItemRank(TableInfo tableInfo, int primaryKey, int newRank)
Parameters
UpdateRankOnListItems(TableInfo, List<ListsHelper.ItemRow>)
Declaration
public static void UpdateRankOnListItems(TableInfo tableInfo, List<ListsHelper.ItemRow> items)
Parameters