Difference between revisions of "User class"

From Catglobe Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>newPassword</nowiki>|Description=<nowiki>The new password</nowiki>}}
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>newPassword</nowiki>|Description=<nowiki>The new password</nowiki>}}
 
|Description=<nowiki>Change the users password</nowiki>}}
 
|Description=<nowiki>Change the users password</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Clear</nowiki>|Inherited=array|Description=<nowiki>Remove all items in array</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Contains</nowiki>|Inherited=array|Parameters=
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Contains</nowiki>|Inherited=array|Parameters=
 
{{CGscriptParameters_Template|Type=object|Name=<nowiki>element</nowiki>|Description=<nowiki>Element to check for</nowiki>}}
 
{{CGscriptParameters_Template|Type=object|Name=<nowiki>element</nowiki>|Description=<nowiki>Element to check for</nowiki>}}
Line 22: Line 23:
 
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>selector</nowiki>|Description=<nowiki>A function to test each element for a condition.</nowiki>}}
 
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>selector</nowiki>|Description=<nowiki>A function to test each element for a condition.</nowiki>}}
 
|Description=<nowiki>Returns the first element in a sequence that satisfies a specified condition or empty if not found.</nowiki>}}
 
|Description=<nowiki>Returns the first element in a sequence that satisfies a specified condition or empty if not found.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Foreach</nowiki>|Inherited=array|Parameters=
 +
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>function</nowiki>|Description=<nowiki>A function that takes 1 parameter of the types in the array, and an optional 2nd parameter that is the index</nowiki>}}
 +
|Description=<nowiki>Filters a sequence of values based on a predicate.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>Frequency</nowiki>|Inherited=array|Parameters=
 
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>Frequency</nowiki>|Inherited=array|Parameters=
 
{{CGscriptParameters_Template|Type=number|Name=<nowiki>number</nowiki>|Description=<nowiki>The number to search for</nowiki>}}
 
{{CGscriptParameters_Template|Type=number|Name=<nowiki>number</nowiki>|Description=<nowiki>The number to search for</nowiki>}}
Line 30: Line 34:
 
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>IndexOf</nowiki>|Inherited=array|Parameters=
 
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>IndexOf</nowiki>|Inherited=array|Parameters=
 
{{CGscriptParameters_Template|Type=object|Name=<nowiki>element</nowiki>|Description=<nowiki>Element to search for</nowiki>}}
 
{{CGscriptParameters_Template|Type=object|Name=<nowiki>element</nowiki>|Description=<nowiki>Element to search for</nowiki>}}
|Description=<nowiki>Return index of the given element, or -1.</nowiki>}}
+
|Description=<nowiki>Return index of the given element using ==, or -1.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>IndexOfObject</nowiki>|Inherited=array|Parameters=
 +
{{CGscriptParameters_Template|Type=object|Name=<nowiki>element</nowiki>|Description=<nowiki>Element to search for</nowiki>}}
 +
|Description=<nowiki>Return index of the given element using references, or -1.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>IsCharacterArray</nowiki>|Inherited=array|Description=<nowiki>check if array is an array of characters</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>IsCharacterArray</nowiki>|Inherited=array|Description=<nowiki>check if array is an array of characters</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>IsNumericArray</nowiki>|Inherited=array|Description=<nowiki>check if array is an array of integer numbers</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>IsNumericArray</nowiki>|Inherited=array|Description=<nowiki>check if array is an array of integer numbers</nowiki>}}
Line 37: Line 44:
 
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>comparer</nowiki>|Description=<nowiki>Function that compares two objects of the same type. Must return a signed integer that indicates the relative values of first param A and second param B. Value Less than 0 : A is less than B.Value 0 : A equals B.Value Greater than 0 : A is greater than B.It can also be a function that takes 1 parameter and returns a string or number.</nowiki>}}
 
{{CGscriptParameters_Template|Type=Function|Name=<nowiki>comparer</nowiki>|Description=<nowiki>Function that compares two objects of the same type. Must return a signed integer that indicates the relative values of first param A and second param B. Value Less than 0 : A is less than B.Value 0 : A equals B.Value Greater than 0 : A is greater than B.It can also be a function that takes 1 parameter and returns a string or number.</nowiki>}}
 
|Description=<nowiki>Sorts the elements of a sequence in ascending order by using a specified comparer.</nowiki>}}
 
