Load table in mass validator
This commit is contained in:
parent
22e570c032
commit
7476639397
73
app/DD_PM_WINDREAM/frmMassValidator.Designer.vb
generated
73
app/DD_PM_WINDREAM/frmMassValidator.Designer.vb
generated
@ -1,9 +1,9 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class frmMassValidator
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'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)
|
||||
Try
|
||||
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.
|
||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMassValidator))
|
||||
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
|
||||
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
|
||||
Me.tslblCountDocs = New System.Windows.Forms.ToolStripStatusLabel()
|
||||
Me.TITLELabel1 = New System.Windows.Forms.Label()
|
||||
Me.pnldesigner = New System.Windows.Forms.Panel()
|
||||
Me.DESCRIPTIONLabel = New System.Windows.Forms.Label()
|
||||
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()
|
||||
CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'ToolStrip1
|
||||
@ -84,16 +91,6 @@ Partial Class frmMassValidator
|
||||
Me.pnldesigner.Size = New System.Drawing.Size(559, 331)
|
||||
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
|
||||
'
|
||||
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.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
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@ -128,6 +165,8 @@ Partial Class frmMassValidator
|
||||
Me.TopMost = True
|
||||
Me.StatusStrip1.ResumeLayout(False)
|
||||
Me.StatusStrip1.PerformLayout()
|
||||
CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.TBPM_CONTROL_TABLEBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@ -137,7 +176,11 @@ Partial Class frmMassValidator
|
||||
Friend WithEvents StatusStrip1 As StatusStrip
|
||||
Friend WithEvents TITLELabel1 As Label
|
||||
Friend WithEvents pnldesigner As Panel
|
||||
Friend WithEvents DESCRIPTIONLabel As Label
|
||||
Friend WithEvents btnSave As Button
|
||||
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
|
||||
|
||||
@ -123,6 +123,18 @@
|
||||
<metadata name="StatusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>124, 17</value>
|
||||
</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" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
@ -54,7 +54,7 @@ Public Class frmMassValidator
|
||||
Size = My.Settings.frmMassValidatorSize
|
||||
End If
|
||||
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")
|
||||
Catch ex As Exception
|
||||
LOGGER.Error(ex)
|
||||
@ -125,214 +125,209 @@ Public Class frmMassValidator
|
||||
|
||||
End Sub
|
||||
Sub Load_Controls()
|
||||
' Try
|
||||
'Try
|
||||
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
|
||||
Dim ctrl As Control
|
||||
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
|
||||
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
|
||||
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
|
||||
|
||||
Select Case dr.Item("CTRL_TYPE").ToString.ToUpper
|
||||
Case "TXT"
|
||||
LOGGER.Debug("Versuch TXT zu laden")
|
||||
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False)
|
||||
ctrl = txt
|
||||
Case "LBL"
|
||||
LOGGER.Debug("Versuch LBL zu laden")
|
||||
ctrl = ClassControlCreator.CreateExistingLabel(oControlRow, False)
|
||||
Case "CMB"
|
||||
LOGGER.Debug("Versuch CMB zu laden")
|
||||
|
||||
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
|
||||
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
|
||||
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
|
||||
Dim cmb = ClassControlCreator.CreateExistingCombobox(oControlRow, False)
|
||||
|
||||
ctrl = txt
|
||||
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
|
||||
AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
|
||||
#Region "CONTROL LIST"
|
||||
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)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim CURR_SQL_PROVIDER As String
|
||||
If CURRENT_CONTROL_ID > 0 Then
|
||||
If CURR_CON_ID > 0 Then
|
||||
Dim commandsql = CURR_SELECT_CONTROL
|
||||
If commandsql <> "" Then
|
||||
LOGGER.Debug("ConID > 0 And commandsql <> ''")
|
||||
Dim connectionString As String
|
||||
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)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim CURR_SQL_PROVIDER As String
|
||||
If CURRENT_CONTROL_ID > 0 Then
|
||||
If CURR_CON_ID > 0 Then
|
||||
Dim commandsql = CURR_SELECT_CONTROL
|
||||
If commandsql <> "" Then
|
||||
LOGGER.Debug("ConID > 0 And commandsql <> ''")
|
||||
Dim connectionString As String
|
||||
|
||||
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
|
||||
If ConRow Is Nothing Then
|
||||
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End If
|
||||
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
|
||||
If ConRow Is Nothing Then
|
||||
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each row As DataRow In ConRow
|
||||
Select Case row("SQL_PROVIDER").ToString.ToLower
|
||||
Case "ms-sql"
|
||||
CURR_SQL_PROVIDER = "ms-sql"
|
||||
If row("USERNAME") = "WINAUTH" Then
|
||||
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;"
|
||||
Else
|
||||
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
|
||||
For Each row As DataRow In ConRow
|
||||
Select Case row("SQL_PROVIDER").ToString.ToLower
|
||||
Case "ms-sql"
|
||||
CURR_SQL_PROVIDER = "ms-sql"
|
||||
If row("USERNAME") = "WINAUTH" Then
|
||||
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;"
|
||||
Else
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
Else
|
||||
LOGGER.Debug("Else Row 571")
|
||||
End If
|
||||
Else
|
||||
LOGGER.Debug("Else Row 571")
|
||||
End If
|
||||
Else
|
||||
If CURR_CHOICE_LIST <> "" Then
|
||||
LOGGER.Debug("In add_ComboBox - AListe: " & CURR_CHOICE_LIST)
|
||||
Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST)
|
||||
If liste IsNot Nothing Then
|
||||
cmb.Items.Add("")
|
||||
For Each index As String In liste
|
||||
cmb.Items.Add(index)
|
||||
Next
|
||||
cmb.SelectedIndex = -1
|
||||
Else
|
||||
MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
|
||||
If CURR_CHOICE_LIST <> "" Then
|
||||
LOGGER.Debug("In add_ComboBox - AListe: " & CURR_CHOICE_LIST)
|
||||
Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST)
|
||||
If liste IsNot Nothing Then
|
||||
cmb.Items.Add("")
|
||||
For Each index As String In liste
|
||||
cmb.Items.Add(index)
|
||||
Next
|
||||
cmb.SelectedIndex = -1
|
||||
Else
|
||||
MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
#End Region
|
||||
|
||||
Dim maxWith As Integer = cmb.Width
|
||||
Using g As Graphics = Me.CreateGraphics
|
||||
For Each oItem As Object In cmb.Items 'Für alle Einträge...
|
||||
Dim g1 As Graphics = cmb.CreateGraphics
|
||||
If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then
|
||||
maxWith = g1.MeasureString(Text, cmb.Font).Width + 30
|
||||
End If
|
||||
g1.Dispose()
|
||||
Next oItem
|
||||
End Using
|
||||
cmb.DropDownWidth = maxWith
|
||||
Dim maxWith As Integer = cmb.Width
|
||||
Using g As Graphics = Me.CreateGraphics
|
||||
For Each oItem As Object In cmb.Items 'Für alle Einträge...
|
||||
Dim g1 As Graphics = cmb.CreateGraphics
|
||||
If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then
|
||||
maxWith = g1.MeasureString(Text, cmb.Font).Width + 30
|
||||
End If
|
||||
g1.Dispose()
|
||||
Next oItem
|
||||
End Using
|
||||
cmb.DropDownWidth = maxWith
|
||||
|
||||
ctrl = cmb
|
||||
Case "DTP"
|
||||
LOGGER.Debug("Versuch DTP zu laden")
|
||||
ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False)
|
||||
Case "DGV"
|
||||
LOGGER.Debug("Versuch DGV zu laden")
|
||||
Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False)
|
||||
ctrl = cmb
|
||||
Case "DTP"
|
||||
LOGGER.Debug("Versuch DTP zu laden")
|
||||
ctrl = ClassControlCreator.CreateExistingDatepicker(oControlRow, False)
|
||||
Case "DGV"
|
||||
LOGGER.Debug("Versuch DGV zu laden")
|
||||
Dim dgv = ClassControlCreator.CreateExistingDataGridView(oControlRow, False)
|
||||
|
||||
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
|
||||
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
|
||||
|
||||
ctrl = dgv
|
||||
Case "CHK"
|
||||
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 = dgv
|
||||
Case "CHK"
|
||||
LOGGER.Debug("Versuch Checkbox zu laden")
|
||||
|
||||
ctrl = ClassControlCreator.CreateExisingCheckbox(oControlRow, False)
|
||||
Case "LINE"
|
||||
LOGGER.Debug("Versuch Linie zu laden")
|
||||
LOGGER.Debug("Versuch Linie zu laden")
|
||||
|
||||
ctrl = ClassControlCreator.CreateExistingLine(dr, False)
|
||||
Case "LOOKUP"
|
||||
ctrl = ClassControlCreator.CreateExistingLookupControl(dr, False)
|
||||
End Select
|
||||
ctrl = ClassControlCreator.CreateExistingLine(oControlRow, False)
|
||||
Case "LOOKUP"
|
||||
ctrl = ClassControlCreator.CreateExistingLookupControl(oControlRow, False)
|
||||
Case "TABLE"
|
||||
LOGGER.Debug("Versuch Tabelle zu laden")
|
||||
|
||||
If TypeOf ctrl IsNot Label Then
|
||||
' If first_control Is Nothing Then
|
||||
'first_control = ctrl
|
||||
'End If
|
||||
'last_control = ctrl
|
||||
End If
|
||||
TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING
|
||||
TBPM_CONTROL_TABLETableAdapter.Fill(DD_DMSLiteDataSet.TBPM_CONTROL_TABLE, oControlRow.Item("GUID"))
|
||||
|
||||
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
|
||||
LOGGER.Debug("Controls geladen")
|
||||
LOGGER.Info("")
|
||||
CTRLS_Loaded = True
|
||||
FillIndexValues()
|
||||
For Each oControl As Control In pnldesigner.Controls
|
||||
LoadSimpleData(oControl, oControl.Tag)
|
||||
Next
|
||||
Next
|
||||
LOGGER.Debug("Controls geladen")
|
||||
LOGGER.Info("")
|
||||
CTRLS_Loaded = True
|
||||
FillIndexValues()
|
||||
For Each oControl As Control In pnldesigner.Controls
|
||||
LoadSimpleData(oControl, oControl.Tag)
|
||||
Next
|
||||
'Catch ex As Exception
|
||||
' 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("")
|
||||
|
||||
@ -1692,5 +1687,4 @@ Public Class frmMassValidator
|
||||
' KillU_Viewer()
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@ -800,7 +800,6 @@ Public Class frmValidator
|
||||
Select r).ToList()
|
||||
|
||||
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"
|
||||
LOGGER.Debug("Versuch Linie zu laden")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user