This commit is contained in:
SchreiberM
2016-03-29 09:52:37 +02:00
parent 58788043c5
commit 49f2dc6f3f
18 changed files with 2619 additions and 815 deletions

View File

@@ -191,19 +191,24 @@
Public Class Label : Inherits _BaseControl
Public Shared Sub LoadValue(control As Windows.Forms.Label, recordId As Integer, parentRecordId As Integer, value As String)
Public Shared Sub LoadValue(control As Windows.Forms.Label, recordId As Integer, parentRecordId As Integer, value As String, Optional VARIABLE_VALUE As Boolean = False)
Try
Dim autoValue = LoadAutoValue(control, recordId, parentRecordId)
If IsNothing(autoValue) Then
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
Dim SQL = String.Format("SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0} AND SCREEN_ID = {1}", ControlId, CURRENT_SCREEN_ID)
Dim ctrl_screen_id = ClassDatabase.Execute_Scalar(SQL, True)
If ctrl_screen_id > 0 Then
SQL = String.Format("SELECT CAPTION FROM TBPMO_CONTROL_LANGUAGE WHERE CONTROL_SCREEN_ID = {0} AND LANGUAGE_TYPE = '{1}'", ctrl_screen_id, USER_LANGUAGE)
Dim labelText As String = ClassDatabase.Execute_Scalar(SQL)
control.Text = labelText
If VARIABLE_VALUE = True Then
control.Text = value
Else
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
Dim SQL = String.Format("SELECT GUID FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0} AND SCREEN_ID = {1}", ControlId, CURRENT_SCREEN_ID)
Dim ctrl_screen_id = ClassDatabase.Execute_Scalar(SQL, True)
If ctrl_screen_id > 0 Then
SQL = String.Format("SELECT CAPTION FROM TBPMO_CONTROL_LANGUAGE WHERE CONTROL_SCREEN_ID = {0} AND LANGUAGE_TYPE = '{1}'", ctrl_screen_id, USER_LANGUAGE)
Dim labelText As String = ClassDatabase.Execute_Scalar(SQL)
control.Text = labelText
End If
End If
Else
control.Text = autoValue
@@ -251,14 +256,17 @@
Public Class TextBox : Inherits _BaseControl
Public Shared Sub LoadValue(control As Windows.Forms.TextBox, recordId As Integer, parentRecordId As Integer, value As String)
Public Shared Sub LoadValue(control As Windows.Forms.TextBox, recordId As Integer, parentRecordId As Integer, value As String, Optional VARIABLE_VALUE As Boolean = False)
Try
Dim autoValue = LoadAutoValue(control, recordId, parentRecordId)
If IsNothing(autoValue) Then
If VARIABLE_VALUE = True Then
control.Text = value
Else
control.Text = autoValue
If IsNothing(autoValue) Then
control.Text = value
Else
control.Text = autoValue
End If
End If
Catch ex As Exception
MsgBox("Unexpected Error in LoadValue3:" & vbNewLine & ex.Message)