Load table in mass validator

This commit is contained in:
Jonathan Jenne 2019-05-22 13:59:48 +02:00
parent 22e570c032
commit 7476639397
4 changed files with 244 additions and 196 deletions

View File

@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmMassValidator Partial Class frmMassValidator
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _ <System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try Try
If disposing AndAlso components IsNot Nothing Then If disposing AndAlso components IsNot Nothing Then
@ -20,17 +20,24 @@ Partial Class frmMassValidator
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich. 'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMassValidator)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMassValidator))
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip() Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip() Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.tslblCountDocs = New System.Windows.Forms.ToolStripStatusLabel() Me.tslblCountDocs = New System.Windows.Forms.ToolStripStatusLabel()
Me.TITLELabel1 = New System.Windows.Forms.Label() Me.TITLELabel1 = New System.Windows.Forms.Label()
Me.pnldesigner = New System.Windows.Forms.Panel() Me.pnldesigner = New System.Windows.Forms.Panel()
Me.DESCRIPTIONLabel = New System.Windows.Forms.Label()
Me.btnSave = New System.Windows.Forms.Button() Me.btnSave = New System.Windows.Forms.Button()
Me.DESCRIPTIONLabel = New System.Windows.Forms.Label()
Me.DD_DMSLiteDataSet = New DD_PM_WINDREAM.DD_DMSLiteDataSet()
Me.TBPM_CONTROL_TABLEBindingSource = New System.Windows.Forms.BindingSource(Me.components)
Me.TBPM_CONTROL_TABLETableAdapter = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TBPM_CONTROL_TABLETableAdapter()
Me.TableAdapterManager = New DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager()
Me.StatusStrip1.SuspendLayout() Me.StatusStrip1.SuspendLayout()
CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
'ToolStrip1 'ToolStrip1
@ -84,16 +91,6 @@ Partial Class frmMassValidator
Me.pnldesigner.Size = New System.Drawing.Size(559, 331) Me.pnldesigner.Size = New System.Drawing.Size(559, 331)
Me.pnldesigner.TabIndex = 21 Me.pnldesigner.TabIndex = 21
' '
'DESCRIPTIONLabel
'
Me.DESCRIPTIONLabel.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.DESCRIPTIONLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl
Me.DESCRIPTIONLabel.Location = New System.Drawing.Point(12, 54)
Me.DESCRIPTIONLabel.Name = "DESCRIPTIONLabel"
Me.DESCRIPTIONLabel.Size = New System.Drawing.Size(725, 67)
Me.DESCRIPTIONLabel.TabIndex = 20
Me.DESCRIPTIONLabel.Text = "Label3"
'
'btnSave 'btnSave
' '
Me.btnSave.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _ Me.btnSave.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
@ -110,6 +107,46 @@ Partial Class frmMassValidator
Me.btnSave.Text = "Alle Dokumente abschliessen" Me.btnSave.Text = "Alle Dokumente abschliessen"
Me.btnSave.UseVisualStyleBackColor = True Me.btnSave.UseVisualStyleBackColor = True
' '
'DESCRIPTIONLabel
'
Me.DESCRIPTIONLabel.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.DESCRIPTIONLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl
Me.DESCRIPTIONLabel.Location = New System.Drawing.Point(12, 54)
Me.DESCRIPTIONLabel.Name = "DESCRIPTIONLabel"
Me.DESCRIPTIONLabel.Size = New System.Drawing.Size(725, 67)
Me.DESCRIPTIONLabel.TabIndex = 20
Me.DESCRIPTIONLabel.Text = "Label3"
'
'DD_DMSLiteDataSet
'
Me.DD_DMSLiteDataSet.DataSetName = "DD_DMSLiteDataSet"
Me.DD_DMSLiteDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
'
'TBPM_CONTROL_TABLEBindingSource
'
Me.TBPM_CONTROL_TABLEBindingSource.DataMember = "TBPM_CONTROL_TABLE"
Me.TBPM_CONTROL_TABLEBindingSource.DataSource = Me.DD_DMSLiteDataSet
'
'TBPM_CONTROL_TABLETableAdapter
'
Me.TBPM_CONTROL_TABLETableAdapter.ClearBeforeFill = True
'
'TableAdapterManager
'
Me.TableAdapterManager.BackupDataSetBeforeUpdate = False
Me.TableAdapterManager.TBDD_CONNECTIONTableAdapter = Nothing
Me.TableAdapterManager.TBDD_USERTableAdapter = Nothing
Me.TableAdapterManager.TBPM_CONTROL_TABLETableAdapter = Me.TBPM_CONTROL_TABLETableAdapter
Me.TableAdapterManager.TBPM_ERROR_LOGTableAdapter = Nothing
Me.TableAdapterManager.TBPM_FILES_USER_NOT_INDEXEDTableAdapter = Nothing
Me.TableAdapterManager.TBPM_KONFIGURATIONTableAdapter = Nothing
Me.TableAdapterManager.TBPM_PROFILE_CONTROLSTableAdapter = Nothing
Me.TableAdapterManager.TBPM_PROFILE_FILESTableAdapter = Nothing
Me.TableAdapterManager.TBPM_PROFILE_FINAL_INDEXINGTableAdapter = Nothing
Me.TableAdapterManager.TBPM_PROFILETableAdapter = Nothing
Me.TableAdapterManager.TBPM_TYPETableAdapter = Nothing
Me.TableAdapterManager.UpdateOrder = DD_PM_WINDREAM.DD_DMSLiteDataSetTableAdapters.TableAdapterManager.UpdateOrderOption.InsertUpdateDelete
'
'frmMassValidator 'frmMassValidator
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -128,6 +165,8 @@ Partial Class frmMassValidator
Me.TopMost = True Me.TopMost = True
Me.StatusStrip1.ResumeLayout(False) Me.StatusStrip1.ResumeLayout(False)
Me.StatusStrip1.PerformLayout() Me.StatusStrip1.PerformLayout()
CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@ -137,7 +176,11 @@ Partial Class frmMassValidator
Friend WithEvents StatusStrip1 As StatusStrip Friend WithEvents StatusStrip1 As StatusStrip
Friend WithEvents TITLELabel1 As Label Friend WithEvents TITLELabel1 As Label
Friend WithEvents pnldesigner As Panel Friend WithEvents pnldesigner As Panel
Friend WithEvents DESCRIPTIONLabel As Label
Friend WithEvents btnSave As Button Friend WithEvents btnSave As Button
Friend WithEvents tslblCountDocs As ToolStripStatusLabel Friend WithEvents tslblCountDocs As ToolStripStatusLabel
Friend WithEvents DESCRIPTIONLabel As Label
Friend WithEvents DD_DMSLiteDataSet As DD_DMSLiteDataSet
Friend WithEvents TBPM_CONTROL_TABLEBindingSource As BindingSource
Friend WithEvents TBPM_CONTROL_TABLETableAdapter As DD_DMSLiteDataSetTableAdapters.TBPM_CONTROL_TABLETableAdapter
Friend WithEvents TableAdapterManager As DD_DMSLiteDataSetTableAdapters.TableAdapterManager
End Class End Class

View File

@ -123,6 +123,18 @@
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>124, 17</value> <value>124, 17</value>
</metadata> </metadata>
<metadata name="DD_DMSLiteDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>241, 17</value>
</metadata>
<metadata name="TBPM_CONTROL_TABLEBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>403, 17</value>
</metadata>
<metadata name="TBPM_CONTROL_TABLETableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>664, 17</value>
</metadata>
<metadata name="TableAdapterManager.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>919, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -54,7 +54,7 @@ Public Class frmMassValidator
Size = My.Settings.frmMassValidatorSize Size = My.Settings.frmMassValidatorSize
End If End If
Try Try
DT_PROFILE_CONTROLS = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE_CONTROLS WHERE CTRL_TYPE <> 'TABLE' AND SQL_UEBERPRUEFUNG NOT LIKE '%WMI%' AND PROFIL_ID = " & CURRENT_ProfilGUID) DT_PROFILE_CONTROLS = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE_CONTROLS WHERE SQL_UEBERPRUEFUNG NOT LIKE '%WMI%' AND PROFIL_ID = " & CURRENT_ProfilGUID)
LOGGER.Debug("Profile Data geladen") LOGGER.Debug("Profile Data geladen")
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -125,214 +125,209 @@ Public Class frmMassValidator
End Sub End Sub
Sub Load_Controls() Sub Load_Controls()
' Try 'Try
pnldesigner.Controls.Clear() pnldesigner.Controls.Clear()
'Dim dt As DataTable = DD_DMSLiteDataSet.VWPM_CONTROL_INDEX
For Each oControlRow As DataRow In DT_PROFILE_CONTROLS.Rows
Dim ctrl As Control
Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper
Case "TXT"
LOGGER.Debug("Versuch TXT zu laden")
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(oControlRow, False)
For Each dr As DataRow In DT_PROFILE_CONTROLS.Rows AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
Dim ctrl As Control AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
Select Case dr.Item("CTRL_TYPE").ToString.ToUpper ctrl = txt
Case "TXT" Case "LBL"
LOGGER.Debug("Versuch TXT zu laden") LOGGER.Debug("Versuch LBL zu laden")
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False) ctrl = ClassControlCreator.CreateExistingLabel(oControlRow, False)
Case "CMB"
LOGGER.Debug("Versuch CMB zu laden")
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus Dim cmb = ClassControlCreator.CreateExistingCombobox(oControlRow, False)
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
ctrl = txt AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
Case "LBL"
LOGGER.Debug("Versuch LBL zu laden")
ctrl = ClassControlCreator.CreateExistingLabel(dr, False)
Case "CMB"
LOGGER.Debug("Versuch CMB zu laden")
Dim cmb = ClassControlCreator.CreateExistingCombobox(dr, False)
AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
#Region "CONTROL LIST" #Region "CONTROL LIST"
If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
Dim CURR_SQL_PROVIDER As String Dim CURR_SQL_PROVIDER As String
If CURRENT_CONTROL_ID > 0 Then If CURRENT_CONTROL_ID > 0 Then
If CURR_CON_ID > 0 Then If CURR_CON_ID > 0 Then
Dim commandsql = CURR_SELECT_CONTROL Dim commandsql = CURR_SELECT_CONTROL
If commandsql <> "" Then If commandsql <> "" Then
LOGGER.Debug("ConID > 0 And commandsql <> ''") LOGGER.Debug("ConID > 0 And commandsql <> ''")
Dim connectionString As String Dim connectionString As String
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID) Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
If ConRow Is Nothing Then If ConRow Is Nothing Then
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
For Each row As DataRow In ConRow For Each row As DataRow In ConRow
Select Case row("SQL_PROVIDER").ToString.ToLower Select Case row("SQL_PROVIDER").ToString.ToLower
Case "ms-sql" Case "ms-sql"
CURR_SQL_PROVIDER = "ms-sql" CURR_SQL_PROVIDER = "ms-sql"
If row("USERNAME") = "WINAUTH" Then If row("USERNAME") = "WINAUTH" Then
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;" connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;"
Else Else
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";" connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
End If
LOGGER.Debug("ConnString Sql-Server: " & connectionString)
Case "oracle"
CURR_SQL_PROVIDER = "oracle"
Dim conn As New OracleConnectionStringBuilder
Dim connstr As String
If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
row("DATENBANK") & ")));User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
Else
conn.DataSource = row("SERVER")
conn.UserID = row("USERNAME")
conn.Password = row("PASSWORD")
conn.PersistSecurityInfo = True
conn.ConnectionTimeout = 120
connstr = conn.ConnectionString
End If
connectionString = connstr
Case Else
LOGGER.Info("ConnectionString-Type not integrated")
MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical)
Exit Sub
End Select
Next
If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then
Try
Dim sqlCnn As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim NewDataset As New DataSet
Dim i As Integer
'sql = ClassPatterns.ReplaceAllValues(sql, pnldesigner, aktivesDokument)
If clsPatterns.HasOnlySimplePatterns(CURR_SELECT_CONTROL) Then
CURR_SELECT_CONTROL = clsPatterns.ReplaceInternalValues(CURR_SELECT_CONTROL)
CURR_SELECT_CONTROL = clsPatterns.ReplaceControlValues(CURR_SELECT_CONTROL, pnldesigner)
sqlCnn = New SqlClient.SqlConnection(connectionString)
' Try
sqlCnn.Open()
sqlCmd = New SqlClient.SqlCommand(CURR_SELECT_CONTROL, sqlCnn)
adapter.SelectCommand = sqlCmd
adapter.Fill(NewDataset)
For i = 0 To NewDataset.Tables(0).Rows.Count - 1
cmb.Items.Add(NewDataset.Tables(0).Rows(i).Item(0))
Next
adapter.Dispose()
sqlCmd.Dispose()
sqlCnn.Close()
End If End If
LOGGER.Debug("ConnString Sql-Server: " & connectionString) Catch ex As Exception
Case "oracle" LOGGER.Error(ex)
CURR_SQL_PROVIDER = "oracle" LOGGER.Info("Unexpected Error in running depending sql-command: " & ex.Message)
Dim conn As New OracleConnectionStringBuilder Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & CURR_SELECT_CONTROL)
Dim connstr As String MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected Error in running depending sql-command:")
If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then End Try
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & End If
row("DATENBANK") & ")));User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";" Else
Else LOGGER.Debug("Else Row 571")
conn.DataSource = row("SERVER")
conn.UserID = row("USERNAME")
conn.Password = row("PASSWORD")
conn.PersistSecurityInfo = True
conn.ConnectionTimeout = 120
connstr = conn.ConnectionString
End If
connectionString = connstr
Case Else
LOGGER.Info("ConnectionString-Type not integrated")
MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical)
Exit Sub
End Select
Next
If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then
Try
Dim sqlCnn As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim NewDataset As New DataSet
Dim i As Integer
'sql = ClassPatterns.ReplaceAllValues(sql, pnldesigner, aktivesDokument)
If clsPatterns.HasOnlySimplePatterns(CURR_SELECT_CONTROL) Then
CURR_SELECT_CONTROL = clsPatterns.ReplaceInternalValues(CURR_SELECT_CONTROL)
CURR_SELECT_CONTROL = clsPatterns.ReplaceControlValues(CURR_SELECT_CONTROL, pnldesigner)
sqlCnn = New SqlClient.SqlConnection(connectionString)
' Try
sqlCnn.Open()
sqlCmd = New SqlClient.SqlCommand(CURR_SELECT_CONTROL, sqlCnn)
adapter.SelectCommand = sqlCmd
adapter.Fill(NewDataset)
For i = 0 To NewDataset.Tables(0).Rows.Count - 1
cmb.Items.Add(NewDataset.Tables(0).Rows(i).Item(0))
Next
adapter.Dispose()
sqlCmd.Dispose()
sqlCnn.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in running depending sql-command: " & ex.Message)
Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & CURR_SELECT_CONTROL)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected Error in running depending sql-command:")
End Try
End If End If
Else Else
LOGGER.Debug("Else Row 571") If CURR_CHOICE_LIST <> "" Then
End If LOGGER.Debug("In add_ComboBox - AListe: " & CURR_CHOICE_LIST)
Else Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST)
If CURR_CHOICE_LIST <> "" Then If liste IsNot Nothing Then
LOGGER.Debug("In add_ComboBox - AListe: " & CURR_CHOICE_LIST) cmb.Items.Add("")
Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST) For Each index As String In liste
If liste IsNot Nothing Then cmb.Items.Add(index)
cmb.Items.Add("") Next
For Each index As String In liste cmb.SelectedIndex = -1
cmb.Items.Add(index) Else
Next MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
cmb.SelectedIndex = -1 End If
Else
MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
End If End If
End If End If
End If End If
End If
#End Region #End Region
Dim maxWith As Integer = cmb.Width Dim maxWith As Integer = cmb.Width
Using g As Graphics = Me.CreateGraphics Using g As Graphics = Me.CreateGraphics
For Each oItem As Object In cmb.Items 'Für alle Einträge... For Each oItem As Object In cmb.Items 'Für alle Einträge...
Dim g1 As Graphics = cmb.CreateGraphics Dim g1 As Graphics = cmb.CreateGraphics
If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then
maxWith = g1.MeasureString(Text, cmb.Font).Width + 30 maxWith = g1.MeasureString(Text, cmb.Font).Width + 30
End If End If
g1.Dispose() g1.Dispose()
Next oItem Next oItem
End Using End Using
cmb.DropDownWidth = maxWith cmb.DropDownWidth = maxWith
ctrl = cmb ctrl = cmb
Case "DTP" Case "DTP"
LOGGER.Debug("Versuch DTP zu laden") LOGGER.Debug("Versuch DTP zu laden")
ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False) ctrl = ClassControlCreator.CreateExistingDatepicker(oControlRow, False)
Case "DGV" Case "DGV"
LOGGER.Debug("Versuch DGV zu laden") LOGGER.Debug("Versuch DGV zu laden")
Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False) Dim dgv = ClassControlCreator.CreateExistingDataGridView(oControlRow, False)
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
ctrl = dgv ctrl = dgv
Case "CHK" Case "CHK"
LOGGER.Debug("Versuch Checkbox zu laden") LOGGER.Debug("Versuch Checkbox zu laden")
ctrl = ClassControlCreator.CreateExisingCheckbox(dr, False)
'Case "TABLE"
' If LogErrorsOnly = False Then LOGGER.Info(" >> Versuch Tabelle zu laden")
' For Each c As DataColumn In DT_PROFILE_CONTROLS.Columns
' '... = c.ColumnName
' Next
' Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DT_PROFILE_CONTROLS
' Where r.CONTROL_ID = dr.Item("GUID")
' Select r).ToList()
' ctrl = ClassControlCreator.CreateExistingTable(dr, columns)
ctrl = ClassControlCreator.CreateExisingCheckbox(oControlRow, False)
Case "LINE" Case "LINE"
LOGGER.Debug("Versuch Linie zu laden") LOGGER.Debug("Versuch Linie zu laden")
ctrl = ClassControlCreator.CreateExistingLine(dr, False) ctrl = ClassControlCreator.CreateExistingLine(oControlRow, False)
Case "LOOKUP" Case "LOOKUP"
ctrl = ClassControlCreator.CreateExistingLookupControl(dr, False) ctrl = ClassControlCreator.CreateExistingLookupControl(oControlRow, False)
End Select Case "TABLE"
LOGGER.Debug("Versuch Tabelle zu laden")
If TypeOf ctrl IsNot Label Then TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING
' If first_control Is Nothing Then TBPM_CONTROL_TABLETableAdapter.Fill(DD_DMSLiteDataSet.TBPM_CONTROL_TABLE, oControlRow.Item("GUID"))
'first_control = ctrl
'End If
'last_control = ctrl
End If
pnldesigner.Controls.Add(ctrl) Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DD_DMSLiteDataSet.TBPM_CONTROL_TABLE
Where r.CONTROL_ID = oControlRow.Item("GUID")
Select r).ToList()
ctrl = ClassControlCreator.CreateExistingTable(oControlRow, columns, False)
End Select
If TypeOf ctrl IsNot Label Then
' If first_control Is Nothing Then
'first_control = ctrl
'End If
'last_control = ctrl
End If
pnldesigner.Controls.Add(ctrl)
Next Next
LOGGER.Debug("Controls geladen") LOGGER.Debug("Controls geladen")
LOGGER.Info("") LOGGER.Info("")
CTRLS_Loaded = True CTRLS_Loaded = True
FillIndexValues() FillIndexValues()
For Each oControl As Control In pnldesigner.Controls For Each oControl As Control In pnldesigner.Controls
LoadSimpleData(oControl, oControl.Tag) LoadSimpleData(oControl, oControl.Tag)
Next Next
'Catch ex As Exception 'Catch ex As Exception
' If LogErrorsOnly = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:") ' If LogErrorsOnly = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:")
' ' allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName) ' allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName)
' LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message) ' LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message)
' LOGGER.Info("") ' LOGGER.Info("")
@ -1692,5 +1687,4 @@ Public Class frmMassValidator
' KillU_Viewer() ' KillU_Viewer()
'End If 'End If
End Sub End Sub
End Class End Class

View File

@ -800,7 +800,6 @@ Public Class frmValidator
Select r).ToList() Select r).ToList()
ctrl = ClassControlCreator.CreateExistingTable(oControlRow, columns, False) ctrl = ClassControlCreator.CreateExistingTable(oControlRow, columns, False)
'add_TABLE(dr.Item("GUID"), dr.Item("CTRL_NAME"), CInt(dr.Item("X_LOC")), CInt(dr.Item("Y_LOC")), dr.Item("WIDTH"), CInt(dr.Item("HEIGHT")), dr.Item("READ_ONLY"))
Case "LINE" Case "LINE"
LOGGER.Debug("Versuch Linie zu laden") LOGGER.Debug("Versuch Linie zu laden")