jj: Add & Use ClassPatterns
This commit is contained in:
parent
0c40601903
commit
603ff5cd68
@ -8,9 +8,9 @@ Public Class ClassAllgemeineFunktionen
|
||||
Try
|
||||
Dim Sql As String
|
||||
If LoginOut = "LOGIN" Then
|
||||
Sql = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME) VALUES ({0},{1},'Process-Manager','{2}','{3}')", CURRENT_USERID, 1, My.Application.Info.Version.ToString, Environment.MachineName)
|
||||
Sql = String.Format("INSERT INTO TBDD_USER_MODULE_LOG_IN (USER_ID,CLIENT_ID,MODULE,VERSION_CLIENT,MACHINE_NAME) VALUES ({0},{1},'Process-Manager','{2}','{3}')", CURRENT_USER_ID, 1, My.Application.Info.Version.ToString, Environment.MachineName)
|
||||
Else
|
||||
Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & CURRENT_USERID & " AND UPPER(MODULE) = UPPER('Process-Manager')"
|
||||
Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & CURRENT_USER_ID & " AND UPPER(MODULE) = UPPER('Process-Manager')"
|
||||
End If
|
||||
If ClassDatabase.Execute_non_Query(Sql, True) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> User logged in....", False)
|
||||
|
||||
@ -80,13 +80,17 @@ Public Class ClassInit
|
||||
Public Sub InitUserLogin()
|
||||
Try
|
||||
USER_USERNAME = Environment.UserName
|
||||
Dim sql = String.Format("SELECT MAX(GUID) FROM TBDD_USER WHERE LOWER(USERNAME) = LOWER('{0}')", Environment.UserName)
|
||||
Dim sql = String.Format("SELECT * FROM TBDD_USER WHERE LOWER(USERNAME) = LOWER('{0}')", Environment.UserName)
|
||||
ClassLogger.Add(">> Username: " & USER_USERNAME, False)
|
||||
|
||||
CURRENT_USERID = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
CURRENT_USER_ID = dt.Rows(0).Item("GUID")
|
||||
CURRENT_USER_SURNAME = dt.Rows(0).Item("NAME")
|
||||
CURRENT_USER_PRENAME = dt.Rows(0).Item("PRENAME")
|
||||
CURRENT_USER_SHORTNAME = dt.Rows(0).Item("SHORTNAME")
|
||||
CURRENT_USER_EMAIL = dt.Rows(0).Item("EMAIL")
|
||||
|
||||
|
||||
If IsDBNull(CURRENT_USERID) Or IsNothing(CURRENT_USERID) Then
|
||||
If IsDBNull(CURRENT_USER_ID) Or IsNothing(CURRENT_USER_ID) Then
|
||||
USER_EXISTS = False
|
||||
Else
|
||||
USER_EXISTS = True
|
||||
@ -105,21 +109,21 @@ Public Class ClassInit
|
||||
Check_User_Exists_in_PMGroups()
|
||||
|
||||
ClassAllgemeineFunktionen.LoginOut("LOGIN")
|
||||
sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Process-Manager') AND CLIENT_ID = {0}", 1)
|
||||
USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True)
|
||||
sql = String.Format("SELECT COUNT(*) AS Expr1 FROM TBDD_USER_MODULE_LOG_IN WHERE UPPER(MODULE) = UPPER('Process-Manager') AND CLIENT_ID = {0}", 1)
|
||||
USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False)
|
||||
If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then
|
||||
MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False)
|
||||
If USER_IS_ADMIN = False Then
|
||||
ClassAllgemeineFunktionen.LoginOut("LOGOUT")
|
||||
ClassLogger.Add(" - Wieder abgemeldet - START INCOMPLETE", False)
|
||||
ERROR_STATE = "START INCOMPLETE"
|
||||
End If
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False)
|
||||
If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then
|
||||
MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
|
||||
ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False)
|
||||
If USER_IS_ADMIN = False Then
|
||||
ClassAllgemeineFunktionen.LoginOut("LOGOUT")
|
||||
ClassLogger.Add(" - Wieder abgemeldet - START INCOMPLETE", False)
|
||||
ERROR_STATE = "START INCOMPLETE"
|
||||
End If
|
||||
'Alles OK bis hierhin...nun die FolderwatchKonfig laden
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Init Userlogin successfull completed....", False)
|
||||
End If
|
||||
'Alles OK bis hierhin...nun die FolderwatchKonfig laden
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Init Userlogin successfull completed....", False)
|
||||
|
||||
|
||||
End If
|
||||
@ -142,7 +146,7 @@ Public Class ClassInit
|
||||
End Sub
|
||||
Private Function Check_User_Exists_in_Group(ByVal Groupname As String)
|
||||
Try
|
||||
Dim sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = '{1}'", CURRENT_USERID, Groupname)
|
||||
Dim sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = '{1}'", CURRENT_USER_ID, Groupname)
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(sel)
|
||||
If Not IsNothing(DT) Then
|
||||
If DT.Rows.Count = 1 Then
|
||||
@ -160,14 +164,14 @@ Public Class ClassInit
|
||||
End Function
|
||||
Private Function Check_User_Exists_in_PMGroups()
|
||||
Try
|
||||
Dim sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = 'PM_USER'", CURRENT_USERID)
|
||||
Dim sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = 'PM_USER'", CURRENT_USER_ID)
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(sel)
|
||||
If Not IsNothing(DT) Then
|
||||
If DT.Rows.Count = 1 Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> User is in PM_USER-Group....", False)
|
||||
USER_IN_MODULE = True
|
||||
Else
|
||||
sel = String.Format("select T.* from TBDD_USER_MODULES T WHERE T.USER_ID = {0} AND T.MODULE_ID = 3", CURRENT_USERID)
|
||||
sel = String.Format("select T.* from TBDD_USER_MODULES T WHERE T.USER_ID = {0} AND T.MODULE_ID = 3", CURRENT_USER_ID)
|
||||
DT = ClassDatabase.Return_Datatable(sel)
|
||||
If Not IsNothing(DT) Then
|
||||
If DT.Rows.Count = 1 Then
|
||||
@ -177,7 +181,7 @@ Public Class ClassInit
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = 'PM_ADMINS'", CURRENT_USERID)
|
||||
sel = String.Format("select T1.* from TBDD_GROUPS T, TBDD_GROUPS_USER T1 WHERE T.GUID = T1.GROUP_ID AND T1.USER_ID = {0} AND UPPER(T.NAME) = 'PM_ADMINS'", CURRENT_USER_ID)
|
||||
DT = ClassDatabase.Return_Datatable(sel)
|
||||
|
||||
If Not IsNothing(DT) Then
|
||||
|
||||
262
app/DD_PM_WINDREAM/ClassPatterns.vb
Normal file
262
app/DD_PM_WINDREAM/ClassPatterns.vb
Normal file
@ -0,0 +1,262 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports WINDREAMLib
|
||||
|
||||
''' <summary>
|
||||
''' Defines common Functions for Checking for and replacing placeholders.
|
||||
''' This Class also includes a child class `Pattern` for passing around Patterns.
|
||||
'''
|
||||
''' The format of all placeholders is:
|
||||
''' {#TYPE#VALUE}
|
||||
'''
|
||||
''' Some Examples:
|
||||
''' {#INT#USERNAME}
|
||||
''' {#CTRL#CMB_2}
|
||||
''' {#WMI#String 39}
|
||||
''' </summary>
|
||||
Public Class ClassPatterns
|
||||
' Complex patterns that rely on a datasource like a Database or Windream
|
||||
Public Const PATTERN_WMI = "WMI"
|
||||
Public Const PATTERN_CTRL = "CTRL"
|
||||
' Simple patterns that only rely on .NET functions
|
||||
Public Const PATTERN_INT = "INT"
|
||||
' Simple patterns that rely on Data from the TBDD_USER table
|
||||
Public Const PATTERN_USER = "USER"
|
||||
|
||||
Public Const USER_VALUE_PRENAME = "PRENAME"
|
||||
Public Const USER_VALUE_SURNAME = "SURNAME"
|
||||
Public Const USER_VALUE_EMAIL = "EMAIL"
|
||||
Public Const USER_VALUE_SHORTNAME = "SHORTNAME"
|
||||
|
||||
Public Const INT_VALUE_USERNAME = "USERNAME"
|
||||
Public Const INT_VALUE_MACHINE = "MACHINE"
|
||||
Public Const INT_VALUE_DOMAIN = "DOMAIN"
|
||||
|
||||
Private Shared regex As Regex = New Regex("{#(\w+)#([\w\s_]+)}+")
|
||||
Private Shared allPatterns As New List(Of String) From {PATTERN_WMI, PATTERN_CTRL, PATTERN_USER, PATTERN_INT}
|
||||
Private Shared complexPatterns As New List(Of String) From {PATTERN_WMI, PATTERN_CTRL}
|
||||
Private Shared simplePatterns As New List(Of String) From {PATTERN_USER, PATTERN_INT}
|
||||
|
||||
''' <summary>
|
||||
''' Wraps a pattern-type and -value in the common format: {#type#value}
|
||||
''' </summary>
|
||||
Public Shared Function WrapPatternValue(type As String, value As String) As String
|
||||
Return New Pattern(type, value).ToString
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function ReplaceAllValues(input As String, panel As Panel, document As WMObject, prename As String, surname As String, shortname As String, email As String) As String
|
||||
Dim result = input
|
||||
|
||||
result = ReplaceInternalValues(result)
|
||||
result = ReplaceControlValues(result, panel)
|
||||
result = ReplaceWindreamIndicies(result, document)
|
||||
result = ReplaceUserValues(result, prename, surname, shortname, email)
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function ReplaceInternalValues(input As String) As String
|
||||
Dim result = input
|
||||
|
||||
' Replace Username(s)
|
||||
While ContainsPatternAndValue(result, PATTERN_INT, INT_VALUE_USERNAME)
|
||||
result = ReplacePattern(result, PATTERN_INT, Environment.UserName)
|
||||
End While
|
||||
|
||||
' Replace Machinename(s)
|
||||
While ContainsPatternAndValue(result, PATTERN_INT, INT_VALUE_MACHINE)
|
||||
result = ReplacePattern(result, PATTERN_INT, Environment.MachineName)
|
||||
End While
|
||||
|
||||
' Replace Domainname(s)
|
||||
While ContainsPatternAndValue(result, PATTERN_INT, INT_VALUE_DOMAIN)
|
||||
result = ReplacePattern(result, PATTERN_INT, Environment.UserDomainName)
|
||||
End While
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function ReplaceUserValues(input As String, prename As String, surname As String, shortname As String, email As String) As String
|
||||
Dim result = input
|
||||
|
||||
While ContainsPatternAndValue(result, PATTERN_USER, USER_VALUE_PRENAME)
|
||||
result = ReplacePattern(input, PATTERN_USER, prename)
|
||||
End While
|
||||
|
||||
While ContainsPatternAndValue(result, PATTERN_USER, USER_VALUE_SURNAME)
|
||||
result = ReplacePattern(input, PATTERN_USER, surname)
|
||||
End While
|
||||
|
||||
While ContainsPatternAndValue(result, PATTERN_USER, USER_VALUE_SHORTNAME)
|
||||
result = ReplacePattern(input, PATTERN_USER, shortname)
|
||||
End While
|
||||
|
||||
While ContainsPatternAndValue(result, PATTERN_USER, USER_VALUE_EMAIL)
|
||||
result = ReplacePattern(input, PATTERN_USER, email)
|
||||
End While
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function ReplaceControlValues(input As String, panel As Panel) As String
|
||||
Dim result = input
|
||||
|
||||
While ContainsPattern(result, PATTERN_CTRL)
|
||||
Dim controlName As String = GetNextPattern(result, PATTERN_CTRL).Value
|
||||
Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault()
|
||||
|
||||
If control IsNot Nothing Then
|
||||
Dim value As String = control.Text
|
||||
result = ReplacePattern(result, PATTERN_CTRL, value)
|
||||
End If
|
||||
End While
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Public Shared Function ReplaceWindreamIndicies(input As String, document As WMObject) As String
|
||||
Dim result = input
|
||||
|
||||
While ContainsPattern(result, PATTERN_WMI)
|
||||
Dim indexName As String = GetNextPattern(result, PATTERN_WMI).Value
|
||||
Dim value = document.GetVariableValue(indexName)
|
||||
|
||||
If value IsNot Nothing Then
|
||||
result = ReplacePattern(result, PATTERN_WMI, value)
|
||||
End If
|
||||
End While
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Private Shared Function ContainsPattern(input As String, type As String) As String
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
|
||||
For Each element As Match In elements
|
||||
Dim t As String = element.Groups(1).Value
|
||||
|
||||
If t = type Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Shared Function GetNextPattern(input As String, type As String) As Pattern
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
|
||||
For Each element As Match In elements
|
||||
' Pattern in input
|
||||
Dim t As String = element.Groups(1).Value
|
||||
Dim v As String = element.Groups(2).Value
|
||||
|
||||
If t = type Then
|
||||
Return New Pattern(t, v)
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Shared Function GetAllPatterns(input As String) As List(Of Pattern)
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
Dim results As New List(Of Pattern)
|
||||
|
||||
For Each element As Match In elements
|
||||
' Pattern in input
|
||||
Dim t As String = element.Groups(1).Value
|
||||
Dim v As String = element.Groups(2).Value
|
||||
|
||||
results.Add(New Pattern(t, v))
|
||||
Next
|
||||
|
||||
Return results
|
||||
End Function
|
||||
|
||||
Public Shared Function ReplacePattern(input As String, type As String, replacement As String) As String
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
|
||||
If IsNothing(replacement) Or replacement = String.Empty Then
|
||||
Return input
|
||||
End If
|
||||
|
||||
For Each element As Match In elements
|
||||
' if group 1 contains the 'pattern' the replace whole group with 'replacement'
|
||||
' and return it
|
||||
If element.Groups(1).Value = type Then
|
||||
Return Regex.Replace(input, element.Groups(0).Value, replacement)
|
||||
End If
|
||||
Next
|
||||
|
||||
' no replacement made
|
||||
Return input
|
||||
End Function
|
||||
|
||||
Private Shared Function ContainsPatternAndValue(input As String, type As String, value As String) As Boolean
|
||||
Dim elements As MatchCollection = regex.Matches(input)
|
||||
|
||||
For Each element As Match In elements
|
||||
' Pattern in input
|
||||
Dim t As String = element.Groups(1).Value
|
||||
Dim v As String = element.Groups(2).Value
|
||||
|
||||
If t = type And v = value Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Shared Function HasAnyPatterns(input) As Boolean
|
||||
Return allPatterns.Any(Function(p)
|
||||
Return HasPattern(input, p)
|
||||
End Function)
|
||||
End Function
|
||||
|
||||
Public Shared Function HasOnlySimplePatterns(input As String) As Boolean
|
||||
Return Not HasComplexPatterns(input)
|
||||
End Function
|
||||
|
||||
Public Shared Function HasComplexPatterns(input As String) As Boolean
|
||||
Return complexPatterns.Any(Function(p)
|
||||
Return HasPattern(input, p)
|
||||
End Function)
|
||||
End Function
|
||||
|
||||
Public Shared Function HasPattern(input As String, type As String) As Boolean
|
||||
Dim matches = regex.Matches(input)
|
||||
|
||||
For Each match As Match In matches
|
||||
For Each group As Group In match.Groups
|
||||
If group.Value = type Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Class Pattern
|
||||
Public ReadOnly Property Type As String
|
||||
Public ReadOnly Property Value As String
|
||||
|
||||
Public Sub New(type As String, value As String)
|
||||
Me.Type = type
|
||||
Me.Value = value
|
||||
End Sub
|
||||
|
||||
Public Sub New(stringRepresentation As String)
|
||||
Dim array = stringRepresentation.Split("#")
|
||||
Me.Type = array(0)
|
||||
Me.Value = array(1)
|
||||
End Sub
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return $"{Type}#{Value}"
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
@ -157,6 +157,7 @@
|
||||
<Compile Include="ClassControlCreator.vb" />
|
||||
<Compile Include="ClassInit.vb" />
|
||||
<Compile Include="ClassLogger.vb" />
|
||||
<Compile Include="ClassPatterns.vb" />
|
||||
<Compile Include="ClassSQLEditor.vb" />
|
||||
<Compile Include="frmAbout.designer.vb">
|
||||
<DependentUpon>frmAbout.vb</DependentUpon>
|
||||
|
||||
@ -15,7 +15,12 @@
|
||||
Public USER_USERNAME As String
|
||||
Public DT_USER2MODULE As DataTable
|
||||
|
||||
Public CURRENT_USERID
|
||||
Public CURRENT_USER_ID
|
||||
Public CURRENT_USER_PRENAME
|
||||
Public CURRENT_USER_SURNAME
|
||||
Public CURRENT_USER_SHORTNAME
|
||||
Public CURRENT_USER_EMAIL
|
||||
|
||||
Public USER_EXISTS = False
|
||||
Public USER_IN_MODULE = False
|
||||
Public LICENSE_COUNT As Integer = 0
|
||||
|
||||
120
app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb
generated
120
app/DD_PM_WINDREAM/frmSQL_DESIGNER.Designer.vb
generated
@ -52,6 +52,12 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.btnAddControl = New System.Windows.Forms.Button()
|
||||
Me.lblControls = New System.Windows.Forms.Label()
|
||||
Me.cmbControls = New System.Windows.Forms.ComboBox()
|
||||
Me.cmbStatic = New System.Windows.Forms.ComboBox()
|
||||
Me.btnAddStatic = New System.Windows.Forms.Button()
|
||||
Me.Label2 = New System.Windows.Forms.Label()
|
||||
Me.cmbUser = New System.Windows.Forms.ComboBox()
|
||||
Me.Label3 = New System.Windows.Forms.Label()
|
||||
Me.btnAddUser = New System.Windows.Forms.Button()
|
||||
CType(Me.DD_DMSLiteDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.TBPM_PROFILE_FINAL_INDEXINGBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.TBDD_CONNECTIONBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
@ -103,7 +109,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.btnShowConnections.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.btnShowConnections.Image = Global.DD_PM_WINDREAM.My.Resources.Resources.database_go1
|
||||
Me.btnShowConnections.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnShowConnections.Location = New System.Drawing.Point(220, 28)
|
||||
Me.btnShowConnections.Location = New System.Drawing.Point(220, 31)
|
||||
Me.btnShowConnections.Name = "btnShowConnections"
|
||||
Me.btnShowConnections.Size = New System.Drawing.Size(111, 24)
|
||||
Me.btnShowConnections.TabIndex = 82
|
||||
@ -128,7 +134,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.cmbConnection.DisplayMember = "BEZEICHNUNG"
|
||||
Me.cmbConnection.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.cmbConnection.FormattingEnabled = True
|
||||
Me.cmbConnection.Location = New System.Drawing.Point(14, 28)
|
||||
Me.cmbConnection.Location = New System.Drawing.Point(12, 31)
|
||||
Me.cmbConnection.Name = "cmbConnection"
|
||||
Me.cmbConnection.Size = New System.Drawing.Size(200, 24)
|
||||
Me.cmbConnection.TabIndex = 80
|
||||
@ -141,17 +147,17 @@ Partial Class frmSQL_DESIGNER
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.SQL_COMMANDTextBox.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.TBPM_PROFILE_FINAL_INDEXINGBindingSource, "SQL_COMMAND", True))
|
||||
Me.SQL_COMMANDTextBox.Font = New System.Drawing.Font("Courier New", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.SQL_COMMANDTextBox.Location = New System.Drawing.Point(15, 76)
|
||||
Me.SQL_COMMANDTextBox.Location = New System.Drawing.Point(15, 125)
|
||||
Me.SQL_COMMANDTextBox.Multiline = True
|
||||
Me.SQL_COMMANDTextBox.Name = "SQL_COMMANDTextBox"
|
||||
Me.SQL_COMMANDTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
|
||||
Me.SQL_COMMANDTextBox.Size = New System.Drawing.Size(896, 237)
|
||||
Me.SQL_COMMANDTextBox.Size = New System.Drawing.Size(905, 186)
|
||||
Me.SQL_COMMANDTextBox.TabIndex = 86
|
||||
'
|
||||
'Label4
|
||||
'
|
||||
Me.Label4.AutoSize = True
|
||||
Me.Label4.Location = New System.Drawing.Point(11, 57)
|
||||
Me.Label4.Location = New System.Drawing.Point(9, 109)
|
||||
Me.Label4.Name = "Label4"
|
||||
Me.Label4.Size = New System.Drawing.Size(81, 13)
|
||||
Me.Label4.TabIndex = 85
|
||||
@ -163,7 +169,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.Label1.AutoSize = True
|
||||
Me.Label1.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label1.ImeMode = System.Windows.Forms.ImeMode.NoControl
|
||||
Me.Label1.Location = New System.Drawing.Point(15, 316)
|
||||
Me.Label1.Location = New System.Drawing.Point(13, 331)
|
||||
Me.Label1.Name = "Label1"
|
||||
Me.Label1.Size = New System.Drawing.Size(65, 15)
|
||||
Me.Label1.TabIndex = 91
|
||||
@ -175,7 +181,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.Label5.AutoSize = True
|
||||
Me.Label5.Font = New System.Drawing.Font("Segoe UI", 9.0!)
|
||||
Me.Label5.ImeMode = System.Windows.Forms.ImeMode.NoControl
|
||||
Me.Label5.Location = New System.Drawing.Point(366, 335)
|
||||
Me.Label5.Location = New System.Drawing.Point(365, 331)
|
||||
Me.Label5.Name = "Label5"
|
||||
Me.Label5.Size = New System.Drawing.Size(55, 15)
|
||||
Me.Label5.TabIndex = 90
|
||||
@ -190,10 +196,10 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.dgvResult.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.dgvResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvResult.Location = New System.Drawing.Point(368, 351)
|
||||
Me.dgvResult.Location = New System.Drawing.Point(368, 349)
|
||||
Me.dgvResult.Name = "dgvResult"
|
||||
Me.dgvResult.ReadOnly = True
|
||||
Me.dgvResult.Size = New System.Drawing.Size(543, 134)
|
||||
Me.dgvResult.Size = New System.Drawing.Size(552, 134)
|
||||
Me.dgvResult.TabIndex = 89
|
||||
'
|
||||
'dgvPlaceholders
|
||||
@ -206,9 +212,9 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.dgvPlaceholders.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||
Me.dgvPlaceholders.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colPlaceholder, Me.colReplace})
|
||||
Me.dgvPlaceholders.Enabled = False
|
||||
Me.dgvPlaceholders.Location = New System.Drawing.Point(16, 334)
|
||||
Me.dgvPlaceholders.Location = New System.Drawing.Point(16, 349)
|
||||
Me.dgvPlaceholders.Name = "dgvPlaceholders"
|
||||
Me.dgvPlaceholders.Size = New System.Drawing.Size(338, 150)
|
||||
Me.dgvPlaceholders.Size = New System.Drawing.Size(338, 133)
|
||||
Me.dgvPlaceholders.TabIndex = 88
|
||||
'
|
||||
'colPlaceholder
|
||||
@ -229,7 +235,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.btnTestSQL.Image = CType(resources.GetObject("btnTestSQL.Image"), System.Drawing.Image)
|
||||
Me.btnTestSQL.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnTestSQL.ImeMode = System.Windows.Forms.ImeMode.NoControl
|
||||
Me.btnTestSQL.Location = New System.Drawing.Point(743, 316)
|
||||
Me.btnTestSQL.Location = New System.Drawing.Point(752, 314)
|
||||
Me.btnTestSQL.Name = "btnTestSQL"
|
||||
Me.btnTestSQL.Size = New System.Drawing.Size(168, 29)
|
||||
Me.btnTestSQL.TabIndex = 87
|
||||
@ -241,16 +247,16 @@ Partial Class frmSQL_DESIGNER
|
||||
'
|
||||
Me.Label15.AutoSize = True
|
||||
Me.Label15.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Label15.Location = New System.Drawing.Point(678, 9)
|
||||
Me.Label15.Location = New System.Drawing.Point(678, 13)
|
||||
Me.Label15.Name = "Label15"
|
||||
Me.Label15.Size = New System.Drawing.Size(44, 16)
|
||||
Me.Label15.Size = New System.Drawing.Size(203, 16)
|
||||
Me.Label15.TabIndex = 93
|
||||
Me.Label15.Text = "Index:"
|
||||
Me.Label15.Text = "Index (zur Laufzeit ausgewertet):"
|
||||
'
|
||||
'cmbIndexe
|
||||
'
|
||||
Me.cmbIndexe.FormattingEnabled = True
|
||||
Me.cmbIndexe.Location = New System.Drawing.Point(681, 28)
|
||||
Me.cmbIndexe.Location = New System.Drawing.Point(681, 32)
|
||||
Me.cmbIndexe.Name = "cmbIndexe"
|
||||
Me.cmbIndexe.Size = New System.Drawing.Size(194, 21)
|
||||
Me.cmbIndexe.TabIndex = 92
|
||||
@ -258,7 +264,7 @@ Partial Class frmSQL_DESIGNER
|
||||
'btnAddIndex
|
||||
'
|
||||
Me.btnAddIndex.Image = CType(resources.GetObject("btnAddIndex.Image"), System.Drawing.Image)
|
||||
Me.btnAddIndex.Location = New System.Drawing.Point(881, 28)
|
||||
Me.btnAddIndex.Location = New System.Drawing.Point(881, 32)
|
||||
Me.btnAddIndex.Name = "btnAddIndex"
|
||||
Me.btnAddIndex.Size = New System.Drawing.Size(32, 23)
|
||||
Me.btnAddIndex.TabIndex = 94
|
||||
@ -270,7 +276,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.btnSaveSQLCommand.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.btnSaveSQLCommand.Image = CType(resources.GetObject("btnSaveSQLCommand.Image"), System.Drawing.Image)
|
||||
Me.btnSaveSQLCommand.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||
Me.btnSaveSQLCommand.Location = New System.Drawing.Point(816, 491)
|
||||
Me.btnSaveSQLCommand.Location = New System.Drawing.Point(825, 489)
|
||||
Me.btnSaveSQLCommand.Name = "btnSaveSQLCommand"
|
||||
Me.btnSaveSQLCommand.Size = New System.Drawing.Size(95, 30)
|
||||
Me.btnSaveSQLCommand.TabIndex = 95
|
||||
@ -283,7 +289,7 @@ Partial Class frmSQL_DESIGNER
|
||||
Me.lblSaveFinalIndex.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblSaveFinalIndex.AutoSize = True
|
||||
Me.lblSaveFinalIndex.BackColor = System.Drawing.Color.Yellow
|
||||
Me.lblSaveFinalIndex.Location = New System.Drawing.Point(367, 491)
|
||||
Me.lblSaveFinalIndex.Location = New System.Drawing.Point(367, 489)
|
||||
Me.lblSaveFinalIndex.Name = "lblSaveFinalIndex"
|
||||
Me.lblSaveFinalIndex.Size = New System.Drawing.Size(38, 13)
|
||||
Me.lblSaveFinalIndex.TabIndex = 96
|
||||
@ -293,7 +299,7 @@ Partial Class frmSQL_DESIGNER
|
||||
'btnAddControl
|
||||
'
|
||||
Me.btnAddControl.Image = CType(resources.GetObject("btnAddControl.Image"), System.Drawing.Image)
|
||||
Me.btnAddControl.Location = New System.Drawing.Point(645, 28)
|
||||
Me.btnAddControl.Location = New System.Drawing.Point(643, 32)
|
||||
Me.btnAddControl.Name = "btnAddControl"
|
||||
Me.btnAddControl.Size = New System.Drawing.Size(32, 23)
|
||||
Me.btnAddControl.TabIndex = 99
|
||||
@ -303,7 +309,7 @@ Partial Class frmSQL_DESIGNER
|
||||
'
|
||||
Me.lblControls.AutoSize = True
|
||||
Me.lblControls.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lblControls.Location = New System.Drawing.Point(442, 9)
|
||||
Me.lblControls.Location = New System.Drawing.Point(442, 13)
|
||||
Me.lblControls.Name = "lblControls"
|
||||
Me.lblControls.Size = New System.Drawing.Size(215, 16)
|
||||
Me.lblControls.TabIndex = 98
|
||||
@ -312,18 +318,80 @@ Partial Class frmSQL_DESIGNER
|
||||
'cmbControls
|
||||
'
|
||||
Me.cmbControls.FormattingEnabled = True
|
||||
Me.cmbControls.Location = New System.Drawing.Point(445, 28)
|
||||
Me.cmbControls.Location = New System.Drawing.Point(445, 31)
|
||||
Me.cmbControls.Name = "cmbControls"
|
||||
Me.cmbControls.Size = New System.Drawing.Size(194, 21)
|
||||
Me.cmbControls.TabIndex = 97
|
||||
'
|
||||
'cmbStatic
|
||||
'
|
||||
Me.cmbStatic.FormattingEnabled = True
|
||||
Me.cmbStatic.Items.AddRange(New Object() {"USERNAME", "MACHINE", "DOMAIN"})
|
||||
Me.cmbStatic.Location = New System.Drawing.Point(445, 86)
|
||||
Me.cmbStatic.Name = "cmbStatic"
|
||||
Me.cmbStatic.Size = New System.Drawing.Size(194, 21)
|
||||
Me.cmbStatic.TabIndex = 97
|
||||
'
|
||||
'btnAddStatic
|
||||
'
|
||||
Me.btnAddStatic.Image = CType(resources.GetObject("btnAddStatic.Image"), System.Drawing.Image)
|
||||
Me.btnAddStatic.Location = New System.Drawing.Point(643, 86)
|
||||
Me.btnAddStatic.Name = "btnAddStatic"
|
||||
Me.btnAddStatic.Size = New System.Drawing.Size(32, 23)
|
||||
Me.btnAddStatic.TabIndex = 99
|
||||
Me.btnAddStatic.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Label2
|
||||
'
|
||||
Me.Label2.AutoSize = True
|
||||
Me.Label2.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Label2.Location = New System.Drawing.Point(442, 67)
|
||||
Me.Label2.Name = "Label2"
|
||||
Me.Label2.Size = New System.Drawing.Size(97, 16)
|
||||
Me.Label2.TabIndex = 98
|
||||
Me.Label2.Text = "Windowsdaten:"
|
||||
'
|
||||
'cmbUser
|
||||
'
|
||||
Me.cmbUser.FormattingEnabled = True
|
||||
Me.cmbUser.Items.AddRange(New Object() {"PRENAME", "SURNAME", "SHORTNAME", "EMAIL"})
|
||||
Me.cmbUser.Location = New System.Drawing.Point(681, 86)
|
||||
Me.cmbUser.Name = "cmbUser"
|
||||
Me.cmbUser.Size = New System.Drawing.Size(194, 21)
|
||||
Me.cmbUser.TabIndex = 97
|
||||
'
|
||||
'Label3
|
||||
'
|
||||
Me.Label3.AutoSize = True
|
||||
Me.Label3.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.Label3.Location = New System.Drawing.Point(678, 67)
|
||||
Me.Label3.Name = "Label3"
|
||||
Me.Label3.Size = New System.Drawing.Size(95, 16)
|
||||
Me.Label3.TabIndex = 98
|
||||
Me.Label3.Text = "Benutzerdaten:"
|
||||
'
|
||||
'btnAddUser
|
||||
'
|
||||
Me.btnAddUser.Image = CType(resources.GetObject("btnAddUser.Image"), System.Drawing.Image)
|
||||
Me.btnAddUser.Location = New System.Drawing.Point(881, 84)
|
||||
Me.btnAddUser.Name = "btnAddUser"
|
||||
Me.btnAddUser.Size = New System.Drawing.Size(32, 23)
|
||||
Me.btnAddUser.TabIndex = 99
|
||||
Me.btnAddUser.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmSQL_DESIGNER
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(921, 525)
|
||||
Me.ClientSize = New System.Drawing.Size(930, 523)
|
||||
Me.Controls.Add(Me.btnAddUser)
|
||||
Me.Controls.Add(Me.btnAddStatic)
|
||||
Me.Controls.Add(Me.btnAddControl)
|
||||
Me.Controls.Add(Me.Label3)
|
||||
Me.Controls.Add(Me.Label2)
|
||||
Me.Controls.Add(Me.lblControls)
|
||||
Me.Controls.Add(Me.cmbUser)
|
||||
Me.Controls.Add(Me.cmbStatic)
|
||||
Me.Controls.Add(Me.cmbControls)
|
||||
Me.Controls.Add(Me.lblSaveFinalIndex)
|
||||
Me.Controls.Add(Me.btnSaveSQLCommand)
|
||||
@ -383,4 +451,10 @@ Partial Class frmSQL_DESIGNER
|
||||
Friend WithEvents btnAddControl As Button
|
||||
Friend WithEvents lblControls As Label
|
||||
Friend WithEvents cmbControls As ComboBox
|
||||
Friend WithEvents cmbStatic As ComboBox
|
||||
Friend WithEvents btnAddStatic As Button
|
||||
Friend WithEvents Label2 As Label
|
||||
Friend WithEvents cmbUser As ComboBox
|
||||
Friend WithEvents Label3 As Label
|
||||
Friend WithEvents btnAddUser As Button
|
||||
End Class
|
||||
|
||||
@ -172,6 +172,22 @@
|
||||
xAAADsQBlSsOGwAAAFxJREFUOE/NjFEKgDAMQ3e23v88/Y1YOslqhE1hGHgfS5fXAHxCliuMD4q7o5Kn
|
||||
yJTAzC72CM5PTBUwfXMT8OiJnwuYOmL6ZhBwlCBPkT2CSp4iUvAGWa4gy3nQDiNEflNl/3oXAAAAAElF
|
||||
TkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnAddStatic.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
xAAADsQBlSsOGwAAAFxJREFUOE/NjFEKgDAMQ3e23v88/Y1YOslqhE1hGHgfS5fXAHxCliuMD4q7o5Kn
|
||||
yJTAzC72CM5PTBUwfXMT8OiJnwuYOmL6ZhBwlCBPkT2CSp4iUvAGWa4gy3nQDiNEflNl/3oXAAAAAElF
|
||||
TkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btnAddUser.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
xAAADsQBlSsOGwAAAFxJREFUOE/NjFEKgDAMQ3e23v88/Y1YOslqhE1hGHgfS5fXAHxCliuMD4q7o5Kn
|
||||
yJTAzC72CM5PTBUwfXMT8OiJnwuYOmL6ZhBwlCBPkT2CSp4iUvAGWa4gy3nQDiNEflNl/3oXAAAAAElF
|
||||
TkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
|
||||
@ -4,6 +4,25 @@ Imports Oracle.ManagedDataAccess.Client
|
||||
Public Class frmSQL_DESIGNER
|
||||
Private _windreamPM As ClassPMWindream
|
||||
|
||||
Dim CurrentPosition As Integer = 0
|
||||
Dim CurrentPlaceholders As New Placeholders()
|
||||
Dim CurrentTableType As String
|
||||
Dim AtPlaceholderPattern As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}" '"\[%[0-9A-Za-z_-]{1,}\]"
|
||||
Public Class Placeholders
|
||||
Public Property RecordId As Integer
|
||||
Public Property ParentRecordId As Integer
|
||||
Public Property FormId As Integer
|
||||
End Class
|
||||
|
||||
Public Property Value() As String
|
||||
Get
|
||||
Return SQL_COMMANDTextBox.Text
|
||||
End Get
|
||||
Set(value As String)
|
||||
SQL_COMMANDTextBox.Text = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub TBPM_PROFILE_FINAL_INDEXINGBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
|
||||
Validate()
|
||||
TBPM_PROFILE_FINAL_INDEXINGBindingSource.EndEdit()
|
||||
@ -60,24 +79,7 @@ Public Class frmSQL_DESIGNER
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Dim CurrentPosition As Integer = 0
|
||||
Dim CurrentPlaceholders As New Placeholders()
|
||||
Dim CurrentTableType As String
|
||||
Dim AtPlaceholderPattern As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}" '"\[%[0-9A-Za-z_-]{1,}\]"
|
||||
Public Class Placeholders
|
||||
Public Property RecordId As Integer
|
||||
Public Property ParentRecordId As Integer
|
||||
Public Property FormId As Integer
|
||||
End Class
|
||||
|
||||
Public Property Value() As String
|
||||
Get
|
||||
Return SQL_COMMANDTextBox.Text
|
||||
End Get
|
||||
Set(value As String)
|
||||
SQL_COMMANDTextBox.Text = value
|
||||
End Set
|
||||
End Property
|
||||
Private Sub SQL_COMMANDTextBox_TextChanged(sender As Object, e As EventArgs) Handles SQL_COMMANDTextBox.TextChanged, SQL_COMMANDTextBox.Click
|
||||
CurrentPosition = SQL_COMMANDTextBox.SelectionStart
|
||||
|
||||
@ -90,16 +92,23 @@ Public Class frmSQL_DESIGNER
|
||||
CheckForPlaceholders()
|
||||
End Sub
|
||||
Private Sub CheckForPlaceholders()
|
||||
Dim count As Integer = 0
|
||||
Dim text As String = Me.Value
|
||||
Dim atPlaceholderRegex = New Regex(AtPlaceholderPattern, RegexOptions.IgnoreCase)
|
||||
Dim matches As MatchCollection = atPlaceholderRegex.Matches(text)
|
||||
|
||||
Dim text As String = SQL_COMMANDTextBox.Text
|
||||
dgvPlaceholders.Rows.Clear()
|
||||
|
||||
For Each match As Match In matches
|
||||
dgvPlaceholders.Rows.Add({match.Value, ""})
|
||||
Dim patterns As List(Of ClassPatterns.Pattern) = ClassPatterns.GetAllPatterns(text)
|
||||
|
||||
For Each pattern In patterns
|
||||
dgvPlaceholders.Rows.Add({pattern.ToString, ""})
|
||||
Next
|
||||
|
||||
'Dim count As Integer = 0
|
||||
'Dim text As String = Me.Value
|
||||
'Dim atPlaceholderRegex = New Regex(AtPlaceholderPattern, RegexOptions.IgnoreCase)
|
||||
'Dim matches As MatchCollection = atPlaceholderRegex.Matches(text)
|
||||
'dgvPlaceholders.Rows.Clear()
|
||||
'For Each match As Match In matches
|
||||
' dgvPlaceholders.Rows.Add({match.Value, ""})
|
||||
'Next
|
||||
End Sub
|
||||
|
||||
Private Sub btnTestSQL_Click(sender As Object, e As EventArgs) Handles btnTestSQL.Click
|
||||
@ -111,7 +120,11 @@ Public Class frmSQL_DESIGNER
|
||||
|
||||
' Wenn Ersetzung ausgefüllt wurde, Platzhalter damit ersetzen
|
||||
If Not String.IsNullOrEmpty(replacement) Then
|
||||
query = query.Replace(placeholder, replacement)
|
||||
Dim pattern As New ClassPatterns.Pattern(placeholder)
|
||||
|
||||
query = ClassPatterns.ReplacePattern(query, pattern.Type, replacement)
|
||||
|
||||
'query = query.Replace(placeholder, replacement)
|
||||
Else
|
||||
MsgBox("Bitte geben Sie für den Platzhalter " & placeholder & " einen Wert an!", MsgBoxStyle.Exclamation, "Fehlende Platzhalter Ersetzung")
|
||||
Exit Sub
|
||||
@ -192,15 +205,7 @@ Public Class frmSQL_DESIGNER
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnAddIndex.Click
|
||||
If cmbIndexe.SelectedIndex <> -1 Then
|
||||
Dim val As String = "[%" & cmbIndexe.Text & "]"
|
||||
Dim altePosition As Integer = Me.SQL_COMMANDTextBox.SelectionStart()
|
||||
Me.SQL_COMMANDTextBox.Text = Me.SQL_COMMANDTextBox.Text.Insert(altePosition, val)
|
||||
Me.SQL_COMMANDTextBox.SelectionStart = altePosition + val.Length
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnSaveSQLCommand_Click(sender As Object, e As EventArgs) Handles btnSaveSQLCommand.Click
|
||||
If CURRENT_DESIGN_TYPE = "FINAL_INDEX" Then
|
||||
@ -223,14 +228,39 @@ Public Class frmSQL_DESIGNER
|
||||
|
||||
Private Sub btnAddControl_Click(sender As Object, e As EventArgs) Handles btnAddControl.Click
|
||||
If cmbControls.SelectedIndex <> -1 Then
|
||||
Dim val As String = "[%" & cmbControls.Text & "]"
|
||||
Dim altePosition As Integer = Me.SQL_COMMANDTextBox.SelectionStart()
|
||||
Me.SQL_COMMANDTextBox.Text = Me.SQL_COMMANDTextBox.Text.Insert(altePosition, val)
|
||||
Me.SQL_COMMANDTextBox.SelectionStart = altePosition + val.Length
|
||||
Dim value As String = ClassPatterns.WrapPatternValue("CTRL", cmbControls.Text)
|
||||
InsertAtSelection(value)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnAddStatic_Click(sender As Object, e As EventArgs) Handles btnAddStatic.Click
|
||||
If cmbStatic.SelectedIndex <> -1 Then
|
||||
Dim value As String = ClassPatterns.WrapPatternValue("INT", cmbStatic.Text)
|
||||
InsertAtSelection(value)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnAddIndex.Click
|
||||
If cmbIndexe.SelectedIndex <> -1 Then
|
||||
Dim value As String = ClassPatterns.WrapPatternValue("WMI", cmbIndexe.Text)
|
||||
InsertAtSelection(value)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub InsertAtSelection(str As String)
|
||||
Dim altePosition As Integer = SQL_COMMANDTextBox.SelectionStart()
|
||||
SQL_COMMANDTextBox.Text = SQL_COMMANDTextBox.Text.Insert(altePosition, str)
|
||||
SQL_COMMANDTextBox.SelectionStart = altePosition + str.Length
|
||||
End Sub
|
||||
|
||||
Private Sub btnShowConnections_Click(sender As Object, e As EventArgs) Handles btnShowConnections.Click
|
||||
frmConnection.ShowDialog()
|
||||
End Sub
|
||||
|
||||
Private Sub btnAddUser_Click(sender As Object, e As EventArgs) Handles btnAddUser.Click
|
||||
If cmbUser.SelectedIndex <> -1 Then
|
||||
Dim value As String = ClassPatterns.WrapPatternValue("USER", cmbUser.Text)
|
||||
InsertAtSelection(value)
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
@ -9,6 +9,7 @@ Imports Independentsoft
|
||||
Imports System.IO
|
||||
Imports DevExpress.Pdf.pdfdo
|
||||
Imports DevExpress.Pdf
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Public Class frmValidator
|
||||
Dim viewerID
|
||||
@ -196,24 +197,24 @@ Public Class frmValidator
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function process_terminate(processname As String)
|
||||
Try
|
||||
Dim selectQuery As SelectQuery = New SelectQuery("Win32_Process")
|
||||
Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(selectQuery)
|
||||
For Each proc As ManagementObject In searcher.Get
|
||||
If proc("Name").ToString = processname Then
|
||||
Dim s(1) As String
|
||||
proc.InvokeMethod("GetOwner", CType(s, Object()))
|
||||
If CStr(s(0)).ToLower.Contains(Environment.UserName.ToLower) Then
|
||||
proc.InvokeMethod("Terminate", Nothing)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(">> Fehler in process_terminate: " & ex.Message, True)
|
||||
End Try
|
||||
End Function
|
||||
'Private Function process_terminate(processname As String)
|
||||
' Try
|
||||
' Dim selectQuery As SelectQuery = New SelectQuery("Win32_Process")
|
||||
' Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(selectQuery)
|
||||
' For Each proc As ManagementObject In searcher.Get
|
||||
' If proc("Name").ToString = processname Then
|
||||
' Dim s(1) As String
|
||||
' proc.InvokeMethod("GetOwner", CType(s, Object()))
|
||||
' If CStr(s(0)).ToLower.Contains(Environment.UserName.ToLower) Then
|
||||
' proc.InvokeMethod("Terminate", Nothing)
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Return False
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add(">> Fehler in process_terminate: " & ex.Message, True)
|
||||
' End Try
|
||||
'End Function
|
||||
Sub Close_PDF_Viewer(vorherigefile As String)
|
||||
Try
|
||||
If vpdfviewer = "pdfxchange" Then
|
||||
@ -342,7 +343,7 @@ Public Class frmValidator
|
||||
WD_Search = dr.Item("WD_SEARCH")
|
||||
finalProfile = dr.Item("FINAL_PROFILE")
|
||||
Move2Folder = dr.Item("MOVE2Folder")
|
||||
Dim sql = String.Format("SELECT RIGHT1 FROM TBDD_USER_MODULES WHERE USER_ID = {0} AND MODULE_ID = (SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'PM')", CURRENT_USERID)
|
||||
Dim sql = String.Format("SELECT RIGHT1 FROM TBDD_USER_MODULES WHERE USER_ID = {0} AND MODULE_ID = (SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'PM')", CURRENT_USER_ID)
|
||||
Right_Delete = CBool(ClassDatabase.Execute_Scalar(sql, MyConnectionString))
|
||||
|
||||
If CURRENT_JUMP_DOC_GUID <> 0 Then
|
||||
@ -371,10 +372,12 @@ Public Class frmValidator
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Right_Delete: " & Right_Delete.ToString, False)
|
||||
Load_Controls()
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
Catch ex As System.Exception
|
||||
Catch ex As Exception
|
||||
MsgBox("Error SAVING Profile-Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
|
||||
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error SAVING Profile-Data: " & ex.Message, Environment.UserName)
|
||||
ClassLogger.Add(">> Fehler in SAVING Profile-Data: " & ex.Message, True)
|
||||
@ -401,101 +404,149 @@ Public Class frmValidator
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Sub ComboBoxData(profileId As Integer, controlName As String)
|
||||
' Informationen über Profil und Control holen
|
||||
Dim ControlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(profileId, controlName)
|
||||
Dim ConnectionId As Integer
|
||||
Dim SQLCommand As String
|
||||
Sub LoadSimpleData(control As Control, controlId As Integer)
|
||||
If TypeOf control Is Label Then Exit Sub
|
||||
|
||||
If ControlId = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim sql As String = $"SELECT NAME, CONNECTION_ID, SQL_UEBERPRUEFUNG FROM TBPM_PROFILE_CONTROLS WHERE GUID = {controlId} AND PROFIL_ID = {CURRENT_ProfilGUID} AND LEN(ISNULL(SQL_UEBERPRUEFUNG,'')) > 0 AND SQL_UEBERPRUEFUNG NOT LIKE '%#WMI#%' AND SQL_UEBERPRUEFUNG NOT LIKE '%#CTRL#%'"
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
|
||||
ConnectionId = TBPM_PROFILE_CONTROLSTableAdapter.cmdgetConnectionID(ControlId)
|
||||
If IsNothing(dt) Then Exit Sub
|
||||
If dt.Rows.Count = 0 Then Exit Sub
|
||||
|
||||
If ConnectionId = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
For Each row As DataRow In dt.Rows
|
||||
Dim name As String = row.Item("NAME")
|
||||
|
||||
SQLCommand = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlId)
|
||||
If IsDBNull(row.Item("CONNECTION_ID")) Then Continue For
|
||||
If IsDBNull(row.Item("SQL_UEBERPRUEFUNG")) Then Continue For
|
||||
|
||||
If SQLCommand = String.Empty Then
|
||||
Exit Sub
|
||||
End If
|
||||
Dim sqlStatement As String = row.Item("SQL_UEBERPRUEFUNG")
|
||||
Dim connectionId As Integer = row.Item("CONNECTION_ID")
|
||||
|
||||
TBDD_CONNECTIONTableAdapter.FillByID(DD_DMSLiteDataSet.TBDD_CONNECTION, ConnectionId)
|
||||
sql = ClassPatterns.ReplaceInternalValues(sqlStatement)
|
||||
dt = ClassDatabase.Return_Datatable(sqlStatement)
|
||||
|
||||
Dim connectionString As String
|
||||
If IsNothing(dt) Then
|
||||
MsgBox($"SQL-Query for control {control.Name} is invalid.")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each row As DataRow In DD_DMSLiteDataSet.TBDD_CONNECTION.Rows
|
||||
Select Case row.Item("SQL_PROVIDER").ToString().ToLower()
|
||||
Case "ms-sql"
|
||||
If row.Item("USERNAME") = "WINAUTH" Then
|
||||
connectionString = $"Data Source={row.Item("SERVER")};Initial Catalog=${row.Item("DATENBANK")};Trusted_Connection=True;"
|
||||
Else
|
||||
connectionString = $"Data Source={row.Item("SERVER")};Initial Catalog=${row.Item("DATENBANK")};User Id={row.Item("USERNAME")};Password={row.Item("PASSWORD")}"
|
||||
End If
|
||||
Case "oracle"
|
||||
Dim csBuilder As New OracleConnectionStringBuilder()
|
||||
If TypeOf control Is TextBox Then
|
||||
Dim firstRow As DataRow = dt.Rows(0)
|
||||
Dim value = firstRow.Item(0)
|
||||
|
||||
If row.Item("SERVER") <> String.Empty And Not IsDBNull(row.Item("SERVER")) Then
|
||||
connectionString = $"""
|
||||
Data Source=(
|
||||
DESCRIPTION=
|
||||
ADDRESS_LIST=
|
||||
(ADDRESS=
|
||||
(PROTOCOL=TCP)
|
||||
(HOST={row.Item("SERVER")})
|
||||
(PORT=1521)
|
||||
)
|
||||
)
|
||||
(CONNECT_DATA=
|
||||
(SERVER=DEDICATED)
|
||||
(SERVICE_NAME={row.Item("DATENBANK")})
|
||||
)
|
||||
)
|
||||
);User Id={row.Item("USERNAME")};Password={row.Item("PASSWORD")}
|
||||
"""
|
||||
Else
|
||||
csBuilder.DataSource = row.Item("SERVER")
|
||||
csBuilder.UserID = row.Item("USERNAME")
|
||||
csBuilder.Password = row.Item("PASSWORD")
|
||||
csBuilder.PersistSecurityInfo = True
|
||||
csBuilder.ConnectionTimeout = 120
|
||||
control.Text = value
|
||||
ElseIf TypeOf control Is ComboBox Then
|
||||
Dim comboxBox As ComboBox = control
|
||||
Dim list As New List(Of String)
|
||||
|
||||
connectionString = csBuilder.ConnectionString
|
||||
End If
|
||||
Case Else
|
||||
Exit Sub
|
||||
End Select
|
||||
For Each _row As DataRow In dt.Rows
|
||||
list.Add(_row.Item(0))
|
||||
Next
|
||||
|
||||
comboxBox.DataSource = list
|
||||
ElseIf TypeOf control Is DataGridView Then
|
||||
Dim dataGridView As DataGridView = control
|
||||
|
||||
dataGridView.DataSource = dt
|
||||
End If
|
||||
Next
|
||||
|
||||
Dim items As New List(Of String)
|
||||
|
||||
Using adapter As New SqlClient.SqlDataAdapter()
|
||||
Using conn As New SqlClient.SqlConnection(connectionString)
|
||||
conn.Open()
|
||||
|
||||
Using cmd As New SqlClient.SqlCommand(SQLCommand, conn)
|
||||
|
||||
Dim dataSet As New DataSet()
|
||||
|
||||
adapter.SelectCommand = cmd
|
||||
adapter.Fill(dataSet)
|
||||
|
||||
Dim table = dataSet.Tables(0)
|
||||
|
||||
For Each row As DataRow In table.Rows
|
||||
items.Add(row.Item(0))
|
||||
Next
|
||||
End Using
|
||||
End Using
|
||||
End Using
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
'Sub ComboBoxData(profileId As Integer, controlName As String)
|
||||
' ' Informationen über Profil und Control holen
|
||||
' Dim ControlId As Integer = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(profileId, controlName)
|
||||
' Dim ConnectionId As Integer
|
||||
' Dim SQLCommand As String
|
||||
|
||||
' If ControlId = 0 Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' ConnectionId = TBPM_PROFILE_CONTROLSTableAdapter.cmdgetConnectionID(ControlId)
|
||||
|
||||
' If ConnectionId = 0 Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' SQLCommand = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlId)
|
||||
|
||||
' If SQLCommand = String.Empty Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' TBDD_CONNECTIONTableAdapter.FillByID(DD_DMSLiteDataSet.TBDD_CONNECTION, ConnectionId)
|
||||
|
||||
' Dim connectionString As String
|
||||
|
||||
' For Each row As DataRow In DD_DMSLiteDataSet.TBDD_CONNECTION.Rows
|
||||
' Select Case row.Item("SQL_PROVIDER").ToString().ToLower()
|
||||
' Case "ms-sql"
|
||||
' If row.Item("USERNAME") = "WINAUTH" Then
|
||||
' connectionString = $"Data Source={row.Item("SERVER")};Initial Catalog=${row.Item("DATENBANK")};Trusted_Connection=True;"
|
||||
' Else
|
||||
' connectionString = $"Data Source={row.Item("SERVER")};Initial Catalog=${row.Item("DATENBANK")};User Id={row.Item("USERNAME")};Password={row.Item("PASSWORD")}"
|
||||
' End If
|
||||
' Case "oracle"
|
||||
' Dim csBuilder As New OracleConnectionStringBuilder()
|
||||
|
||||
' If row.Item("SERVER") <> String.Empty And Not IsDBNull(row.Item("SERVER")) Then
|
||||
' connectionString = $"""
|
||||
' Data Source=(
|
||||
' DESCRIPTION=
|
||||
' ADDRESS_LIST=
|
||||
' (ADDRESS=
|
||||
' (PROTOCOL=TCP)
|
||||
' (HOST={row.Item("SERVER")})
|
||||
' (PORT=1521)
|
||||
' )
|
||||
' )
|
||||
' (CONNECT_DATA=
|
||||
' (SERVER=DEDICATED)
|
||||
' (SERVICE_NAME={row.Item("DATENBANK")})
|
||||
' )
|
||||
' )
|
||||
' );User Id={row.Item("USERNAME")};Password={row.Item("PASSWORD")}
|
||||
' """
|
||||
' Else
|
||||
' csBuilder.DataSource = row.Item("SERVER")
|
||||
' csBuilder.UserID = row.Item("USERNAME")
|
||||
' csBuilder.Password = row.Item("PASSWORD")
|
||||
' csBuilder.PersistSecurityInfo = True
|
||||
' csBuilder.ConnectionTimeout = 120
|
||||
|
||||
' connectionString = csBuilder.ConnectionString
|
||||
' End If
|
||||
' Case Else
|
||||
' Exit Sub
|
||||
' End Select
|
||||
' Next
|
||||
|
||||
' Dim items As New List(Of String)
|
||||
|
||||
' Using adapter As New SqlClient.SqlDataAdapter()
|
||||
' Using conn As New SqlClient.SqlConnection(connectionString)
|
||||
' conn.Open()
|
||||
|
||||
' Using cmd As New SqlClient.SqlCommand(SQLCommand, conn)
|
||||
|
||||
' Dim dataSet As New DataSet()
|
||||
|
||||
' adapter.SelectCommand = cmd
|
||||
' adapter.Fill(dataSet)
|
||||
|
||||
' Dim table = dataSet.Tables(0)
|
||||
|
||||
' For Each row As DataRow In table.Rows
|
||||
' items.Add(row.Item(0))
|
||||
' Next
|
||||
' End Using
|
||||
' End Using
|
||||
' End Using
|
||||
|
||||
|
||||
|
||||
'End Sub
|
||||
|
||||
Sub Load_Controls()
|
||||
Try
|
||||
pnldesigner.Controls.Clear()
|
||||
@ -588,19 +639,26 @@ Public Class frmValidator
|
||||
|
||||
|
||||
sql = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)
|
||||
sqlCnn = New SqlClient.SqlConnection(connectionString)
|
||||
' Try
|
||||
sqlCnn.Open()
|
||||
sqlCmd = New SqlClient.SqlCommand(sql, sqlCnn)
|
||||
adapter.SelectCommand = sqlCmd
|
||||
adapter.Fill(NewDataset)
|
||||
Dim msg As String
|
||||
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()
|
||||
|
||||
'sql = ClassPatterns.ReplaceAllValues(sql, pnldesigner, aktivesDokument)
|
||||
If ClassPatterns.HasOnlySimplePatterns(sql) Then
|
||||
sql = ClassPatterns.ReplaceInternalValues(sql)
|
||||
sql = ClassPatterns.ReplaceControlValues(sql, pnldesigner)
|
||||
|
||||
sqlCnn = New SqlClient.SqlConnection(connectionString)
|
||||
' Try
|
||||
sqlCnn.Open()
|
||||
sqlCmd = New SqlClient.SqlCommand(sql, sqlCnn)
|
||||
adapter.SelectCommand = sqlCmd
|
||||
adapter.Fill(NewDataset)
|
||||
Dim msg As String
|
||||
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
|
||||
ClassLogger.Add(" - Unvorhergesehener Fehler bei GetValues SQL - Fehler: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetValues SQL:")
|
||||
@ -691,6 +749,7 @@ Public Class frmValidator
|
||||
|
||||
pnldesigner.Controls.Add(ctrl)
|
||||
|
||||
LoadSimpleData(ctrl, dr.Item("GUID"))
|
||||
Next
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Controls geladen", False)
|
||||
ClassLogger.Add("", False)
|
||||
@ -705,295 +764,6 @@ Public Class frmValidator
|
||||
|
||||
End Sub
|
||||
|
||||
'Function add_label(CONTROL_ID As Integer, lblname As String, text As String, x As Integer, y As Integer)
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_label - lblname: " & lblname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
' Dim lbl As New Label
|
||||
' lbl.Name = lblname
|
||||
' lbl.Text = text
|
||||
' lbl.AutoSize = True
|
||||
' lbl.Tag = CONTROL_ID
|
||||
' 'lbl.Size = New Size(CInt(lbl.Text.Length * 10), 16)
|
||||
' lbl.Location = New Point(x, y)
|
||||
' pnldesigner.Controls.Add(lbl)
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> LBL: " & lblname & " hinzugefügt", False)
|
||||
'End Function
|
||||
Function add_textbox(CONTROL_ID As Integer, ByVal txtname As String, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal read_only As Boolean, loadindex As Boolean) 'idxName As String,
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_textbox - txtname: " & txtname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
Dim txt As New TextBox
|
||||
txt.Name = txtname
|
||||
txt.Tag = CONTROL_ID
|
||||
If height > 27 Then
|
||||
txt.Multiline = True
|
||||
txt.AcceptsReturn = True
|
||||
Else
|
||||
txt.Multiline = False
|
||||
txt.AcceptsReturn = False
|
||||
End If
|
||||
If read_only = True Then
|
||||
txt.ReadOnly = True
|
||||
txt.TabStop = False
|
||||
'txt.Enabled = False
|
||||
End If
|
||||
txt.Size = New Size(width, height)
|
||||
txt.Location = New Point(x, y)
|
||||
pnldesigner.Controls.Add(txt)
|
||||
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
|
||||
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
|
||||
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
|
||||
If first_control Is Nothing And read_only = False Then
|
||||
first_control = txt
|
||||
End If
|
||||
last_control = txt
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> TXT: " & txtname & " hinzugefügt", False)
|
||||
End Function
|
||||
Function add_ComboBox(CONTROL_ID As Integer, cmbname As String, x As Integer, y As Integer, width As Integer, height As Integer, read_only As Boolean, loadindex As Boolean) 'idxName As String,
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_ComboBox - cmbname: " & cmbname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
Dim cmb As New ComboBox
|
||||
cmb.Name = cmbname
|
||||
cmb.Size = New Size(width, height)
|
||||
cmb.Location = New Point(x, y)
|
||||
cmb.Tag = CONTROL_ID
|
||||
If read_only = True Then
|
||||
cmb.Enabled = False
|
||||
cmb.TabStop = False
|
||||
End If
|
||||
cmb.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
||||
cmb.AutoCompleteSource = AutoCompleteSource.ListItems
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_ComboBox - Get GUID ", False)
|
||||
'Überprüfen ob es eine Auswahllsite gibt
|
||||
Dim ControlID = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, cmbname)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_ComboBox - GUID: " & ControlID, False)
|
||||
If ControlID > 0 Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >>ControlID > 0", False)
|
||||
Dim ConID = Me.TBPM_PROFILE_CONTROLSTableAdapter.cmdgetConnectionID(ControlID)
|
||||
If ConID Is Nothing = False Then
|
||||
Dim commandsql = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> ConID Is Nothing = False", False)
|
||||
If ConID > 0 And commandsql <> "" Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> CConID > 0 And TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)", False)
|
||||
Dim connectionString As String
|
||||
TBDD_CONNECTIONTableAdapter.FillByID(DD_DMSLiteDataSet.TBDD_CONNECTION, ConID)
|
||||
Dim DT As DataTable = DD_DMSLiteDataSet.TBDD_CONNECTION
|
||||
Dim drConnection As DataRow
|
||||
For Each drConnection In DT.Rows
|
||||
Select Case drConnection.Item("SQL_PROVIDER").ToString.ToLower
|
||||
Case "ms-sql"
|
||||
If drConnection.Item("USERNAME") = "WINAUTH" Then
|
||||
connectionString = "Data Source=" & drConnection.Item("SERVER") & ";Initial Catalog=" & drConnection.Item("DATENBANK") & ";Trusted_Connection=True;"
|
||||
Else
|
||||
connectionString = "Data Source=" & drConnection.Item("SERVER") & ";Initial Catalog= " & drConnection.Item("DATENBANK") & ";User Id=" & drConnection.Item("USERNAME") & ";Password=" & drConnection.Item("PASSWORD") & ";"
|
||||
End If
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> ConnString Sql-Server: " & connectionString)
|
||||
Case "oracle"
|
||||
Dim conn As New OracleConnectionStringBuilder
|
||||
Dim connstr As String
|
||||
If drConnection.Item("SERVER") <> "" And drConnection.Item("DATENBANK").GetType.ToString <> "system.dbnull" Then
|
||||
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & drConnection.Item("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
|
||||
drConnection.Item("DATENBANK") & ")));User Id=" & drConnection.Item("USERNAME") & ";Password=" & drConnection.Item("PASSWORD") & ";"
|
||||
Else
|
||||
conn.DataSource = drConnection.Item("SERVER")
|
||||
conn.UserID = drConnection.Item("USERNAME")
|
||||
conn.Password = drConnection.Item("PASSWORD")
|
||||
conn.PersistSecurityInfo = True
|
||||
conn.ConnectionTimeout = 120
|
||||
connstr = conn.ConnectionString
|
||||
End If
|
||||
|
||||
connectionString = connstr
|
||||
Case Else
|
||||
ClassLogger.Add(" - ConnectionType nicht integriert", False)
|
||||
MsgBox("ConnectionType nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!")
|
||||
End Select
|
||||
Next
|
||||
If connectionString Is Nothing = False 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
|
||||
Dim sql As String
|
||||
|
||||
|
||||
sql = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetSQL(ControlID)
|
||||
sqlCnn = New SqlClient.SqlConnection(connectionString)
|
||||
' Try
|
||||
sqlCnn.Open()
|
||||
sqlCmd = New SqlClient.SqlCommand(sql, sqlCnn)
|
||||
adapter.SelectCommand = sqlCmd
|
||||
adapter.Fill(NewDataset)
|
||||
Dim msg As String
|
||||
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()
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unvorhergesehener Fehler bei GetValues SQL - Fehler: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei GetValues SQL:")
|
||||
End Try
|
||||
End If
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Else Row 571", False)
|
||||
End If
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> AListe Handling", False)
|
||||
Dim AListe As String = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetChoiceListName(ControlID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_ComboBox - AListe: " & AListe, False)
|
||||
If AListe Is Nothing = False Then
|
||||
Dim liste = _windream.GetValuesfromAuswahlliste(AListe)
|
||||
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, AListe)
|
||||
End If
|
||||
Else
|
||||
MsgBox("AListe from database is nothing!", MsgBoxStyle.Exclamation, AListe)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
'Die BReite der DropDown-Lsit anpassen
|
||||
Dim iWidestWidth As Integer = 300
|
||||
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 > iWidestWidth Then
|
||||
iWidestWidth = g1.MeasureString(Text, cmb.Font).Width + 30
|
||||
End If
|
||||
g1.Dispose()
|
||||
Next oItem
|
||||
End Using
|
||||
|
||||
'If Me.Items.Count > Me.MaxDropDownItems Then 'Wenn die Scrollleiste angezeigt wird...
|
||||
' iWidestWidth += 15
|
||||
'End If
|
||||
|
||||
cmb.DropDownWidth = Math.Max(iWidestWidth, cmb.Width)
|
||||
pnldesigner.Controls.Add(cmb)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> CMB: " & cmbname & " hinzugefügt", False)
|
||||
AddHandler cmb.SelectedIndexChanged, AddressOf OnCmbselectedIndex
|
||||
If first_control Is Nothing And read_only = False Then
|
||||
first_control = cmb
|
||||
End If
|
||||
last_control = cmb
|
||||
End Function
|
||||
Function add_DTP(CONTROL_ID As Integer, dtpname As String, x As Integer, y As Integer, width As Integer, height As Integer, read_only As Boolean, loadindex As Boolean) 'idxName As String,
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DTP - dtpname: " & dtpname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
Dim dtp As New DateTimePicker
|
||||
dtp.Name = dtpname
|
||||
dtp.Tag = CONTROL_ID
|
||||
dtp.Size = New Size(width, height)
|
||||
dtp.Location = New Point(x, y)
|
||||
dtp.Format = DateTimePickerFormat.Short
|
||||
If read_only = True Then
|
||||
dtp.Enabled = True
|
||||
dtp.TabStop = False
|
||||
End If
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DTP - Get GUID ", False)
|
||||
'Überprüfen ob es eine Auswahllsite gibt
|
||||
Dim guid = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, dtpname)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DTP - GUID: " & guid.ToString, False)
|
||||
|
||||
pnldesigner.Controls.Add(dtp)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> CMB: " & dtpname & " hinzugefügt", False)
|
||||
AddHandler dtp.ValueChanged, AddressOf OnDTPValueChanged
|
||||
If first_control Is Nothing And read_only = False Then
|
||||
first_control = dtp
|
||||
End If
|
||||
last_control = dtp
|
||||
End Function
|
||||
Function add_DGV(CONTROL_ID As Integer, dgvname As String, height As Integer, width As Integer, x As Integer, y As Integer, read_only As Boolean, loadindex As Boolean) 'idxName As String,
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DGV - dgvname: " & dgvname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
Dim dgv As New DataGridView
|
||||
dgv.AllowUserToOrderColumns = False
|
||||
dgv.Name = dgvname
|
||||
dgv.Tag = CONTROL_ID
|
||||
dgv.Size = New Size(width, height)
|
||||
dgv.Location = New Point(x, y)
|
||||
dgv.AlternatingRowsDefaultCellStyle.BackColor = Color.Aqua
|
||||
Dim col As New DataGridViewTextBoxColumn
|
||||
col.HeaderText = ""
|
||||
col.Name = "column1"
|
||||
col.Width = dgv.Width - 30
|
||||
dgv.Columns.Add(col)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DGV - Get GUID ", False)
|
||||
'Überprüfen ob es eine Auswahllsite gibt
|
||||
Dim guid = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, dgvname)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_DGV - GUID: " & guid.ToString, False)
|
||||
'jkjjjk
|
||||
If guid > 0 Then
|
||||
|
||||
End If
|
||||
pnldesigner.Controls.Add(dgv)
|
||||
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> dgv: " & dgvname & " hinzugefügt", False)
|
||||
If first_control Is Nothing And read_only = False Then
|
||||
first_control = dgv
|
||||
End If
|
||||
last_control = dgv
|
||||
End Function
|
||||
|
||||
Function add_TABLE(CONTROL_ID As Integer, tableName As String, x As Integer, y As Integer, vwidth As Integer, vheight As Integer, read_only As Boolean)
|
||||
Dim table As New DataGridView
|
||||
table.Name = tableName
|
||||
table.Size = New Size(vwidth, vheight)
|
||||
table.Cursor = Cursors.Hand
|
||||
table.Tag = CONTROL_ID
|
||||
table.Location = New Point(x, y)
|
||||
table.AllowUserToAddRows = True
|
||||
table.AllowUserToDeleteRows = False
|
||||
table.AllowUserToResizeColumns = False
|
||||
table.AllowUserToResizeRows = False
|
||||
table.AlternatingRowsDefaultCellStyle.BackColor = Color.Aqua
|
||||
'Columns laden
|
||||
Dim guid = TBPM_PROFILE_CONTROLSTableAdapter.cmdGetGUID(CURRENT_ProfilGUID, tableName)
|
||||
If guid > 0 Then
|
||||
TBPM_CONTROL_TABLETableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_CONTROL_TABLE, guid)
|
||||
Dim DT As DataTable = Me.DD_DMSLiteDataSet.TBPM_CONTROL_TABLE
|
||||
If DT.Rows.Count > 0 Then
|
||||
For Each Row As DataRow In DT.Rows
|
||||
Dim col As New DataGridViewTextBoxColumn
|
||||
col.HeaderText = Row.Item("SPALTEN_HEADER")
|
||||
col.Name = Row.Item("SPALTENNAME")
|
||||
col.Width = Row.Item("SPALTENBREITE")
|
||||
table.Columns.Add(col)
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
' table.AutoResizeColumns()
|
||||
|
||||
pnldesigner.Controls.Add(table)
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Tabelle: " & tableName & " hinzugefügt", False)
|
||||
If first_control Is Nothing And read_only = False Then
|
||||
first_control = table
|
||||
End If
|
||||
last_control = table
|
||||
End Function
|
||||
|
||||
Function add_Checkbox(CONTROL_ID As Integer, chkname As String, text As String, x As Integer, y As Integer, read_only As Boolean, loadindex As Boolean)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> In add_label - lblname: " & chkname & " x/y: " & x.ToString & "/" & y.ToString, False)
|
||||
Dim chk As New CheckBox
|
||||
chk.Name = chkname
|
||||
chk.Text = text
|
||||
chk.Tag = CONTROL_ID
|
||||
chk.AutoSize = True
|
||||
'chk.Size = New Size(CInt(chk.Text.Length * 15), 20)
|
||||
chk.Location = New Point(x, y)
|
||||
pnldesigner.Controls.Add(chk)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> CHK: " & chkname & " hinzugefügt", False)
|
||||
End Function
|
||||
Sub Clear_all_Input()
|
||||
For Each inctrl As Control In Me.pnldesigner.Controls
|
||||
Dim Type As String = inctrl.GetType.ToString
|
||||
@ -1028,27 +798,6 @@ Public Class frmValidator
|
||||
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs)
|
||||
Dim box As TextBox = sender
|
||||
box.BackColor = Color.White
|
||||
'If box.Text <> String.Empty And me_closing = False And _Indexe_Loaded = True Then
|
||||
' If CheckValueExists(box) = False Then
|
||||
' box.Text = ""
|
||||
' box.Focus()
|
||||
' frmError.ShowDialog()
|
||||
' End If
|
||||
'End If
|
||||
'If navStep Is Nothing = False Then
|
||||
' Select Case navStep
|
||||
' Case "first"
|
||||
' MovePosition(0)
|
||||
' Case "previous"
|
||||
' MovePosition(aktIndex - 1)
|
||||
' Case "next"
|
||||
' MovePosition(aktIndex + 1)
|
||||
' Case "last"
|
||||
' MovePosition(Anzahl_ValDoks - 1)
|
||||
' End Select
|
||||
' first_control.Focus()
|
||||
|
||||
'End If
|
||||
End Sub
|
||||
Public Sub OnTextBoxKeyUp(sender As Object, e As KeyEventArgs)
|
||||
Dim box As TextBox = sender
|
||||
@ -1065,33 +814,37 @@ Public Class frmValidator
|
||||
Dim displayboxname = ROW.Item(0).ToString
|
||||
If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then
|
||||
Dim sql_Statement = ROW.Item(2)
|
||||
' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
' einen Regulären Ausdruck laden
|
||||
Dim regulärerAusdruck As Text.RegularExpressions.Regex = New Text.RegularExpressions.Regex(preg)
|
||||
' die Vorkommen im SQL-String auslesen
|
||||
Dim elemente As Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(sql_Statement)
|
||||
'####
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each element As Text.RegularExpressions.Match In elemente
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3)
|
||||
Dim input_value
|
||||
|
||||
If MyPattern.Contains(ClassControlCreator.PREFIX_TEXTBOX) Then
|
||||
Dim txt As TextBox = CType(pnldesigner.Controls(MyPattern), TextBox)
|
||||
input_value = txt.Text
|
||||
ElseIf MyPattern.Contains(ClassControlCreator.PREFIX_COMBOBOX) Then
|
||||
Dim cmb As ComboBox = CType(pnldesigner.Controls(MyPattern), ComboBox)
|
||||
input_value = cmb.Text
|
||||
End If
|
||||
sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
|
||||
End Try
|
||||
|
||||
Next
|
||||
sql_Statement = ClassPatterns.ReplaceAllValues(sql_Statement, pnldesigner, aktivesDokument, CURRENT_USER_PRENAME, CURRENT_USER_SURNAME, CURRENT_USER_SHORTNAME, CURRENT_USER_EMAIL)
|
||||
|
||||
'' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
'' einen Regulären Ausdruck laden
|
||||
'Dim regulärerAusdruck As Regex = New Regex(preg)
|
||||
'' die Vorkommen im SQL-String auslesen
|
||||
'Dim elemente As Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(sql_Statement)
|
||||
''####
|
||||
'' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
'For Each element As Text.RegularExpressions.Match In elemente
|
||||
' Try
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
' Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3)
|
||||
' Dim input_value
|
||||
|
||||
' If MyPattern.Contains(ClassControlCreator.PREFIX_TEXTBOX) Then
|
||||
' Dim txt As TextBox = CType(pnldesigner.Controls(MyPattern), TextBox)
|
||||
' input_value = txt.Text
|
||||
' ElseIf MyPattern.Contains(ClassControlCreator.PREFIX_COMBOBOX) Then
|
||||
' Dim cmb As ComboBox = CType(pnldesigner.Controls(MyPattern), ComboBox)
|
||||
' input_value = cmb.Text
|
||||
' End If
|
||||
' sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value)
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
|
||||
' End Try
|
||||
|
||||
'Next
|
||||
_dependingControl_in_action = True
|
||||
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
|
||||
_dependingControl_in_action = False
|
||||
@ -1183,37 +936,39 @@ Public Class frmValidator
|
||||
For Each ROW As DataRow In DT.Rows
|
||||
Try
|
||||
Dim displayboxname = ROW.Item(0).ToString
|
||||
If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then
|
||||
Dim sql_Statement = ROW.Item(2)
|
||||
' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
' einen Regulären Ausdruck laden
|
||||
Dim regulärerAusdruck As Text.RegularExpressions.Regex = New Text.RegularExpressions.Regex(preg)
|
||||
' die Vorkommen im SQL-String auslesen
|
||||
Dim elemente As Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(sql_Statement)
|
||||
'####
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each element As Text.RegularExpressions.Match In elemente
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3)
|
||||
Dim input_value
|
||||
If Not IsDBNull(ROW.Item("CONNECTION_ID")) And Not IsDBNull(ROW.Item("SQL_UEBERPRUEFUNG")) Then
|
||||
Dim sql_Statement = ROW.Item("SQL_UEBERPRUEFUNG")
|
||||
|
||||
If MyPattern.Contains(ClassControlCreator.PREFIX_TEXTBOX) Then
|
||||
Dim txt As TextBox = CType(pnldesigner.Controls(MyPattern), TextBox)
|
||||
input_value = txt.Text
|
||||
ElseIf MyPattern.Contains(ClassControlCreator.PREFIX_COMBOBOX) Then
|
||||
Dim cmb1 As ComboBox = CType(pnldesigner.Controls(MyPattern), ComboBox)
|
||||
input_value = cmb1.Text
|
||||
End If
|
||||
sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value)
|
||||
sql_Statement = ClassPatterns.ReplaceAllValues(sql_Statement, pnldesigner, aktivesDokument, CURRENT_USER_PRENAME, CURRENT_USER_SURNAME, CURRENT_USER_SHORTNAME, CURRENT_USER_EMAIL)
|
||||
'' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
'' einen Regulären Ausdruck laden
|
||||
'Dim regulärerAusdruck As Text.RegularExpressions.Regex = New Text.RegularExpressions.Regex(preg)
|
||||
'' die Vorkommen im SQL-String auslesen
|
||||
'Dim elemente As Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(sql_Statement)
|
||||
''####
|
||||
'' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
'For Each element As Text.RegularExpressions.Match In elemente
|
||||
' Try
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
' Dim MyPattern = element.Value.Substring(2, element.Value.Length - 3)
|
||||
' Dim input_value
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result ComboBox - ERROR: " & ex.Message)
|
||||
End Try
|
||||
' If MyPattern.Contains(ClassControlCreator.PREFIX_TEXTBOX) Then
|
||||
' Dim txt As TextBox = CType(pnldesigner.Controls(MyPattern), TextBox)
|
||||
' input_value = txt.Text
|
||||
' ElseIf MyPattern.Contains(ClassControlCreator.PREFIX_COMBOBOX) Then
|
||||
' Dim cmb1 As ComboBox = CType(pnldesigner.Controls(MyPattern), ComboBox)
|
||||
' input_value = cmb1.Text
|
||||
' End If
|
||||
' sql_Statement = sql_Statement.ToString.Replace(element.Value, input_value)
|
||||
|
||||
Next
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">>> sql_Statement after replacement: " & sql_Statement)
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result ComboBox - ERROR: " & ex.Message)
|
||||
' End Try
|
||||
|
||||
'Next
|
||||
'If LogErrorsOnly = False Then ClassLogger.Add(">>> sql_Statement after replacement: " & sql_Statement)
|
||||
|
||||
_dependingControl_in_action = True
|
||||
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
|
||||
@ -1571,6 +1326,8 @@ Public Class frmValidator
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Viewer geladen", False)
|
||||
|
||||
|
||||
|
||||
FillIndexValues()
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexmaske geladen", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add("", False)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user