OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults Class Reference

Reads and saves User Defaults. More...

Static Public Member Functions

static bool HasDefault (String AKey, TDataBase ADataBase=null)
 Find out if a user default exists already. This is required where the default should be calculated otherwise (e.g. FINANCE_REPORTING_SHOWDIFFFINANCIALYEARSELECTION) More...
 
static bool GetBooleanDefault (String AKey, bool ADefault=true, TDataBase ADataBase=null)
 get boolean default More...
 
static System.Char GetCharDefault (String AKey, System.Char ADefault, TDataBase ADataBase=null)
 get char default More...
 
static System.Char GetCharDefault (String AKey)
 get char default More...
 
static double GetDoubleDefault (String AKey, double ADefault=0.0, TDataBase ADataBase=null)
 get double default value More...
 
static System.Int16 GetInt16Default (String AKey, System.Int16 ADefault=0, TDataBase ADataBase=null)
 get default int value More...
 
static System.Int32 GetInt32Default (String AKey, System.Int32 ADefault=0, TDataBase ADataBase=null)
 get int default More...
 
static System.Int64 GetInt64Default (String AKey, System.Int64 ADefault=0, TDataBase ADataBase=null)
 get int default More...
 
static String GetStringDefault (String AKey, String ADefault="", TDataBase ADataBase=null)
 get string default More...
 
static void GetUserDefaults (String AUserName, out SUserDefaultsTable AUserDefaultsDataTable)
 Reads the User Defaults for a certain user and returns them as a Typed DataTable. DB Table: s_user_defaults More...
 
static String GetUserDefault (String AKey, String ADefaultValue, TDataBase ADataBase=null)
 Gets the value of a UserDefault. More...
 
static Boolean LoadUserDefaultsTable (String AUserName, out SUserDefaultsTable AUserDefaultsDataTable, TDataBase ADataBase=null)
 Loads the UserDefaults DataTable from the DB. DB Table: s_user_defaults More...
 
static void SetDefault (String AKey, object AValue, Boolean ASendUpdateInfoToClient=true, TDataBase ADataBase=null)
 Sets a User Default. More...
 
static void UpdateUserDefaultsOnClient (String AUserName, String AChangedUserDefaultCode, String AChangedUserDefaultValue, String AChangedUserDefaultModId, Boolean ASingleCode=true)
 Update the User Defaults on the Client side (by means of sending a ClientTask). More...
 
static void UpdateUserDefaultsOnClient (String AUserName, SUserDefaultsTable AChangedUserDefaultsDT)
 Update the User Defaults on the Client side (by means of sending a ClientTask). More...
 

Static Public Attributes

const String FINANCE_DEFAULT_LEDGERNUMBER = "a_default_ledger_number_i"
 todoComment More...
 

Detailed Description

Reads and saves User Defaults.

Member Function Documentation

◆ GetBooleanDefault()

static bool Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetBooleanDefault ( String  AKey,
bool  ADefault = true,
TDataBase  ADataBase = null 
)
inlinestatic

get boolean default

Parameters
AKey
ADefault
ADataBasedatabase object
Returns
true if key does not exist

◆ GetCharDefault() [1/2]

static System.Char Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetCharDefault ( String  AKey)
inlinestatic

get char default

Parameters
AKey
Returns
space if key does not exist

◆ GetCharDefault() [2/2]

static System.Char Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetCharDefault ( String  AKey,
System.Char  ADefault,
TDataBase  ADataBase = null 
)
inlinestatic

get char default

Parameters
AKey
ADefault
ADataBasedatabase object
Returns

◆ GetDoubleDefault()

static double Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetDoubleDefault ( String  AKey,
double  ADefault = 0.0,
TDataBase  ADataBase = null 
)
inlinestatic

get double default value

Parameters
AKey
ADefault
ADataBasedatabase object
Returns
0.0 if key does not exist

◆ GetInt16Default()

static System.Int16 Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetInt16Default ( String  AKey,
System.Int16  ADefault = 0,
TDataBase  ADataBase = null 
)
inlinestatic

get default int value

Parameters
AKeyThe Key of the User Default that should get retrieved.
ADefaultThe value that should be returned in case the Key is not (yet) in the User Defaults.
ADataBasedatabase object
Returns
0 if key does not exist

◆ GetInt32Default()

static System.Int32 Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetInt32Default ( String  AKey,
System.Int32  ADefault = 0,
TDataBase  ADataBase = null 
)
inlinestatic

get int default

Parameters
AKey
ADefault
ADataBasedatabase object
Returns
0 if key does not exist

◆ GetInt64Default()

static System.Int64 Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetInt64Default ( String  AKey,
System.Int64  ADefault = 0,
TDataBase  ADataBase = null 
)
inlinestatic

get int default

