From 65ef8ccbc7c752274c5d3bb2ce05783003f2136e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 15 Mar 2022 16:34:37 +0100 Subject: [PATCH 1/6] Zooflow: Badge shenanigans --- GUIs.ZooFlow/frmFlowForm.Designer.vb | 5 ++++- GUIs.ZooFlow/frmFlowForm.resx | 2 +- GUIs.ZooFlow/frmFlowForm.vb | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GUIs.ZooFlow/frmFlowForm.Designer.vb b/GUIs.ZooFlow/frmFlowForm.Designer.vb index ef9bcd76..449b0b42 100644 --- a/GUIs.ZooFlow/frmFlowForm.Designer.vb +++ b/GUIs.ZooFlow/frmFlowForm.Designer.vb @@ -133,6 +133,9 @@ Partial Class frmFlowForm Me.ZooFlowBeendenToolStripMenuItem.Size = New System.Drawing.Size(169, 22) Me.ZooFlowBeendenToolStripMenuItem.Text = "ZooFlow beenden" ' + 'TimerRefreshData + ' + ' 'PictureBoxPM ' Me.PictureBoxPM.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -400,7 +403,7 @@ Partial Class frmFlowForm Me.TaskBadge.Appearance.BackColor = System.Drawing.Color.FromArgb(CType(CType(165, Byte), Integer), CType(CType(36, Byte), Integer), CType(CType(49, Byte), Integer)) Me.TaskBadge.Appearance.Options.UseBackColor = True Me.TaskBadge.Properties.Location = System.Drawing.ContentAlignment.TopRight - Me.TaskBadge.Properties.Offset = New System.Drawing.Point(0, 0) + Me.TaskBadge.Properties.Offset = New System.Drawing.Point(-5, -5) Me.TaskBadge.Properties.PaintStyle = DevExpress.Utils.VisualEffects.BadgePaintStyle.[Default] Me.TaskBadge.Properties.Text = "0" Me.TaskBadge.TargetElement = Me.PictureBoxPM diff --git a/GUIs.ZooFlow/frmFlowForm.resx b/GUIs.ZooFlow/frmFlowForm.resx index b0efd3ba..5b1cfc0c 100644 --- a/GUIs.ZooFlow/frmFlowForm.resx +++ b/GUIs.ZooFlow/frmFlowForm.resx @@ -2039,6 +2039,6 @@ - 17, 56 + 1115, 17 \ No newline at end of file diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index db9e92cf..06b58481 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -1292,5 +1292,9 @@ Public Class frmFlowForm Private Sub PictureBoxPM_MouseLeave(sender As Object, e As EventArgs) Handles PictureBoxPM.MouseLeave PictureBoxPM.SvgImage = My.Resources.FLOW_Sidebar_Task_inaktiv End Sub + + Private Sub TimerRefreshData_Tick_1(sender As Object, e As EventArgs) Handles TimerRefreshData.Tick + TaskBadge.Properties.Text = Date.Now.Millisecond.ToString.Last + End Sub End Class From 1b5e724750ad0c47330435784a9ff9564ecc6f6b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 15 Mar 2022 16:34:54 +0100 Subject: [PATCH 2/6] EDMIService: Fix internal Placeholders --- Modules.Patterns/Modules/BaseModule.vb | 2 +- .../Modules/Globix/GlobixAutomatic.vb | 20 ++++++++++--------- Modules.Patterns/Modules/Internal.vb | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Modules.Patterns/Modules/BaseModule.vb b/Modules.Patterns/Modules/BaseModule.vb index 7619462f..82ac08e3 100644 --- a/Modules.Patterns/Modules/BaseModule.vb +++ b/Modules.Patterns/Modules/BaseModule.vb @@ -9,7 +9,7 @@ Namespace Modules "SELECT ", "UPDATE ", "DELETE ", "EXEC " } - Private Const MAX_TRY_COUNT = 500 + Private Const MAX_TRY_COUNT = 100 Public Sub New(pLogConfig As LogConfig) Logger = pLogConfig.GetLogger() diff --git a/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb b/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb index 38a6950b..9f0dd236 100644 --- a/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb +++ b/Modules.Patterns/Modules/Globix/GlobixAutomatic.vb @@ -28,21 +28,23 @@ Namespace Modules.Globix While ContainsPattern(oResult, PatternIdentifier) Try Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value + Logger.Info("Replacing value for Index {0}", oIndexName) If pIndexes.ContainsKey(oIndexName) = False Then Logger.Warn("Value for Index [{0}] does not exist and will not be used for replacing. Skipping.", oIndexName) - End If - ' TODO: If Index contains multiple values, only the first value will be used as value - Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName) - Dim oFirstValue As String = oIndexValues.FirstOrDefault() + Else + ' TODO: If Index contains multiple values, only the first value will be used as value + Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName) + Dim oFirstValue As String = oIndexValues.FirstOrDefault() - If oFirstValue Is Nothing Then - Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.") - Return oResult - End If + If oFirstValue Is Nothing Then + Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.") + Return oResult + End If - oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue) + oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue) + End If Catch ex As Exception Logger.Error(ex) diff --git a/Modules.Patterns/Modules/Internal.vb b/Modules.Patterns/Modules/Internal.vb index 65d075ef..c7cc56d7 100644 --- a/Modules.Patterns/Modules/Internal.vb +++ b/Modules.Patterns/Modules/Internal.vb @@ -38,7 +38,7 @@ Namespace Modules ' Replace CurrentDate(s) While ContainsPatternAndValue(oResult, PatternIdentifier, INT_VALUE_DATE_YYYY_MM_DD) Logger.Trace("Replacing Pattern [{0}]", INT_VALUE_DATE_YYYY_MM_DD) - oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy/MM/dd")) + oResult = ReplacePattern(oResult, PatternIdentifier, oNow.ToString("yyyy\\MM\\dd")) IncrementCounterOrThrow(oCounter) End While From 31ce9b05b17b1989f305c4278de9aef1fe52989b Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 16 Mar 2022 10:26:31 +0100 Subject: [PATCH 3/6] LogConfig: change default file keep range to 30 days --- Modules.Logging/LogConfig.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules.Logging/LogConfig.vb b/Modules.Logging/LogConfig.vb index 0e1e01c3..29c879e0 100644 --- a/Modules.Logging/LogConfig.vb +++ b/Modules.Logging/LogConfig.vb @@ -94,7 +94,7 @@ Public Class LogConfig Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt" Private Const FOLDER_NAME_LOG = "Log" - Private Const FILE_KEEP_RANGE As Integer = 90 + Private Const FILE_KEEP_RANGE As Integer = 30 Private Const MAX_MEMORY_LOG_COUNT As Integer = 1000 Private ReadOnly _failSafePath As String = Path.GetTempPath() From 73b8d5c16925d0905fbc8dcacfe0c284e6c959c0 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 16 Mar 2022 11:04:24 +0100 Subject: [PATCH 4/6] EDMIClient: Add _FromConnection variants for database functions --- Modules.EDMIAPI/Client.vb | 139 ++++++++++++++++++++++++++++++-------- 1 file changed, 109 insertions(+), 30 deletions(-) diff --git a/Modules.EDMIAPI/Client.vb b/Modules.EDMIAPI/Client.vb index 0b597322..3ea33c20 100644 --- a/Modules.EDMIAPI/Client.vb +++ b/Modules.EDMIAPI/Client.vb @@ -552,12 +552,12 @@ Public Class Client End Try End Function - Public Function GetDatatableFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetDatatableResponse +#Region "GetDatatable" + Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse Try Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB }) Return oResponse Catch ex As Exception @@ -566,11 +566,24 @@ Public Class Client End Try End Function - Public Function GetDatatableFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As GetDatatableResponse + Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse Try Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.ECM + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse + Try + Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -580,12 +593,24 @@ Public Class Client End Try End Function - Public Async Function GetDatatableFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse) + Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse) Try Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse) + Try + Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.ECM }) Return oResponse Catch ex As Exception @@ -594,11 +619,11 @@ Public Class Client End Try End Function - Public Async Function GetDatatableFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse) + Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse) Try Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -607,13 +632,14 @@ Public Class Client Throw ex End Try End Function +#End Region - Public Function GetScalarValueFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse +#Region "GetScalarValue" + Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse Try Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB }) Return oResponse Catch ex As Exception @@ -622,11 +648,24 @@ Public Class Client End Try End Function - Public Function GetScalarValueFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse + Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse Try Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.ECM + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse + Try + Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -636,12 +675,11 @@ Public Class Client End Try End Function - Public Async Function GetScalarValueFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetScalarValueResponse) + Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse) Try Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB }) Return oResponse Catch ex As Exception @@ -650,11 +688,24 @@ Public Class Client End Try End Function - Public Async Function GetScalarValueFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetScalarValueResponse) + Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse) Try Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.ECM + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse) + Try + Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -663,13 +714,27 @@ Public Class Client Throw ex End Try End Function +#End Region - Public Function ExecuteNonQueryFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse +#Region "ExecuteNonQuery" + Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse Try Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse + Try + Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.ECM }) Return oResponse Catch ex As Exception @@ -678,11 +743,11 @@ Public Class Client End Try End Function - Public Function ExecuteNonQueryFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse + Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse Try Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -692,12 +757,11 @@ Public Class Client End Try End Function - Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of ExecuteNonQueryResponse) + Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse) Try Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.IDB, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.IDB }) Return oResponse Catch ex As Exception @@ -706,11 +770,24 @@ Public Class Client End Try End Function - Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of ExecuteNonQueryResponse) + Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse) Try Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, + .NamedDatabase = DatabaseName.ECM + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function + + Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse) + Try + Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { + .SqlCommand = pSQL, + .NamedDatabase = DatabaseName.None, .ConnectionId = pConnectionId }) Return oResponse @@ -719,6 +796,8 @@ Public Class Client Throw ex End Try End Function +#End Region + Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult Try From ac55dad1ddb0836474e07d711ee3c387310e07d7 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 16 Mar 2022 11:05:17 +0100 Subject: [PATCH 5/6] EDMIClient: Version 1.5.1 --- Modules.EDMIAPI/My Project/AssemblyInfo.vb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules.EDMIAPI/My Project/AssemblyInfo.vb b/Modules.EDMIAPI/My Project/AssemblyInfo.vb index 78f55042..1b1ad758 100644 --- a/Modules.EDMIAPI/My Project/AssemblyInfo.vb +++ b/Modules.EDMIAPI/My Project/AssemblyInfo.vb @@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices - + @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + From 7bc3878a7999491de589d0c0474ce47eb580dda0 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 16 Mar 2022 11:05:47 +0100 Subject: [PATCH 6/6] Logging: Version 2.5.3 --- Modules.Logging/My Project/AssemblyInfo.vb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules.Logging/My Project/AssemblyInfo.vb b/Modules.Logging/My Project/AssemblyInfo.vb index cf4ffedc..2b4504c1 100644 --- a/Modules.Logging/My Project/AssemblyInfo.vb +++ b/Modules.Logging/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + +