MS_07122015

This commit is contained in:
SchreiberM
2015-12-08 11:12:10 +01:00
parent 161f8c9c2e
commit 6b33117590
14 changed files with 821 additions and 522 deletions

View File

@@ -73,15 +73,42 @@ Public Class ClassControlValues
Dim radio As RadioButton = DirectCast(control, RadioButton)
radio.Checked = CBool(result)
Case 3 ' ComboBox
Dim combobox As ComboBox = DirectCast(control, ComboBox)
'combobox.DataSource = Nothing
'combobox.Text = result
If combobox.SelectedIndex = -1 Then
combobox.DataSource = Nothing
combobox.Text = result
Else
combobox.SelectedIndex = combobox.FindStringExact(result)
End If
Dim cmbbox As ComboBox = DirectCast(control, System.Windows.Forms.ComboBox)
cmbbox.Text = result
'If LogErrorsOnly = False Then ClassLogger.Add(">> control ComboBox", False)
'Dim cmbSql As String = "SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = " & ControlID
'cmbSql = ClassDatabase.Execute_Scalar(cmbSql)
'If Not (cmbSql Is Nothing Or cmbSql = String.Empty) Then
' If cmbSql.ToString.Contains("@") Then
' cmbSql = cmbSql.ToString.Replace("@RECORDID", CURRENT_RECORD_ID)
' cmbSql = cmbSql.ToString.Replace("@RECORD_ID", CURRENT_RECORD_ID)
' cmbSql = cmbSql.ToString.Replace("@PARENTRECORD_ID", CURRENT_PARENTID)
' If LogErrorsOnly = False Then ClassLogger.Add(">> SQL Combobox: " & cmbSql, False)
' End If
' If LogErrorsOnly = False Then ClassLogger.Add(">> SQL Combobox: " & cmbSql, False)
' 'SQL-Command vorhanden also Ausführen des SQL
' Dim DT_ComboBox As DataTable = ClassDatabase.Return_Datatable(cmbSql, "LoadControlValues: Combobox")
' If DT_ComboBox Is Nothing = False Then
' cmbbox.DataSource = DT_ComboBox
' Select Case DT_ComboBox.Columns.Count
' Case 2
' cmbbox.DisplayMember = DT_ComboBox.Columns(1).ColumnName
' cmbbox.ValueMember = DT_ComboBox.Columns(0).ColumnName
' Case 1
' cmbbox.DisplayMember = DT_ComboBox.Columns(0).ColumnName
' cmbbox.ValueMember = DT_ComboBox.Columns(0).ColumnName
' End Select
' End If
'End If
''combobox.DataSource = Nothing
'If cmbbox.SelectedIndex = -1 Then
' cmbbox.DataSource = Nothing
' cmbbox.Text = result
'Else
' cmbbox.SelectedIndex = cmbbox.FindStringExact(result)
'End If
Case 4 'DateTimePicker
Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
@@ -122,7 +149,9 @@ Public Class ClassControlValues
End If
If LogErrorsOnly = False Then ClassLogger.Add(">> CONTROL_ID:" & CONTROL_ID, False)
ClearControlValue(control)
If TypeOf control Is ComboBox Then
LoadControlValues(RecordID, FormID, DirectCast(control, ComboBox).Controls)
End If
If TypeOf control Is GroupBox Then
LoadControlValues(RecordID, FormID, DirectCast(control, GroupBox).Controls)
End If
@@ -130,7 +159,6 @@ Public Class ClassControlValues
If TypeOf control Is PictureBox Then
LoadImage(RecordID, CONTROL_ID, control)
End If
'EINE CheckedListBoxControl
If TypeOf control Is DevExpress.XtraEditors.CheckedListBoxControl Then
If LogErrorsOnly = False Then ClassLogger.Add(">> control DevExpress.XtraEditors.CheckedListBoxControl", False)
@@ -160,7 +188,7 @@ Public Class ClassControlValues
End If
End If
ElseIf (chklbSql = String.Empty) Then
' Wenn keine SQL Command ein leerer String ist,
' lade das Control ohne Datenbank, da es wahrscheinlich eine Static List ist
@@ -259,16 +287,23 @@ Public Class ClassControlValues
Dim SQL As String = String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE FORM_ID = {0} AND NAME = '{1}'", CURRENT_FORM_ID, C.Name)
Dim SQL2 As String = ClassDatabase.Execute_Scalar(SQL)
If SQL2 = "" Then
Exit Sub
End If
If SQL2.ToString.ToUpper.Contains("@") Then
SQL2 = SQL2.ToString.Replace("@RECORDID", CURRENT_RECORD_ID)
SQL2 = SQL2.ToString.Replace("@RECORD_ID", CURRENT_RECORD_ID)
SQL2 = SQL2.ToString.Replace("@PARENTRECORD_ID", CURRENT_PARENTID)
' If LogErrorsOnly = False Then ClassLogger.Add(">> SQL Combobox: " & cmbSql, False)
End If
Dim DT_Combobox As DataTable = ClassDatabase.Return_Datatable(SQL2)
If DT_Combobox Is Nothing = False Then
If DT_Combobox.Rows.Count > 0 Then
Combobox.DataSource = DT_Combobox
Combobox.DisplayMember = DT_Combobox.Columns(1).ColumnName
Combobox.ValueMember = DT_Combobox.Columns(0).ColumnName
Combobox.AutoCompleteMode = AutoCompleteMode.Suggest
Combobox.AutoCompleteMode = AutoCompleteMode.Append
Combobox.AutoCompleteSource = AutoCompleteSource.ListItems
End If
Dim iWidestWidth As Integer = 300