Add Method (UserName)
- Last UpdatedNov 06, 2025
- 3 minute read
The Add() method adds a new user name record to the User_Name table.
'Declaration
Public Shared Sub Add( _
ByVal sessionId As Integer, _
ByVal userId As String, _
ByVal userDesc As DBString, _
ByVal encryptPassword As String, _
ByVal active As Nullable(Of Boolean), _
ByVal hourlyCost As DBDouble, _
ByVal langId As Nullable(Of Integer), _
ByVal defaultDeptId As DBString, _
ByVal authMethod As Nullable(Of Integer), _
ByVal defaultLabCd As DBString, _
ByVal spare1 As DBString, _
ByVal spare2 As DBString, _
ByVal spare3 As DBString, _
ByVal spare4 As DBString, _
ByVal lastEditComment As DBString, _
ByRef modId As String, _
ByRef lastEditAt As Date _
)
'Usage
Dim sessionId As Integer
Dim userId As String
Dim userDesc As DBString
Dim encryptPassword As String
Dim active As Nullable(Of Boolean)
Dim hourlyCost As DBDouble
Dim langId As Nullable(Of Integer)
Dim defaultDeptId As DBString
Dim authMethod As Nullable(Of Integer)
Dim defaultLabCd As DBString
Dim spare1 As DBString
Dim spare2 As DBString
Dim spare3 As DBString
Dim spare4 As DBString
Dim lastEditComment As DBString
Dim modId As String
Dim lastEditAt As Date
UserName.Add(sessionId, userId, userDesc, encryptPassword, active, hourlyCost, langId, defaultDeptId, authMethod, defaultLabCd, spare1, spare2, spare3, spare4, lastEditComment, modId, lastEditAt)
public static void Add(
int sessionId,
string userId,
DBString userDesc,
string encryptPassword,
Nullable<bool> active,
DBDouble hourlyCost,
Nullable<int> langId,
DBString defaultDeptId,
Nullable<int> authMethod,
DBString defaultLabCd,
DBString spare1,
DBString spare2,
DBString spare3,
DBString spare4,
DBString lastEditComment,
out string modId,
out DateTime lastEditAt
)
Parameters
- sessionId
Required. Holds the session ID and thus the user who is making this method call.
- userId
Required. Holds the ID of the user. For example, the employee number or name of the employee.
- userDesc
Optional. Holds the description for the user. For example, the name of the employee.
- encryptPassword
Required. Holds the password of the user in the encrypted format.
- active
Optional. Holds a flag that, if set to true, specifies that the state of the user is active in the MES system.
- hourlyCost
- Optional. Holds the cost of the labour per hour.
- langId
- Optional. Holds the ID of the user's preferred language.
- defaultDeptId
- Optional. Holds the default department ID of the user.
- authMethod
- Optional. Holds the authentication method. The value 0 indicates "Internal" and 1 indicates "Windows (future)".
- defaultLabCd
- Optional. Holds the default labor code of the user.
- spare1
- Optional. Holds the contents of the user-defined spare1 field.
- spare2
- Optional. Holds the contents of the user-defined spare2 field.
- spare3
- Optional. Holds the contents of the user-defined spare3 field.
- spare4
- Optional. Holds the contents of the user-defined spare4 field.
- lastEditComment
- Optional. Holds comments that describe why this record is being added.
- modId
- Output. Holds the modification ID assigned to this record when it is added. The modId parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
- lastEditAt
- Output. Holds the returned date/time when this record was added, for optimistic concurrency control. The lastEditAt parameter is used by other methods that modify or delete this type of record for optimistic concurrency control.
Observe the following input parameter rules:
- Required non-DB* parameters: Must pass a value. Cannot be empty or null.
- Optional non-DB* parameters: Either enter a value or pass a null. If passing a null and a default value has been defined, the default value will be used for the parameter.
- Required DB* parameters: Must pass a value. To enter an empty value for the parameter, pass DB*.null (e.g., DBInt.null).
- Optional DB* parameters: To enter no value for the parameter, pass DB*.null (e.g., DBInt.null). To use the default value for the parameter if one has been defined for the object being added, pass a null.