|Description=<nowiki>Sorts the elements of a sequence in ascending order by using a specified comparer.</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Randomize</nowiki>|Inherited=array|Description=<nowiki>Randomize the order of the elements in the current array.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Randomize</nowiki>|Inherited=array|Description=<nowiki>OBSOLETE! Randomize the order of the elements in the current array. Multiple calls to this may return the same randomization, use a Random object to preserve randomization over multiple calls</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Randomize</nowiki>|Inherited=array|Parameters=
 +
{{CGscriptParameters_Template|Type=Random|Name=<nowiki>random</nowiki>|Description=<nowiki>Random object</nowiki>}}
 +
|Description=<nowiki>Randomize the order of the elements in the current array.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>Reverse</nowiki>|Inherited=array|Description=<nowiki>Returns an array with all the elements in the opposite order.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=array|Name=<nowiki>Reverse</nowiki>|Inherited=array|Description=<nowiki>Returns an array with all the elements in the opposite order.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the user</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the user</nowiki>}}
Line 72: Line 82:
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CountryIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Iso code of the country of the address</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CountryIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Iso code of the country of the address</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CreatedByUserId</nowiki>|HasGetter=1|Description=<nowiki>Id of the user that created this user</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CreatedByUserId</nowiki>|HasGetter=1|Description=<nowiki>Id of the user that created this user</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>CreatedByUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Resource id of the user that created this user</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>CreatedDate</nowiki>|HasGetter=1|Description=<nowiki>Date of creation</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>CreatedDate</nowiki>|HasGetter=1|Description=<nowiki>Date of creation</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CultureIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Iso code of the culture of the user</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>CultureIsoCode</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Iso code of the culture of the user</nowiki>}}
Line 89: Line 100:
 
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Min</nowiki>|HasGetter=1|Inherited=array|Description=<nowiki>Smallest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>Min</nowiki>|HasGetter=1|Inherited=array|Description=<nowiki>Smallest of all the objects in the Array object. Can only use if all the elements are of type Number</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ModifiedByUserId</nowiki>|HasGetter=1|Description=<nowiki>Id of the user that modified this user</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ModifiedByUserId</nowiki>|HasGetter=1|Description=<nowiki>Id of the user that modified this user</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ModifiedByUserResourceId</nowiki>|HasGetter=1|Description=<nowiki>Resource id of the user that modified this user</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>ModifiedDate</nowiki>|HasGetter=1|Description=<nowiki>Date of last modification</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=DateTime|Name=<nowiki>ModifiedDate</nowiki>|HasGetter=1|Description=<nowiki>Date of last modification</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
Line 185: Line 197:
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>Number of points to add</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>description</nowiki>|Description=<nowiki>User visible log entry associated with the transaction</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>Resource Id of user that gets the points</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>Number of points to add</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>description</nowiki>|Description=<nowiki>User visible log entry associated with the transaction</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>Resource Id of user that gets the points</nowiki>}}
 
|Description=<nowiki>Add custom points to user.</nowiki>}}
 
|Description=<nowiki>Add custom points to user.</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>User_isMemberOfSampleRule</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=int|Name=<nowiki>userId</nowiki>|Description=<nowiki>id of user</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>sampleRuleId</nowiki>|Description=<nowiki>id of sample rule</nowiki>}}
 +
|Description=<nowiki>Returns whether a user is member of specified sample.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>User_isValidUsername</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>User_isValidUsername</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>username</nowiki>|Description=<nowiki>Username of user</nowiki>}}
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>username</nowiki>|Description=<nowiki>Username of user</nowiki>}}
Line 212: Line 227:
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>Number of points to remove</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>description</nowiki>|Description=<nowiki>User visible log entry associated with the transaction</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>Resource Id of user that gets the points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>customType</nowiki>|Description=<nowiki>Store custom transaction type. Can be 1-127, or 0 for ManualTransaction</nowiki>}}
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>points</nowiki>|Description=<nowiki>Number of points to remove</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>description</nowiki>|Description=<nowiki>User visible log entry associated with the transaction</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceId</nowiki>|Description=<nowiki>Resource Id of user that gets the points</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>customType</nowiki>|Description=<nowiki>Store custom transaction type. Can be 1-127, or 0 for ManualTransaction</nowiki>}}
 
|Description=<nowiki>Remove custom points from user. Returns 0 if count not withdraw the necessary amount.</nowiki>}}
 
|Description=<nowiki>Remove custom points from user. Returns 0 if count not withdraw the necessary amount.</nowiki>}}
|StaticMethods=
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>User_formatName</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=User|Name=<nowiki>user</nowiki>|Description=<nowiki>User to save</nowiki>}}
 
|Description=<nowiki>Generate full name ofuser</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=User|Name=<nowiki>User_new</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceTemplateId</nowiki>|Description=<nowiki>Resource Id of the template</nowiki>}}
 
|Description=<nowiki>Create a new user instance</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=User|Name=<nowiki>User_new</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceTemplateId</nowiki>|Description=<nowiki>Resource Id of the template</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>mask</nowiki>|Description=<nowiki>Mask to use to generate username</nowiki>}}
 
|Description=<nowiki>Create a new user instance</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=User|Name=<nowiki>User_new</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>username</nowiki>|Description=<nowiki>Username of new user</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>password</nowiki>|Description=<nowiki>Password of new user</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>userResourceTemplateId</nowiki>|Description=<nowiki>Resource Id of the template</nowiki>}}
 
|Description=<nowiki>Create a new user instance</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>User_save</nowiki>|Parameters=
 
{{CGscriptParameters_Template|Type=User|Name=<nowiki>user</nowiki>|Description=<nowiki>User to save</nowiki>}}
 
|Description=<nowiki>Save the user</nowiki>}}
 
 
}}
 
}}
=== <span style="color:#DF8621">'''Examples'''</span> ===
 
<source lang="javascript">
 
number userResourceTemplateRId = 1842;
 
User user = User_new (userResourceTemplateRId);
 
user.ParentResourceId = 5224516;
 
user.LanguageIsoCode = "da-DK";
 
user.CultureIsoCode = "da-DK";
 
user.Save();
 
print(user);//User class
 
</source>
 

Latest revision as of 10:25, 25 April 2022

User


A user

Parent class

Inherits from Array

Methods

  • (From array) bool Any(Function predicate "A function that takes 1 parameter of the types in the array, and return true/false") - Return true if the array contains the element using the given function.
  • Empty ChangePassword(string newPassword "The new password") - Change the users password
  • (From array) Empty Clear() - Remove all items in array
  • (From array) bool Contains(object element "Element to check for") - Return true if the array contains the element using the normal equal operator.
  • Empty DeleteUser() - Delete the user
  • (From array) array Except(array elements "Elements to remove") - Return all elements that does not exist in the other collection.
  • (From array) object First(Function selector "A function to test each element for a condition.") - Returns the first element in a sequence that satisfies a specified condition.
  • (From array) object FirstOrDefault(Function selector "A function to test each element for a condition.") - Returns the first element in a sequence that satisfies a specified condition or empty if not found.
  • (From array) Empty Foreach(Function function "A function that takes 1 parameter of the types in the array, and an optional 2nd parameter that is the index") - Filters a sequence of values based on a predicate.
  • (From array) int Frequency(number number "The number to search for") - Counts the number of times a given Number object exists in the Array. Can only use if all the elements are of type Number
  • object this[] { get; }(int index "Index") - Backward-compatible indexer
  • (From array) int IndexOf(object element "Element to search for") - Return index of the given element using ==, or -1.
  • (From array) int IndexOfObject(object element "Element to search for") - Return index of the given element using references, or -1.
  • (From array) bool IsCharacterArray() - check if array is an array of characters
  • (From array) bool IsNumericArray() - check if array is an array of integer numbers
  • (From array) bool IsStringArray() - check if array is an array of string
  • (From array) array OrderBy(Function comparer "Function that compares two objects of the same type. Must return a signed integer that indicates the relative values of first param A and second param B. Value Less than 0 : A is less than B.Value 0 : A equals B.Value Greater than 0 : A is greater than B.It can also be a function that takes 1 parameter and returns a string or number.") - Sorts the elements of a sequence in ascending order by using a specified comparer.
  • (From array) Empty Randomize() - OBSOLETE! Randomize the order of the elements in the current array. Multiple calls to this may return the same randomization, use a Random object to preserve randomization over multiple calls
  • (From array) Empty Randomize(Random random "Random object") - Randomize the order of the elements in the current array.
  • (From array) array Reverse() - Returns an array with all the elements in the opposite order.
  • Empty Save() - Save the user
  • (From array) array Select(Function selector "A transform function to apply to each element.") - Projects each element of a sequence into a new form.
  • (From array) array SelectMany(Function selector "A transform function to get each sub array.") - Projects each array element of a sequence into a new form.
  • Empty this[] { set; }(int index "Index", object value "Value to set") - Backward-compatible indexer
  • (From array) array Skip(int n "How many elements to skip") - Get all but the n first elements.
  • (From array) array Take(int n "How many elements to take") - Get the n first elements.
  • (From array) Dictionary ToDictionary(Function keySelector "A transform function to get the key of each element.") - Return a dictionary with the elements of the array.
  • (From array) Dictionary ToDictionary(Function keySelector "A transform function to get the key of each element.", Function valueSelector "A transform function to get the value of each element.") - Return a dictionary with the elements of the array.
  • (From Array) string ToString() - The string representation of the object.
  • (From array) array Where(Function predicate "A function that takes 1 parameter of the types in the array, and an optional 2nd parameter that is the index and return true/false") - Filters a sequence of values based on a predicate.

