This commit is contained in:
2021-01-19 13:11:09 +01:00
parent f78f3f84b0
commit f6862cccc2
42 changed files with 3308 additions and 390 deletions

View File

@@ -8,10 +8,12 @@ Public Class ClassIDBData
''' <param name="BusinessEntity">Title of Business Entity</param>
''' <returns>Array with all Indices</returns>
Private _Logger As Logger
Private _DataASorDB As ClassDataASorDB
Public Sub New(LogConfig As LogConfig)
_Logger = LogConfig.GetLogger
_DataASorDB = New ClassDataASorDB(LogConfig)
Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE"
DTVWIDB_BE_ATTRIBUTE = My.DatabaseIDB.GetDatatable(oSQL)
DTVWIDB_BE_ATTRIBUTE = _DataASorDB.GetDatatable("IDB", oSQL, "VWIDB_BE_ATTRIBUTE", "")
End Sub
Public IDBSystemIndices As List(Of String)
Public Function GetIndicesByBE(ByVal pBusinessEntity As String) As List(Of String)
@@ -89,7 +91,7 @@ Public Class ClassIDBData
Else
_Logger.Debug($"oAttributeValue for Attribute [{pAttributeName}] is so far nothing..Now trying FNIDB_PM_GET_VARIABLE_VALUE ")
End If
Dim oFNSQL = $"SELECT * FROM [dbo].[FNIDB_PM_GET_VARIABLE_VALUE] ({My.Application.Globix.CURRENT_DOC_ID},'{pAttributeName}','{My.Application.User.Language}',CONVERT(BIT,'0'))"
Dim oFNSQL = $"SELECT * FROM [dbo].[FNIDB_PM_GET_VARIABLE_VALUE] ({My.Application.Globix.CURRENT_IDB_OBJ_ID},'{pAttributeName}','{My.Application.User.Language}',CONVERT(BIT,'0'))"
Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oFNSQL)
If oDatatable.Rows.Count = 1 Then
oAttributeValue = oDatatable.Rows(0).Item(0)
@@ -103,7 +105,7 @@ Public Class ClassIDBData
Public Function Delete_Term_Object_From_Metadata(pAttributeName As String, pTerm2Delete As String) As Object
Try
Dim oIdIsForeign As Integer = 1
Dim oDELSQL = $"EXEC PRIDB_DELETE_TERM_OBJECT_METADATA {My.Application.Globix.CURRENT_DOC_ID},'{pAttributeName}','{pTerm2Delete}','{My.Application.User.UserName}','{My.Application.User.Language}',{oIdIsForeign}"
Dim oDELSQL = $"EXEC PRIDB_DELETE_TERM_OBJECT_METADATA {My.Application.Globix.CURRENT_IDB_OBJ_ID},'{pAttributeName}','{pTerm2Delete}','{My.Application.User.UserName}','{My.Application.User.Language}',{oIdIsForeign}"
My.DatabaseIDB.ExecuteNonQuery(oDELSQL)
Catch ex As Exception
@@ -150,7 +152,7 @@ Public Class ClassIDBData
If oExists = False Then
Dim oInfo = $"Value [{oOldValueRow.Item(0)}] no longer existing in Vector-Attribute [{pAttributeName}] - will be deleted!"
_Logger.Info(oInfo)
_Logger.Debug(oInfo)
SetVariableValue(My.Application.Globix.CURRENT_PROFILE_LOG_INDEX, oInfo)
Delete_Term_Object_From_Metadata(pAttributeName, oOldValueRow.Item(0))
End If
@@ -169,13 +171,13 @@ Public Class ClassIDBData
Next
If oExists = False Then
Dim oInfo2 = $"Value [{oOldAttributeResult}] no longer existing in Vector-Attribute [{pAttributeName}] - will be deleted!"
_Logger.Info(oInfo2)
_Logger.Debug(oInfo2)
SetVariableValue(My.Application.Globix.CURRENT_PROFILE_LOG_INDEX, oInfo2)
Delete_Term_Object_From_Metadata(pAttributeName, oOldAttributeResult)
End If
Else
Dim oInfo = $"Value [{oOldAttributeResult}] of Attribute [{pAttributeName}] obviously was updated during runtime - will be deleted!"
_Logger.Info(oInfo)
_Logger.Debug(oInfo)
SetVariableValue(My.Application.Globix.CURRENT_PROFILE_LOG_INDEX, oInfo)
Delete_Term_Object_From_Metadata(pAttributeName, oOldAttributeResult)
End If
@@ -186,7 +188,7 @@ Public Class ClassIDBData
For Each oNewValueRow As DataRow In oDTMyNewValues.Rows
Dim oSuccess As Boolean = False
Dim oFNSQL = $"DECLARE @NEW_OBJ_MD_ID BIGINT " & vbNewLine & $"EXEC PRIDB_NEW_OBJ_DATA {My.Application.Globix.CURRENT_DOC_ID},'{pAttributeName}','{My.Application.User.UserName}','{oNewValueRow.Item(1).ToString}','{My.Application.User.Language}',0,@OMD_ID = @NEW_OBJ_MD_ID OUTPUT"
Dim oFNSQL = $"DECLARE @NEW_OBJ_MD_ID BIGINT " & vbNewLine & $"EXEC PRIDB_NEW_OBJ_DATA {My.Application.Globix.CURRENT_IDB_OBJ_ID},'{pAttributeName}','{My.Application.User.UserName}','{oNewValueRow.Item(1).ToString}','{My.Application.User.Language}',0,@OMD_ID = @NEW_OBJ_MD_ID OUTPUT"
oSuccess = My.DatabaseIDB.ExecuteNonQuery(oFNSQL)
If oSuccess = False Then
Return False
@@ -194,7 +196,7 @@ Public Class ClassIDBData
Next
Return True
Else
Dim oFNSQL = $"DECLARE @NEW_OBJ_MD_ID BIGINT " & vbNewLine & $"EXEC PRIDB_NEW_OBJ_DATA {My.Application.Globix.CURRENT_DOC_ID},'{pAttributeName}','{My.Application.User.UserName}','{pNewValue}','{My.Application.User.Language}',0,@OMD_ID = @NEW_OBJ_MD_ID OUTPUT"
Dim oFNSQL = $"DECLARE @NEW_OBJ_MD_ID BIGINT " & vbNewLine & $"EXEC PRIDB_NEW_OBJ_DATA {My.Application.Globix.CURRENT_IDB_OBJ_ID},'{pAttributeName}','{My.Application.User.UserName}','{pNewValue}','{My.Application.User.Language}',0,@OMD_ID = @NEW_OBJ_MD_ID OUTPUT"
Return My.DatabaseIDB.ExecuteNonQuery(oFNSQL)
End If