Parameters
AKey
ADefault
ADataBasedatabase object
Returns
0 if key does not exist

◆ GetStringDefault()

static String Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetStringDefault ( String  AKey,
String  ADefault = "",
TDataBase  ADataBase = null 
)
inlinestatic

get string default

Parameters
AKey
ADefault
ADataBasedatabase object
Returns
empty string if key does not exist

◆ GetUserDefault()

static String Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetUserDefault ( String  AKey,
String  ADefaultValue,
TDataBase  ADataBase = null 
)
inlinestatic

Gets the value of a UserDefault.

Parameters
AKeyThe Key of the User Default that should get retrieved
ADefaultValueThe value that should be returned in case there is no value
ADataBasedatabase object
Returns
Value of the UserDefault, or the value specified in ADefaultValue if the UserDefault doesn't exist yet

◆ GetUserDefaults()

static void Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.GetUserDefaults ( String  AUserName,
out SUserDefaultsTable  AUserDefaultsDataTable 
)
inlinestatic

Reads the User Defaults for a certain user and returns them as a Typed DataTable. DB Table: s_user_defaults

Parameters
AUserNameUser name for which the User Defaults should be read.
AUserDefaultsDataTableTyped DataTable that contains the User Defaults.
Returns
void

◆ HasDefault()

static bool Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.HasDefault ( String  AKey,
TDataBase  ADataBase = null 
)
inlinestatic

Find out if a user default exists already. This is required where the default should be calculated otherwise (e.g. FINANCE_REPORTING_SHOWDIFFFINANCIALYEARSELECTION)

Returns
true if a default with the given key already exists

◆ LoadUserDefaultsTable()

static Boolean Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.LoadUserDefaultsTable ( String  AUserName,
out SUserDefaultsTable  AUserDefaultsDataTable,
TDataBase  ADataBase = null 
)
inlinestatic

Loads the UserDefaults DataTable from the DB. DB Table: s_user_defaults

Parameters
AUserNameUserID to load the UserDefaults for
AUserDefaultsDataTableThe loaded UserDefaults DataTable
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection
Returns
true if loading of UserDefaults was successful

◆ SetDefault()

static void Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.SetDefault ( String  AKey,
object  AValue,
Boolean  ASendUpdateInfoToClient = true,
TDataBase  ADataBase = null 
)
inlinestatic

Sets a User Default.

Parameters
AKeyThe Key of the User Default that should get saved.
AValueThe value that should be stored. Note: This can be anything on which ToString can be called.
ASendUpdateInfoToClientIf true, the PetraClient is informed about the change to the UserDefault (by means of sending a ClientTask)
ADataBaseAn instantiated TDataBase object, or null (default = null). If null gets passed then the Method executes DB commands with a new Database connection
Returns
void

◆ UpdateUserDefaultsOnClient() [1/2]

static void Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.UpdateUserDefaultsOnClient ( String  AUserName,
String  AChangedUserDefaultCode,
String  AChangedUserDefaultValue,
String  AChangedUserDefaultModId,
Boolean  ASingleCode = true 
)
inlinestatic

Update the User Defaults on the Client side (by means of sending a ClientTask).

Parameters
AUserNameUser name for which the User Defaults should be updated.
AChangedUserDefaultCodeDefaultCode(s) that has/have changed. Note: several DefaultCodes can be concatenated using the GCLIENTTASKPARAMETER_SEPARATOR constant!
AChangedUserDefaultValueDefaultValue(s) that has/have changed. Note: several DefaultValues can be concatenated using the GCLIENTTASKPARAMETER_SEPARATOR constant!
AChangedUserDefaultModIdModificationID(s) that has/have changed. Note: several ModificationIDs can be concatenated using the GCLIENTTASKPARAMETER_SEPARATOR constant!
ASingleCodeSet to true if the situation from which this function is called arose because a single DefaultCode has changed, or to false to indicate that the situation from which this function is called arose because (potentially) several DefaultCodes have changed.
Returns
void

◆ UpdateUserDefaultsOnClient() [2/2]

static void Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.UpdateUserDefaultsOnClient ( String  AUserName,
SUserDefaultsTable  AChangedUserDefaultsDT 
)
inlinestatic

Update the User Defaults on the Client side (by means of sending a ClientTask).

Parameters
AUserNameUser name for which the User Defaults should be updated.
AChangedUserDefaultsDTDataTable containing one ore more UserDefaults that have changed and that should be updated on the Client side
Returns
void

Member Data Documentation

◆ FINANCE_DEFAULT_LEDGERNUMBER

const String Ict.Petra.Server.MSysMan.Common.WebConnectors.TUserDefaults.FINANCE_DEFAULT_LEDGERNUMBER = "a_default_ledger_number_i"
static

todoComment


The documentation for this class was generated from the following file: