This commit is contained in:
2020-01-31 14:40:06 +01:00
parent 3dcca628a6
commit 977e358eaf
3 changed files with 34 additions and 6 deletions

View File

@@ -129,6 +129,17 @@
Return Nothing
End Try
End Function
Public Function Delete_AttributeData(pIDB_OBJID As Int64, pAttributeName As String) As Object
Try
Dim oDELSQL = $"EXEC PRIDB_DELETE_ATTRIBUTE_DATA {pIDB_OBJID},'{pAttributeName}','{USER_USERNAME}'"
ClassDatabase.Execute_non_Query_ConStr(oDELSQL, CONNECTION_STRING_IDB)
Catch ex As Exception
LOGGER.Error(ex)
Return Nothing
End Try
End Function
Public Function SetVariableValue(oAttributeName As String, oNewValue As Object, Optional CheckDeleted As Boolean = False, Optional oIDBTyp As Integer = 0)
@@ -136,10 +147,12 @@
Dim omytype = oNewValue.GetType.ToString
If omytype = "System.Data.DataTable" Then
Dim oDTMyNewValues As DataTable = oNewValue
Dim oOldAttributeResult
Dim oTypeOldResult
If CheckDeleted = True Then
Dim oOldAttributeResult = GetVariableValue(oAttributeName, oIDBTyp)
Dim oTypeOldResult = oOldAttributeResult.GetType.ToString
oOldAttributeResult = GetVariableValue(oAttributeName, oIDBTyp)
oTypeOldResult = oOldAttributeResult.GetType.ToString
If oTypeOldResult = "System.Data.DataTable" Then
Dim myOldValues As DataTable = oOldAttributeResult
If myOldValues.Rows.Count > 1 Then
@@ -164,7 +177,13 @@
Next
End If
Else
Dim oInfo = $"Value [{oOldAttributeResult}] of Attribute [{oAttributeName}] obviously was updated during runtime - will be deleted!"
LOGGER.Info(oInfo)
SetVariableValue(CURRENT_PROFILE_LOG_INDEX, oInfo)
Delete_Term_Object_From_Metadata(oAttributeName, oOldAttributeResult)
End If
End If
For Each oNewValueRow As DataRow In oDTMyNewValues.Rows