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 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,11 @@ 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 @@ -594,12 +606,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 GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse) Try Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { .SqlCommand = pSQL, - .NamedDatabase = DatabaseName.ECM, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.ECM }) Return oResponse Catch ex As Exception @@ -608,12 +619,27 @@ Public Class Client End Try End Function - Public Function GetScalarValueFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse + 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.None, + .ConnectionId = pConnectionId + }) + Return oResponse + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function +#End Region + +#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,12 +688,11 @@ 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, - .ConnectionId = pConnectionId + .NamedDatabase = DatabaseName.ECM }) Return oResponse Catch ex As Exception @@ -664,12 +701,27 @@ Public Class Client End Try End Function - Public Function ExecuteNonQueryFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse + 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 + Catch ex As Exception + Logger.Error(ex) + Throw ex + End Try + End Function +#End Region + +#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 @@ -678,11 +730,24 @@ Public Class Client End Try End Function - Public Function ExecuteNonQueryFromECM(pSQL As String, Optional pConnectionId As Integer = 0) As ExecuteNonQueryResponse + Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse Try Dim oResponse = Channel.ExecuteNonQuery(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 Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse + Try + Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { + .SqlCommand = pSQL, + .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 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: ' - - + + 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() 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: ' - - + + 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,22 +28,24 @@ 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) + + 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 + + oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue) 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() - - 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) - Catch ex As Exception Logger.Error(ex) Return oResult 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