diff --git a/Controls.DocumentViewer/DocumentViewer.Designer.vb b/Controls.DocumentViewer/DocumentViewer.Designer.vb index 895e1d6f..5a098dc6 100644 --- a/Controls.DocumentViewer/DocumentViewer.Designer.vb +++ b/Controls.DocumentViewer/DocumentViewer.Designer.vb @@ -38,7 +38,7 @@ Partial Class DocumentViewer Me.ToolStripSeparator6 = New System.Windows.Forms.ToolStripSeparator() Me.btnFirstPage = New System.Windows.Forms.ToolStripButton() Me.btnPreviousPage = New System.Windows.Forms.ToolStripButton() - Me.tbCurrentPage = New System.Windows.Forms.ToolStripTextBox() + Me.txtCurrentPage = New System.Windows.Forms.ToolStripTextBox() Me.lblPageCount = New System.Windows.Forms.ToolStripLabel() Me.btnNextPage = New System.Windows.Forms.ToolStripButton() Me.btnLastPage = New System.Windows.Forms.ToolStripButton() @@ -136,7 +136,7 @@ Partial Class DocumentViewer Me.mainToolStrip.Font = New System.Drawing.Font("Tahoma", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.mainToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden Me.mainToolStrip.ImageScalingSize = New System.Drawing.Size(24, 24) - Me.mainToolStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.btnPrint, Me.btnFitWidth, Me.btnFitPage, Me.ToolStripSeparator2, Me.btnMouseMode, Me.ToolStripSeparator6, Me.btnFirstPage, Me.btnPreviousPage, Me.tbCurrentPage, Me.lblPageCount, Me.btnNextPage, Me.btnLastPage, Me.ToolStripSeparator1, Me.btnZoomOut, Me.cbZoom, Me.btnZoomIn, Me.ToolStripSeparator5, Me.btnRotateLeft, Me.btnRotateRight, Me.btnFlipX, Me.btnFlipY, Me.ToolStripSeparator4, Me.btnSettings}) + Me.mainToolStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.btnPrint, Me.btnFitWidth, Me.btnFitPage, Me.ToolStripSeparator2, Me.btnMouseMode, Me.ToolStripSeparator6, Me.btnFirstPage, Me.btnPreviousPage, Me.txtCurrentPage, Me.lblPageCount, Me.btnNextPage, Me.btnLastPage, Me.ToolStripSeparator1, Me.btnZoomOut, Me.cbZoom, Me.btnZoomIn, Me.ToolStripSeparator5, Me.btnRotateLeft, Me.btnRotateRight, Me.btnFlipX, Me.btnFlipY, Me.ToolStripSeparator4, Me.btnSettings}) Me.mainToolStrip.Location = New System.Drawing.Point(0, 0) Me.mainToolStrip.Name = "mainToolStrip" Me.mainToolStrip.Size = New System.Drawing.Size(1015, 31) @@ -254,10 +254,10 @@ Partial Class DocumentViewer ' 'tbCurrentPage ' - Me.tbCurrentPage.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.tbCurrentPage.Name = "tbCurrentPage" - Me.tbCurrentPage.Size = New System.Drawing.Size(40, 31) - Me.tbCurrentPage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right + Me.txtCurrentPage.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.txtCurrentPage.Name = "tbCurrentPage" + Me.txtCurrentPage.Size = New System.Drawing.Size(40, 31) + Me.txtCurrentPage.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Right ' 'lblPageCount ' @@ -438,7 +438,7 @@ Partial Class DocumentViewer Friend WithEvents ToolStripSeparator6 As ToolStripSeparator Friend WithEvents btnFirstPage As ToolStripButton Friend WithEvents btnPreviousPage As ToolStripButton - Friend WithEvents tbCurrentPage As ToolStripTextBox + Friend WithEvents txtCurrentPage As ToolStripTextBox Friend WithEvents lblPageCount As ToolStripLabel Friend WithEvents btnNextPage As ToolStripButton Friend WithEvents btnLastPage As ToolStripButton diff --git a/Controls.DocumentViewer/DocumentViewer.vb b/Controls.DocumentViewer/DocumentViewer.vb index e0cd5783..5fac9b84 100644 --- a/Controls.DocumentViewer/DocumentViewer.vb +++ b/Controls.DocumentViewer/DocumentViewer.vb @@ -323,7 +323,7 @@ Public Class DocumentViewer btnPrint.Enabled = False btnFirstPage.Enabled = False btnPreviousPage.Enabled = False - tbCurrentPage.Enabled = False + txtCurrentPage.Enabled = False lblPageCount.Enabled = False btnNextPage.Enabled = False btnLastPage.Enabled = False @@ -336,14 +336,14 @@ Public Class DocumentViewer btnRotateRight.Enabled = False btnFlipX.Enabled = False btnFlipY.Enabled = False - tbCurrentPage.Text = "0" + txtCurrentPage.Text = "0" lblPageCount.Text = "/ 0" cbZoom.SelectedIndex = -1 Else btnPrint.Enabled = True btnFirstPage.Enabled = True btnPreviousPage.Enabled = True - tbCurrentPage.Enabled = True + txtCurrentPage.Enabled = True lblPageCount.Enabled = True btnNextPage.Enabled = True btnLastPage.Enabled = True @@ -376,9 +376,9 @@ Public Class DocumentViewer GdViewer.DisplayLastPage() End Sub - Private Sub tbCurrentPage_Leave(ByVal sender As System.Object, ByVal e As EventArgs) Handles tbCurrentPage.Leave + Private Sub tbCurrentPage_Leave(ByVal sender As System.Object, ByVal e As EventArgs) Handles txtCurrentPage.Leave Dim page As Integer = 0 - If Integer.TryParse(tbCurrentPage.Text, page) Then + If Integer.TryParse(txtCurrentPage.Text, page) Then If page > 0 And page <= GdViewer.PageCount Then GdViewer.DisplayPage(page) UpdateaNavigationToolbar() @@ -565,24 +565,25 @@ Public Class DocumentViewer End Sub Private Sub UpdateaNavigationToolbar() - Dim currentPage As Integer = GdViewer.CurrentPage() - tbCurrentPage.Text = currentPage.ToString() - lblPageCount.Text = "/ " & GdViewer.PageCount.ToString() - If currentPage = 1 Then - btnFirstPage.Enabled = False - btnPreviousPage.Enabled = False - Else - btnFirstPage.Enabled = True - btnPreviousPage.Enabled = True - End If - If currentPage = GdViewer.PageCount Then - btnNextPage.Enabled = False - btnLastPage.Enabled = False - Else - btnNextPage.Enabled = True - btnLastPage.Enabled = True - End If - cbZoom.Text = String.Format(CultureInfo.InvariantCulture, "{0:#0.##%}", GdViewer.Zoom) + Try + Dim oCurrentZoom As Double = GdViewer.Zoom + Dim oCurrentPage As Integer = GdViewer.CurrentPage() + Dim oPageCount As Integer = GdViewer.PageCount + txtCurrentPage.Text = oCurrentPage.ToString() + lblPageCount.Text = "/ " & GdViewer.PageCount.ToString() + + If oCurrentPage = 1 Or oCurrentPage = oPageCount Then + btnFirstPage.Enabled = False + btnPreviousPage.Enabled = False + Else + btnFirstPage.Enabled = True + btnPreviousPage.Enabled = True + End If + + cbZoom.Text = String.Format(format:="{0:#0.##%}", arg0:=oCurrentZoom) + Catch ex As Exception + _logger.Error(ex) + End Try End Sub Private Sub btnFitWidth_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnFitWidth.Click diff --git a/Controls.DocumentViewer/My Project/AssemblyInfo.vb b/Controls.DocumentViewer/My Project/AssemblyInfo.vb index 376da049..914e3d82 100644 --- a/Controls.DocumentViewer/My Project/AssemblyInfo.vb +++ b/Controls.DocumentViewer/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj index 1889a576..a9086022 100644 --- a/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj +++ b/GUIs.ClipboardWatcher/ClipboardWatcher.vbproj @@ -114,6 +114,7 @@ + diff --git a/GUIs.ClipboardWatcher/My Project/AssemblyInfo.vb b/GUIs.ClipboardWatcher/My Project/AssemblyInfo.vb index e2466217..05f64ef8 100644 --- a/GUIs.ClipboardWatcher/My Project/AssemblyInfo.vb +++ b/GUIs.ClipboardWatcher/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/GUIs.ClipboardWatcher/ProfileFilter.vb b/GUIs.ClipboardWatcher/ProfileFilter.vb index 0e17763f..2069e544 100644 --- a/GUIs.ClipboardWatcher/ProfileFilter.vb +++ b/GUIs.ClipboardWatcher/ProfileFilter.vb @@ -361,19 +361,25 @@ Public Class ProfileFilter For Each oRow As DataRow In oDTDataSearches.Rows Dim oCountCommand = String.Empty + Dim oCountConnectionId = String.Empty Try oCountCommand = NotNull(oRow.Item("COUNT_COMMAND"), String.Empty) + oCountConnectionId = NotNull(oRow.Item("CONN_ID"), 0) If oCountCommand = String.Empty Then - _Logger.Debug("oCountCommand = String.Empty ==> Continue for") + _Logger.Debug("oCountCommand = String.Empty ==> Continue for") Continue For End If oCountCommand = oPatterns.ReplaceInternalValues(oCountCommand) oCountCommand = oPatterns.ReplaceUserValues(oCountCommand, User) oCountCommand = oPatterns.ReplaceClipboardContents(oCountCommand, ClipboardContents) + _Logger.Debug($"Count-Command DATA before execute: [{oCountCommand}]") - oResultData += NotNull(Of Integer)(Database.GetScalarValue(oCountCommand), 0) + + Dim oConnectionString = ProfileUtils.GetConnectionString(Database, oCountConnectionId) + + oResultData += NotNull(Of Integer)(Database.GetScalarValueWithConnection(oCountCommand, oConnectionString), 0) Catch ex As Exception _Logger.Warn("Invalid SQL Query for Counting Data in Profile {0}: {1}", oProfile.Guid, oCountCommand) End Try diff --git a/GUIs.ClipboardWatcher/ProfileSearches.vb b/GUIs.ClipboardWatcher/ProfileSearches.vb index 9b23e656..a00f537e 100644 --- a/GUIs.ClipboardWatcher/ProfileSearches.vb +++ b/GUIs.ClipboardWatcher/ProfileSearches.vb @@ -49,7 +49,7 @@ Public Class ProfileSearches oSQL = oPatterns.ReplaceInternalValues(oSQL) oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents) - Dim oConnectionString = GetConnectionString(oConnectionId) + Dim oConnectionString = ProfileUtils.GetConnectionString(_Environment.Database, oConnectionId) Dim oDatatable As DataTable = _Environment.Database.GetDatatableWithConnection(oSQL, oConnectionString) If oDatatable Is Nothing Then @@ -72,26 +72,6 @@ Public Class ProfileSearches Return oDocSearches End Function - Private Function GetConnectionString(ConnectionId As Integer) As String - Dim oDatatable As DataTable = _Environment.Database.GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {ConnectionId}") - - If oDatatable.Rows.Count > 0 Then - Dim oRow As DataRow = oDatatable.Rows.Item(0) - - Select Case oRow.Item("SQL_PROVIDER") - Case "MS-SQL" - Dim oConnectionString = MSSQLServer.GetConnectionString(oRow.Item("SERVER"), oRow.Item("DATENBANK"), oRow.Item("USERNAME"), oRow.Item("PASSWORD")) - Return oConnectionString - - Case Else - Return Nothing - - End Select - Else - Return Nothing - End If - End Function - Public Async Function LoadDataSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search)) Return Await Task.Run(Function() Return DoLoadDataSearches(ProfileId) @@ -119,7 +99,7 @@ Public Class ProfileSearches oSQL = oPatterns.ReplaceInternalValues(oSQL) oSQL = oPatterns.ReplaceClipboardContents(oSQL, _Params.ClipboardContents) - Dim oConnectionString = GetConnectionString(oConnectionId) + Dim oConnectionString = ProfileUtils.GetConnectionString(_Environment.Database, oConnectionId) Dim oDatatable As DataTable = _Environment.Database.GetDatatableWithConnection(oSQL, oConnectionString) If oDatatable Is Nothing Then diff --git a/GUIs.ClipboardWatcher/ProfileUtils.vb b/GUIs.ClipboardWatcher/ProfileUtils.vb new file mode 100644 index 00000000..f3dcc7e1 --- /dev/null +++ b/GUIs.ClipboardWatcher/ProfileUtils.vb @@ -0,0 +1,23 @@ +Imports DigitalData.Modules.Database + +Public Class ProfileUtils + Public Shared Function GetConnectionString(Database As MSSQLServer, ConnectionId As Integer) As String + Dim oDatatable As DataTable = Database.GetDatatable($"SELECT * FROM TBDD_CONNECTION WHERE GUID = {ConnectionId}") + + If oDatatable.Rows.Count > 0 Then + Dim oRow As DataRow = oDatatable.Rows.Item(0) + + Select Case oRow.Item("SQL_PROVIDER") + Case "MS-SQL" + Dim oConnectionString = Database.GetConnectionString(oRow.Item("SERVER"), oRow.Item("DATENBANK"), oRow.Item("USERNAME"), oRow.Item("PASSWORD")) + Return oConnectionString + + Case Else + Return Nothing + + End Select + Else + Return Nothing + End If + End Function +End Class diff --git a/GUIs.Common/Constants.vb b/GUIs.Common/Constants.vb index 268c2f34..ba999971 100644 --- a/GUIs.Common/Constants.vb +++ b/GUIs.Common/Constants.vb @@ -1,3 +1,8 @@ Public Class Constants Public Const NO_ROW_HANDLE = -1 + + Public Shared ReadOnly MESSAGE_TOO_MANY_SEARCHES = "You have more than three searches configured. This Window will only show the first three result lists!" + Public Shared ReadOnly MESSAGE_ERROR_IN_SEARCHES = $"An error occurred while executing searches or no searches were found!{vbNewLine} + Please check the SQL Queries for errors and if the correct connection was configured.{vbNewLine}{vbNewLine} + For more information check the Logfile." End Class diff --git a/GUIs.Common/DataResultList/frmDataResultList.vb b/GUIs.Common/DataResultList/frmDataResultList.vb index 1969f5c7..7ccbf02c 100644 --- a/GUIs.Common/DataResultList/frmDataResultList.vb +++ b/GUIs.Common/DataResultList/frmDataResultList.vb @@ -94,13 +94,21 @@ Public Class frmDataResultList CreateDataGrid(GridView3, oResult.Datatable) Case Else - MessageBox.Show("You have more than three searches configured. This Window will only show the first three result lists!") + MessageBox.Show(Constants.MESSAGE_TOO_MANY_SEARCHES) Exit For End Select Next ' Hide Grids depending on Result count Select Case _ResultLists.Count + Case 0 + SplitContainerControl1.SetPanelCollapsed(True) + SplitContainerControl2.SetPanelCollapsed(True) + + SwitchMainContainerHorizontal.Enabled = False + SwitchDetailContainerHorizontal.Enabled = False + + MessageBox.Show(Constants.MESSAGE_ERROR_IN_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Case 1 SplitContainerControl1.SetPanelCollapsed(True) SplitContainerControl2.SetPanelCollapsed(True) diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb index 846afc61..6faa0232 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb @@ -102,7 +102,7 @@ Public Class frmDocumentResultList UpdateGridHeader(index, oResult.Datatable.Rows.Count) Case Else - MessageBox.Show("You have more than three searches configured. This Window will only show the first three result lists!", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + MessageBox.Show(Constants.MESSAGE_TOO_MANY_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Exit For End Select Next @@ -116,7 +116,7 @@ Public Class frmDocumentResultList SwitchMainContainerHorizontal.Enabled = False SwitchDetailContainerHorizontal.Enabled = False - MessageBox.Show("No Searches found.", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + MessageBox.Show(Constants.MESSAGE_ERROR_IN_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Case 1 SplitContainerControl1.SetPanelCollapsed(True) SplitContainerControl2.SetPanelCollapsed(True) diff --git a/GUIs.Common/My Project/AssemblyInfo.vb b/GUIs.Common/My Project/AssemblyInfo.vb index bbd0aea3..f5c56c88 100644 --- a/GUIs.Common/My Project/AssemblyInfo.vb +++ b/GUIs.Common/My Project/AssemblyInfo.vb @@ -12,7 +12,7 @@ Imports System.Runtime.InteropServices - + @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/GUIs.Common/My Project/licenses.licx b/GUIs.Common/My Project/licenses.licx index e69de29b..d4cc1df5 100644 --- a/GUIs.Common/My Project/licenses.licx +++ b/GUIs.Common/My Project/licenses.licx @@ -0,0 +1,2 @@ +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/GUIs.Test.DocumentViewerTest/GUIs.Test.DocumentViewerTest.vbproj b/GUIs.Test.DocumentViewerTest/GUIs.Test.DocumentViewerTest.vbproj index a5eb0cf3..627dc581 100644 --- a/GUIs.Test.DocumentViewerTest/GUIs.Test.DocumentViewerTest.vbproj +++ b/GUIs.Test.DocumentViewerTest/GUIs.Test.DocumentViewerTest.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/GUIs.Test.DocumentViewerTest/packages.config b/GUIs.Test.DocumentViewerTest/packages.config index d7bc5b9d..f8dbc83e 100644 --- a/GUIs.Test.DocumentViewerTest/packages.config +++ b/GUIs.Test.DocumentViewerTest/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj index 09df2191..56a0f9f3 100644 --- a/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj +++ b/GUIs.Test.ZUGFeRDTest/ZUGFeRDTest.vbproj @@ -52,7 +52,7 @@ - ..\packages\NLog.4.7.0\lib\net45\NLog.dll + ..\packages\NLog.4.7.2\lib\net45\NLog.dll diff --git a/GUIs.Test.ZUGFeRDTest/packages.config b/GUIs.Test.ZUGFeRDTest/packages.config index 9df4a30e..20d7a800 100644 --- a/GUIs.Test.ZUGFeRDTest/packages.config +++ b/GUIs.Test.ZUGFeRDTest/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Modules.Database/MSSQLServer.vb b/Modules.Database/MSSQLServer.vb index fefaf71a..b9116d80 100644 --- a/Modules.Database/MSSQLServer.vb +++ b/Modules.Database/MSSQLServer.vb @@ -72,15 +72,11 @@ Public Class MSSQLServer Private Function GetSQLConnection(ConnectionString As String) As SqlConnection Try - Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = ConnectionString} Dim oConnection As New SqlConnection(ConnectionString) oConnection.Open() - Try - Dim oConnectionString = ConnectionString.Replace(oBuilder.Password, "XXXXX") - _Logger.Debug($"Following Connectionstring is open: {oConnectionString}") - Catch ex As Exception - End Try + Dim oMaskedConnectionString = MaskConnectionString(ConnectionString) + _Logger.Debug("The Following Connection is open: {0}", oMaskedConnectionString) Return oConnection Catch ex As Exception @@ -90,6 +86,17 @@ Public Class MSSQLServer End Try End Function + Private Function MaskConnectionString(ConnectionString As String) As String + Try + Dim oBuilder As New SqlConnectionStringBuilder() With {.ConnectionString = ConnectionString} + Dim oConnectionString = ConnectionString.Replace(oBuilder.Password, "XXXXX") + Return oConnectionString + Catch ex As Exception + _Logger.Error(ex) + Return "Invalid ConnectionString" + End Try + End Function + ''' ''' Returns a datatable for a sql-statement ''' @@ -101,7 +108,7 @@ Public Class MSSQLServer Return Nothing End If - _Logger.Debug("GetDatatable: {0}", SqlCommand) + _Logger.Debug("Running Query: {0}", SqlCommand) Using oConnection = GetSQLConnection() Using oSQLCOmmand = oConnection.CreateCommand() @@ -130,7 +137,8 @@ Public Class MSSQLServer If TestCanConnect(ConnectionString) = False Then Return Nothing End If - _Logger.Debug("GetDatatableWithConnection: {0}", SqlCommand) + + _Logger.Debug("Running Query: {0}", SqlCommand) Using oConnection = GetSQLConnection(ConnectionString) Using oSQLCOmmand = oConnection.CreateCommand() @@ -145,7 +153,9 @@ Public Class MSSQLServer End Using Catch ex As Exception _Logger.Error(ex) - _Logger.Warn("sqlcommand: " & SqlCommand) + _Logger.Warn("GetDatatableWithConnection failed with:") + _Logger.Warn("ConnectionString: ") + _Logger.Warn("SQL Query: " & SqlCommand) Return Nothing End Try End Function @@ -166,8 +176,8 @@ Public Class MSSQLServer If TestCanConnect() = False Then Return Nothing End If - _Logger.Debug("ExecuteNonQuery: {0}", SQLCommand) + _Logger.Debug("ExecuteNonQuery: Running Query [{0}]", SQLCommand) Using oConnection = GetSQLConnection() Using oSQLCOmmand = oConnection.CreateCommand() @@ -195,8 +205,7 @@ Public Class MSSQLServer SQLcommand = SQLconnect.CreateCommand 'Update Last Created Record in Foo SQLcommand.CommandText = pSQLCommand - _Logger.Debug("ExecuteNonQueryCS: {0}", SQLcommand.CommandText) - + _Logger.Debug("Execute_non_Query_ConStr Created: " & pSQLCommand) SQLcommand.ExecuteNonQuery() SQLcommand.Dispose() SQLconnect.Close() @@ -226,7 +235,8 @@ Public Class MSSQLServer If TestCanConnect() = False Then Return Nothing End If - _Logger.Debug("GetScalarValue: {0}", SQLCommand) + + _Logger.Debug("GetScalarValue: Running Query [{0}]", SQLCommand) Using oConnection As SqlConnection = GetSQLConnection() Using oSQLCOmmand = oConnection.CreateCommand() @@ -247,13 +257,36 @@ Public Class MSSQLServer Return GetScalarValue(SQLQuery, _Timeout) End Function + Public Function GetScalarValueWithConnection(SQLCommand As String, ConnectionString As String) As Object + Try + If TestCanConnect(ConnectionString) = False Then + Return Nothing + End If + + _Logger.Debug("GetScalarValue: Running Query [{0}]", SQLCommand) + + Using oConnection As SqlConnection = GetSQLConnection() + Using oSQLCOmmand = oConnection.CreateCommand() + oSQLCOmmand.CommandText = SQLCommand + oSQLCOmmand.CommandTimeout = _Timeout + Dim oResult As Object = oSQLCOmmand.ExecuteScalar() + Return oResult + End Using + End Using + Catch ex As Exception + _Logger.Error(ex) + _Logger.Warn("SQLQuery: " & SQLCommand) + Return Nothing + End Try + End Function + Public Function GetScalarValue(SQLCommand As SqlCommand, OutputParameter As String, Timeout As Integer) As Object Try If TestCanConnect() = False Then Return Nothing End If - _Logger.Debug("GetScalarValue: {0}", SQLCommand) + _Logger.Debug("Running Query: {0}", SQLCommand) If SQLCommand.CommandText.Contains(" ") Then SQLCommand.CommandType = CommandType.Text @@ -290,7 +323,7 @@ Public Class MSSQLServer SQLcommand = SQLconnect.CreateCommand 'Update Last Created Record in Foo SQLcommand.CommandText = pSQLCommand - _Logger.Debug("GetScalarValueConStr Scalar: " & pSQLCommand) + _Logger.Debug("Execute_Scalar_ConStr Scalar: " & pSQLCommand) result = SQLcommand.ExecuteScalar() SQLcommand.Dispose() SQLconnect.Close() @@ -315,7 +348,8 @@ Public Class MSSQLServer If TestCanConnect() = False Then Exit Sub End If - _Logger.Debug("NewExecuteNonQueryAsync: " & SqlCommand) + + _Logger.Debug("Running Query: {0}", SqlCommand) Try Dim oCallback As New AsyncCallback(AddressOf NewExecuteNonQueryAsync_Callback) diff --git a/Modules.Database/My Project/AssemblyInfo.vb b/Modules.Database/My Project/AssemblyInfo.vb index 173eecc4..b393fccb 100644 --- a/Modules.Database/My Project/AssemblyInfo.vb +++ b/Modules.Database/My Project/AssemblyInfo.vb @@ -32,4 +32,4 @@ Imports System.Runtime.InteropServices ' - + diff --git a/Modules.Patterns/Patterns.vb b/Modules.Patterns/Patterns.vb index 960771dc..ac3f7aca 100644 --- a/Modules.Patterns/Patterns.vb +++ b/Modules.Patterns/Patterns.vb @@ -41,6 +41,12 @@ Public Class ClassPatterns Public Const MAX_TRY_COUNT = 100 + Public ReadOnly Property PatternRegex As Regex + Get + Return _Regex + End Get + End Property + Private _Logger As Logger Private _LogConfig As LogConfig diff --git a/SQLEditor/My Project/licenses.licx b/SQLEditor/My Project/licenses.licx new file mode 100644 index 00000000..d7eba39b --- /dev/null +++ b/SQLEditor/My Project/licenses.licx @@ -0,0 +1,2 @@ +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/SQLEditor/SQLEditor.vbproj b/SQLEditor/SQLEditor.vbproj index 11c59862..7aa18685 100644 --- a/SQLEditor/SQLEditor.vbproj +++ b/SQLEditor/SQLEditor.vbproj @@ -46,9 +46,28 @@ On + + + + + + + + + + + ..\packages\NLog.4.7.2\lib\net45\NLog.dll + + + + + + + + @@ -94,6 +113,10 @@ + + frmSQLEditor.vb + + VbMyResourcesResXFileCodeGenerator Resources.Designer.vb @@ -111,9 +134,20 @@ My Settings.Designer.vb + + + + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} + Logging + + + {7c3b0c7e-59fe-4e1a-a655-27ae119f9444} + Patterns + + \ No newline at end of file diff --git a/SQLEditor/frmSQLEditor.Designer.vb b/SQLEditor/frmSQLEditor.Designer.vb index 8fa5948f..1601d9d0 100644 --- a/SQLEditor/frmSQLEditor.Designer.vb +++ b/SQLEditor/frmSQLEditor.Designer.vb @@ -1,6 +1,6 @@  _ Partial Class frmSQLEditor - Inherits System.Windows.Forms.Form + Inherits DevExpress.XtraEditors.XtraForm 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. _ @@ -22,9 +22,266 @@ Partial Class frmSQLEditor 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - components = New System.ComponentModel.Container + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSQLEditor)) + Me.MemoEdit1 = New DevExpress.XtraEditors.MemoEdit() + Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton() + Me.gridResult = New DevExpress.XtraGrid.GridControl() + Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.gridPlaceholders = New DevExpress.XtraGrid.GridControl() + Me.GridView2 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colPlaceholder = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colReplacement = New DevExpress.XtraGrid.Columns.GridColumn() + Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() + Me.ComboBoxEdit1 = New DevExpress.XtraEditors.ComboBoxEdit() + Me.Label1 = New System.Windows.Forms.Label() + Me.ComboBoxEdit2 = New DevExpress.XtraEditors.ComboBoxEdit() + Me.Label2 = New System.Windows.Forms.Label() + Me.ComboBoxEdit3 = New DevExpress.XtraEditors.ComboBoxEdit() + Me.Label3 = New System.Windows.Forms.Label() + Me.ComboBoxEdit4 = New DevExpress.XtraEditors.ComboBoxEdit() + Me.Label4 = New System.Windows.Forms.Label() + Me.cmbConnections = New DevExpress.XtraEditors.ComboBoxEdit() + Me.Label5 = New System.Windows.Forms.Label() + CType(Me.MemoEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridResult, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.gridPlaceholders, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SplitContainerControl1.SuspendLayout() + CType(Me.ComboBoxEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ComboBoxEdit2.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ComboBoxEdit3.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ComboBoxEdit4.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.cmbConnections.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'MemoEdit1 + ' + Me.MemoEdit1.Location = New System.Drawing.Point(12, 94) + Me.MemoEdit1.Name = "MemoEdit1" + Me.MemoEdit1.Properties.Appearance.Font = New System.Drawing.Font("Consolas", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.MemoEdit1.Properties.Appearance.Options.UseFont = True + Me.MemoEdit1.Size = New System.Drawing.Size(776, 173) + Me.MemoEdit1.TabIndex = 0 + ' + 'SimpleButton1 + ' + Me.SimpleButton1.ImageOptions.SvgImage = CType(resources.GetObject("SimpleButton1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.SimpleButton1.ImageOptions.SvgImageSize = New System.Drawing.Size(20, 20) + Me.SimpleButton1.Location = New System.Drawing.Point(641, 443) + Me.SimpleButton1.Name = "SimpleButton1" + Me.SimpleButton1.Size = New System.Drawing.Size(147, 34) + Me.SimpleButton1.TabIndex = 1 + Me.SimpleButton1.Text = "Speichern" + ' + 'gridResult + ' + Me.gridResult.Dock = System.Windows.Forms.DockStyle.Fill + Me.gridResult.Location = New System.Drawing.Point(0, 0) + Me.gridResult.MainView = Me.GridView1 + Me.gridResult.Name = "gridResult" + Me.gridResult.Size = New System.Drawing.Size(370, 160) + Me.gridResult.TabIndex = 2 + Me.gridResult.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1}) + ' + 'GridView1 + ' + Me.GridView1.GridControl = Me.gridResult + Me.GridView1.Name = "GridView1" + Me.GridView1.OptionsView.ShowGroupPanel = False + ' + 'gridPlaceholders + ' + Me.gridPlaceholders.Dock = System.Windows.Forms.DockStyle.Fill + Me.gridPlaceholders.Location = New System.Drawing.Point(0, 0) + Me.gridPlaceholders.MainView = Me.GridView2 + Me.gridPlaceholders.Name = "gridPlaceholders" + Me.gridPlaceholders.Size = New System.Drawing.Size(396, 160) + Me.gridPlaceholders.TabIndex = 2 + Me.gridPlaceholders.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView2}) + ' + 'GridView2 + ' + Me.GridView2.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colPlaceholder, Me.colReplacement}) + Me.GridView2.GridControl = Me.gridPlaceholders + Me.GridView2.Name = "GridView2" + Me.GridView2.OptionsView.ShowGroupPanel = False + ' + 'colPlaceholder + ' + Me.colPlaceholder.Caption = "Platzhalter" + Me.colPlaceholder.Name = "colPlaceholder" + Me.colPlaceholder.Visible = True + Me.colPlaceholder.VisibleIndex = 0 + ' + 'colReplacement + ' + Me.colReplacement.Caption = "Ersetzung" + Me.colReplacement.Name = "colReplacement" + Me.colReplacement.Visible = True + Me.colReplacement.VisibleIndex = 1 + ' + 'SplitContainerControl1 + ' + Me.SplitContainerControl1.Location = New System.Drawing.Point(12, 277) + Me.SplitContainerControl1.Name = "SplitContainerControl1" + Me.SplitContainerControl1.Panel1.Controls.Add(Me.gridPlaceholders) + Me.SplitContainerControl1.Panel1.Text = "Panel1" + Me.SplitContainerControl1.Panel2.Controls.Add(Me.gridResult) + Me.SplitContainerControl1.Panel2.Text = "Panel2" + Me.SplitContainerControl1.Size = New System.Drawing.Size(776, 160) + Me.SplitContainerControl1.SplitterPosition = 396 + Me.SplitContainerControl1.TabIndex = 3 + ' + 'ComboBoxEdit1 + ' + Me.ComboBoxEdit1.Location = New System.Drawing.Point(572, 66) + Me.ComboBoxEdit1.Name = "ComboBoxEdit1" + Me.ComboBoxEdit1.Properties.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ComboBoxEdit1.Properties.Appearance.Options.UseFont = True + Me.ComboBoxEdit1.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)}) + Me.ComboBoxEdit1.Size = New System.Drawing.Size(215, 22) + Me.ComboBoxEdit1.TabIndex = 4 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(569, 50) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(101, 13) + Me.Label1.TabIndex = 5 + Me.Label1.Text = "Anwendungsdaten:" + ' + 'ComboBoxEdit2 + ' + Me.ComboBoxEdit2.Location = New System.Drawing.Point(351, 66) + Me.ComboBoxEdit2.Name = "ComboBoxEdit2" + Me.ComboBoxEdit2.Properties.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ComboBoxEdit2.Properties.Appearance.Options.UseFont = True + Me.ComboBoxEdit2.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)}) + Me.ComboBoxEdit2.Size = New System.Drawing.Size(215, 22) + Me.ComboBoxEdit2.TabIndex = 4 + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(348, 50) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(95, 13) + Me.Label2.TabIndex = 5 + Me.Label2.Text = "Umgebungsdaten:" + ' + 'ComboBoxEdit3 + ' + Me.ComboBoxEdit3.Location = New System.Drawing.Point(572, 25) + Me.ComboBoxEdit3.Name = "ComboBoxEdit3" + Me.ComboBoxEdit3.Properties.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ComboBoxEdit3.Properties.Appearance.Options.UseFont = True + Me.ComboBoxEdit3.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)}) + Me.ComboBoxEdit3.Size = New System.Drawing.Size(215, 22) + Me.ComboBoxEdit3.TabIndex = 4 + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(569, 9) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(177, 13) + Me.Label3.TabIndex = 5 + Me.Label3.Text = "Indexe (Zur Laufzeit ausgewertet):" + ' + 'ComboBoxEdit4 + ' + Me.ComboBoxEdit4.Location = New System.Drawing.Point(351, 25) + Me.ComboBoxEdit4.Name = "ComboBoxEdit4" + Me.ComboBoxEdit4.Properties.Appearance.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.ComboBoxEdit4.Properties.Appearance.Options.UseFont = True + Me.ComboBoxEdit4.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Plus)}) + Me.ComboBoxEdit4.Size = New System.Drawing.Size(215, 22) + Me.ComboBoxEdit4.TabIndex = 4 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(348, 9) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(182, 13) + Me.Label4.TabIndex = 5 + Me.Label4.Text = "Controls (zur Laufzeit ausgewertet):" + ' + 'cmbConnections + ' + Me.cmbConnections.Location = New System.Drawing.Point(12, 66) + Me.cmbConnections.Name = "cmbConnections" + Me.cmbConnections.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.cmbConnections.Size = New System.Drawing.Size(170, 20) + Me.cmbConnections.TabIndex = 6 + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(9, 50) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(121, 13) + Me.Label5.TabIndex = 5 + Me.Label5.Text = "Datenbank-Verbindung:" + ' + 'frmSQLEditor + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(800, 450) - Me.Text = "frmSQLEditor" + Me.ClientSize = New System.Drawing.Size(800, 489) + Me.Controls.Add(Me.cmbConnections) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.ComboBoxEdit4) + Me.Controls.Add(Me.ComboBoxEdit2) + Me.Controls.Add(Me.ComboBoxEdit3) + Me.Controls.Add(Me.ComboBoxEdit1) + Me.Controls.Add(Me.SplitContainerControl1) + Me.Controls.Add(Me.SimpleButton1) + Me.Controls.Add(Me.MemoEdit1) + Me.IconOptions.SvgImage = CType(resources.GetObject("frmSQLEditor.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.Name = "frmSQLEditor" + Me.Text = "SQL-Editor" + CType(Me.MemoEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridResult, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.gridPlaceholders, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.SplitContainerControl1.ResumeLayout(False) + CType(Me.ComboBoxEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ComboBoxEdit2.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ComboBoxEdit3.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ComboBoxEdit4.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.cmbConnections.Properties, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub + + Friend WithEvents MemoEdit1 As DevExpress.XtraEditors.MemoEdit + Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton + Friend WithEvents gridResult As DevExpress.XtraGrid.GridControl + Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents gridPlaceholders As DevExpress.XtraGrid.GridControl + Friend WithEvents GridView2 As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl + Friend WithEvents colPlaceholder As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colReplacement As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents ComboBoxEdit1 As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents Label1 As Label + Friend WithEvents ComboBoxEdit2 As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents Label2 As Label + Friend WithEvents ComboBoxEdit3 As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents Label3 As Label + Friend WithEvents ComboBoxEdit4 As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents Label4 As Label + Friend WithEvents cmbConnections As DevExpress.XtraEditors.ComboBoxEdit + Friend WithEvents Label5 As Label End Class diff --git a/SQLEditor/frmSQLEditor.resx b/SQLEditor/frmSQLEditor.resx new file mode 100644 index 00000000..9b081d08 --- /dev/null +++ b/SQLEditor/frmSQLEditor.resx @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAO4BAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iU2F2ZSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMzIg + MzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cjwvc3R5 + bGU+DQogIDxwYXRoIGQ9Ik0yNyw0aC0zdjEwSDhWNEg1QzQuNCw0LDQsNC40LDQsNXYyMmMwLDAuNiww + LjQsMSwxLDFoMjJjMC42LDAsMS0wLjQsMS0xVjVDMjgsNC40LDI3LjYsNCwyNyw0eiBNMjQsMjRIOHYt + NiAgaDE2VjI0eiBNMTAsNHY4aDEwVjRIMTB6IE0xNCwxMGgtMlY2aDJWMTB6IiBjbGFzcz0iQmxhY2si + IC8+DQo8L3N2Zz4L + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAF4DAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9Cgku + WWVsbG93e2ZpbGw6I0ZGQjExNTt9CgkuQmx1ZXtmaWxsOiMxMTc3RDc7fQoJLkdyZWVue2ZpbGw6IzAz + OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh + Y2l0eTowLjc1O30KCS5zdDF7b3BhY2l0eTowLjU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQo8L3N0eWxl + Pg0KICA8ZyBpZD0iRGF0YXNvdXJjZSI+DQogICAgPHBhdGggZD0iTTYsNmgxMnYySDZWNnogTTE0LDI0 + SDRWMmgxNnYxMC4yYzAuNi0wLjEsMS4zLTAuMiwyLTAuMlYxYzAtMC41LTAuNS0xLTEtMUgzQzIuNSww + LDIsMC41LDIsMXYyNCAgIGMwLDAuNSwwLjUsMSwxLDFoMTFWMjR6IE02LDIwaDh2LTJINlYyMHogTTYs + MTZoOC4yYzAuMi0wLjgsMC43LTEuNCwxLjUtMkg2VjE2eiIgY2xhc3M9IkJsYWNrIiAvPg0KICAgIDxw + YXRoIGQ9Ik0xOCwxMkg2di0yaDEyVjEyeiBNMjMsMTRjLTMuOSwwLTcsMS4zLTcsM3YxMmMwLDEuNywz + LjEsMyw3LDNzNy0xLjMsNy0zVjE3QzMwLDE1LjMsMjYuOSwxNCwyMywxNHoiIGNsYXNzPSJZZWxsb3ci + IC8+DQogIDwvZz4NCjwvc3ZnPgs= + + + \ No newline at end of file diff --git a/SQLEditor/frmSQLEditor.vb b/SQLEditor/frmSQLEditor.vb index 8bec02d1..33c10009 100644 --- a/SQLEditor/frmSQLEditor.vb +++ b/SQLEditor/frmSQLEditor.vb @@ -1,3 +1,44 @@ -Public Class frmSQLEditor +Imports DigitalData.Modules.Logging +Public Class frmSQLEditor + Private ReadOnly _LogConfig As LogConfig + Private ReadOnly _Logger As Logger + Private ReadOnly _Connections As DataTable + + Public Sub New(LogConfig As LogConfig, DatatableConnections As DataTable) + ' Dieser Aufruf ist für den Designer erforderlich. + InitializeComponent() + + ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. + _LogConfig = LogConfig + _Logger = LogConfig.GetLogger() + _Connections = DatatableConnections + End Sub + + Private Sub frmSQLEditor_Load(sender As Object, e As EventArgs) Handles MyBase.Load + LoadConnections() + End Sub + + Private Sub LoadConnections() + Try + For Each oRow As DataRow In _Connections.Rows + cmbConnections.Properties.Items.Add( + New Connection() With { + .Name = oRow.Item("BEZEICHNUNG"), + .Value = oRow.Item("GUID") + }) + Next + Catch ex As Exception + _Logger.Error(ex) + End Try + End Sub + + Private Class Connection + Public Property Value + Public Property Name + + Public Overrides Function ToString() As String + Return Name + End Function + End Class End Class \ No newline at end of file diff --git a/SQLEditor/packages.config b/SQLEditor/packages.config new file mode 100644 index 00000000..1baeaab3 --- /dev/null +++ b/SQLEditor/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SQLEditorTest/App.config b/SQLEditorTest/App.config new file mode 100644 index 00000000..ffaf5407 --- /dev/null +++ b/SQLEditorTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SQLEditorTest/Form1.Designer.vb b/SQLEditorTest/Form1.Designer.vb new file mode 100644 index 00000000..88a5a083 --- /dev/null +++ b/SQLEditorTest/Form1.Designer.vb @@ -0,0 +1,38 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + '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. + _ + Private Sub InitializeComponent() + Me.SuspendLayout() + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + + End Sub + +End Class diff --git a/SQLEditorTest/Form1.resx b/SQLEditorTest/Form1.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SQLEditorTest/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SQLEditorTest/Form1.vb b/SQLEditorTest/Form1.vb new file mode 100644 index 00000000..138bcd46 --- /dev/null +++ b/SQLEditorTest/Form1.vb @@ -0,0 +1,15 @@ +Imports DigitalData.Controls.SQLEditor +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Database + +Public Class Form1 + Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Dim oLogCOnfig As New LogConfig(LogConfig.PathType.Temp, Nothing, Nothing, Nothing, Nothing) + Dim oConnString = MSSQLServer.GetConnectionString("SDD-VMP04-SQL17\DD_DEVELOP01", "DD_ECM_TEST", "sa", "dd") + Dim oDatabase As New MSSQLServer(oLogCOnfig, oConnString) + Dim oConnections As DataTable = oDatabase.GetDatatable("SELECT * FROM TBDD_CONNECTION") + Dim oEditor As New frmSQLEditor(oLogCOnfig, oConnections) + + oEditor.Show() + End Sub +End Class diff --git a/SQLEditorTest/My Project/Application.Designer.vb b/SQLEditorTest/My Project/Application.Designer.vb new file mode 100644 index 00000000..fa332de2 --- /dev/null +++ b/SQLEditorTest/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.SQLEditorTest.Form1 + End Sub + End Class +End Namespace diff --git a/SQLEditorTest/My Project/Application.myapp b/SQLEditorTest/My Project/Application.myapp new file mode 100644 index 00000000..1243847f --- /dev/null +++ b/SQLEditorTest/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/SQLEditorTest/My Project/AssemblyInfo.vb b/SQLEditorTest/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..5a0f6e8f --- /dev/null +++ b/SQLEditorTest/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Allgemeine Informationen über eine Assembly werden über die folgenden +' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +' die einer Assembly zugeordnet sind. + +' Werte der Assemblyattribute überprüfen + + + + + + + + + + +'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +' +' Hauptversion +' Nebenversion +' Buildnummer +' Revision +' +' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +' indem Sie "*" wie unten gezeigt eingeben: +' + + + diff --git a/SQLEditorTest/My Project/Resources.Designer.vb b/SQLEditorTest/My Project/Resources.Designer.vb new file mode 100644 index 00000000..3ddc0f13 --- /dev/null +++ b/SQLEditorTest/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SQLEditorTest.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/SQLEditorTest/My Project/Resources.resx b/SQLEditorTest/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/SQLEditorTest/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SQLEditorTest/My Project/Settings.Designer.vb b/SQLEditorTest/My Project/Settings.Designer.vb new file mode 100644 index 00000000..28331798 --- /dev/null +++ b/SQLEditorTest/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.SQLEditorTest.My.MySettings + Get + Return Global.SQLEditorTest.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/SQLEditorTest/My Project/Settings.settings b/SQLEditorTest/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/SQLEditorTest/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SQLEditorTest/SQLEditorTest.vbproj b/SQLEditorTest/SQLEditorTest.vbproj new file mode 100644 index 00000000..f4b286d8 --- /dev/null +++ b/SQLEditorTest/SQLEditorTest.vbproj @@ -0,0 +1,138 @@ + + + + + Debug + AnyCPU + {4B0AED11-31C4-431A-B488-72392B63E6E6} + WinExe + SQLEditorTest.My.MyApplication + SQLEditorTest + SQLEditorTest + 512 + WindowsForms + v4.7.2 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + SQLEditorTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + SQLEditorTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + {eaf0ea75-5fa7-485d-89c7-b2d843b03a96} + Database + + + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} + Logging + + + {e707bf50-6799-42b2-869f-e10641d51219} + SQLEditor + + + + \ No newline at end of file