Properties

  • DateTime AccessExpiration { get; set; } - After this date the user can no longer login
  • (From array) number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
  • bool CalculatedManHours { get; set; } - True if it Man Hours is calculated. Set to true to recalculate.
  • string City { get; set; } - City of the address
  • string CountryIsoCode { get; set; } - Iso code of the country of the address
  • int CreatedByUserId { get; } - Id of the user that created this user
  • int CreatedByUserResourceId { get; } - Resource id of the user that created this user
  • DateTime CreatedDate { get; } - Date of creation
  • string CultureIsoCode { get; set; } - Iso code of the culture of the user
  • string CurrencyIsoName { get; set; } - Iso 4217 name of the currency of the user
  • bool Deleted { get; } - True if deleted
  • DateTime DeletedDate { get; } - Date of deletion
  • bool Disabled { get; set; } - True if user is disabled
  • DateTime DisabledDate { get; set; } - Date user was disabled
  • string DiscountName { get; set; } - Current applied discount in webshop
  • string Email { get; set; } - Email of the user
  • string FirstName { get; set; } - Firstname of the user
  • string LanguageIsoCode { get; set; } - Iso code of the language of the user
  • DateTime LastDateUpdatePassWord { get; set; } - Date the user last changed their password
  • string LastName { get; set; } - LastName of the user
  • (From array) number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
  • string MiddleName { get; set; } - MiddleName of the user
  • (From array) number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
  • int ModifiedByUserId { get; } - Id of the user that modified this user
  • int ModifiedByUserResourceId { get; } - Resource id of the user that modified this user
  • DateTime ModifiedDate { get; } - Date of last modification
  • string ObjectTypeName { get; } - The name of the type of object.
  • int ParentResourceId { get; set; } - Resource id of the parent
  • array PhoneNumbers { get; set; } - Get/set phonenumbers
  • int PointBalance { get; } - Currenct number of points available
  • string Postbox { get; set; } - Postbox of the address
  • int PrimaryKey { get; } - Id of the user
  • DateTime ProtectedUntilDate { get; set; } - Prior to this date the user can not be sampled
  • string Region { get; set; } - Region of the address
  • string ResourceGuid { get; } - Guid of the user
  • int ResourceId { get; } - Resource id of the user
  • int ResourceManHours { get; set; } - Man Hours of the user
  • string ResourceManHoursAsString { get; } - Formatted Man Hours as Hours:Min
  • int ResourceTemplateId { get; } - Id of the template
  • int ResourceTemplateResourceId { get; set; } - Resource Id of the template
  • string StreetAddress { get; set; } - Street of the address
  • (From array) number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
  • bool TimeRegEnabled { get; set; } - True if it is possible to register time for this resource
  • int TimezoneId { get; set; } - Id of the timezone of the user
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.
  • string Username { get; set; } - Login username of the user
  • string Website { get; set; } - Website of the address
  • string ZipCode { get; set; } - ZipCode of the address

Static Methods

  • Dictionary User_expirePoints(Array of int userResourceIds "Users to expire points for", DateTime fromDate "Expire points accumulated prior to this date", string description "User visible log entry associated with the transaction") - Test expire users points. Return dictionary of userResourceIds and number of points that would be expired
  • Dictionary User_expirePoints(Array of int userResourceIds "Users to expire points for", DateTime fromDate "Expire points accumulated prior to this date", string description "User visible log entry associated with the transaction", bool test "If true only return points that would be expired") - Expire users points. Return dictionary of userResourceIds and number of points expired
  • string User_formatName(User user "User to save") - Generate full name of user
  • string User_generateRandomNumericPassword() - Generate a new password with only digits
  • string User_generateRandomNumericPassword(int length "Length of generated password") - Generate a new password with only digits
  • string User_generateRandomPassword() - Generate a new password
  • string User_generateRandomPassword(int length "Length of generated password") - Generate a new password
  • User User_getCallingLoggedInUser() - Fetch current user filling out QAS on someone elses behalf
  • Array of Array User_getCommunicationHistory(int userResourceId "Reousrce id of user") - Get history of all attempts to communicate to a user.
  • User User_getCurrentUser() - Fetch current user. This will be impersonated user if set.
  • User User_getLoggedInUser() - Fetch current user before applying impersonation
  • int User_getPointsEarnedInPeriod(int userResourceId "Reousrce id of user", array fromDate "Date to calculate from", array toDate "Date to calculate to") - Get number of points earned in a period.
  • int User_getPointsUsedInPeriod(int userResourceId "Reousrce id of user", array fromDate "Date to calculate from", array toDate "Date to calculate to") - Get number of points used in a period.
  • User User_getQasUser() - Fetch user of the current QAS. May return Empty.
  • int User_getResourceIdFromUserId(int id "User id") - Map user id to user resource id
  • Array of int User_getResourceIdFromUserIds(Array of int ids "User ids") - Map user ids to user resource ids
  • int User_getRoleIdByName(string qualifiedName "Resource name of the resource template") - Get the resource template id of the resource template with the given name.
  • Array of Array User_getTransactionHistory(int userResourceId "Resource id of user") - Get history of all transactions for a user.
  • Array of Array User_getTransactionHistory(int userResourceId "Resource id of user", array fromDate "Date to calculate from", array toDate "Date to calculate to") - Get history of all transactions for a user in period.
  • User User_getUserByGuid(string guid "Guid of user") - Fetch existing user. Returns Empty if user doesnt exist
  • User User_getUserByResourceId(int resourceId "Resource id of user") - Fetch existing user. Returns Empty if user doesnt exist
  • User User_getUserByUsername(string username "Username of user") - Fetch existing user. Returns Empty if user doesnt exist
  • Array of User User_getUsersByEmail(string email "Email to search for") - Fetch existing users. Returns Empty if user doesnt exist
  • Array of User User_getUsersByEmail(int resourceTemplateResourceId "Limit users to this resource template", string email "Email to search for") - Fetch existing users. Returns Empty if user doesnt exist
  • Array of User User_getUsersByGroupResourceId(int groupResourceId "Resource id of group") - Fetch existing users.
  • Array of User User_getUsersByResourceIds(Array of int resourceIds "Resource ids of users") - Fetch existing users.
  • Empty User_insertPoints(int points "Number of points to add", string description "User visible log entry associated with the transaction") - Add points to user of current QAS.
  • Empty User_insertPoints(int points "Number of points to add", string description "User visible log entry associated with the transaction", int userResourceId "Resource Id of user that gets the points") - Add custom points to user.
  • bool User_isMemberOfSampleRule(int userId "id of user", int sampleRuleId "id of sample rule") - Returns whether a user is member of specified sample.
  • bool User_isValidUsername(string username "Username of user") - Return true if username is valid.
  • User User_new(int userResourceTemplateId "Resource Id of the template") - Create a new user instance
  • User User_new(int userResourceTemplateId "Resource Id of the template", string mask "Mask to use to generate username") - Create a new user instance
  • User User_new(string username "Username of new user", string password "Password of new user", int userResourceTemplateId "Resource Id of the template") - Create a new user instance
  • Empty User_save(User user "User to save") - Save the user
  • bool User_usernameExists(string username "Username of user") - Check if a username already exists.
  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction") - Remove points from user of current QAS. Returns 0 if count not withdraw the necessary amount.
  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction", int userResourceId "Resource Id of user that gets the points") - Remove custom points from user. Returns 0 if count not withdraw the necessary amount.
  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction", int userResourceId "Resource Id of user that gets the points", int customType "Store custom transaction type. Can be 1-127, or 0 for ManualTransaction") - Remove custom points from user. Returns 0 if count not withdraw the necessary amount.