Entfernung von SetVariableValue und DLL-Refactoring
Die Funktion `SetVariableValue` wurde aus `Client.vb` entfernt, da sie umfangreiche, aber nicht mehr benötigte Logik zur Attributverarbeitung enthielt. In `EDMI.API.vbproj` wurden Projektreferenzen durch DLL-Referenzen ersetzt (`DigitalData.Modules.Base`, `Config`, `Database`, `Logging`), um die Modularität zu verbessern. Die Assembly-Metadaten in `AssemblyInfo.vb` wurden aktualisiert, einschließlich Copyright (2026), Trademark (2.0.0) und Assembly-Version (2.0.0.0), um die neue Hauptversion zu reflektieren.
This commit is contained in:
@@ -331,125 +331,6 @@ Public Class Client
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Sets a value to an attribute
|
||||
''' </summary>
|
||||
''' <param name="pObjectId">IDB ObjectId</param>
|
||||
''' <param name="pAttributeName">Name of the attribute</param>
|
||||
''' <param name="pValue"></param>
|
||||
''' <param name="pOptions"></param>
|
||||
''' <returns></returns>
|
||||
'Public Function SetVariableValue(pObjectId As Long, pAttributeName As String, pValue As Object, Optional pOptions As Options.SetVariableValueOptions = Nothing) As Boolean
|
||||
' Try
|
||||
' ' Set default options
|
||||
' If pOptions Is Nothing Then
|
||||
' pOptions = New Options.SetVariableValueOptions()
|
||||
' End If
|
||||
|
||||
' Dim oOptions As New Options.GetVariableValueOptions With {
|
||||
' .Language = pOptions.Language,
|
||||
' .Username = pOptions.Username
|
||||
' }
|
||||
|
||||
' Try
|
||||
' Dim oResponse = Channel.TestObjectIdExists(New TestObjectIdExistsRequest With {.ObjectId = pObjectId})
|
||||
' If oResponse.Exists = False Then
|
||||
' Return False
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Return False
|
||||
' End Try
|
||||
|
||||
' Dim oType = pValue.GetType.Name
|
||||
|
||||
' If oType = GetType(DataTable).Name Then
|
||||
' Dim oValueTable As DataTable = pValue
|
||||
' Dim oCurrentValue As VariableValue
|
||||
|
||||
' ' Get current value
|
||||
' oCurrentValue = GetVariableValue(pObjectId, pAttributeName, oOptions)
|
||||
|
||||
' ' If current value is datatable
|
||||
' If oCurrentValue.Type = GetType(DataTable) Then
|
||||
|
||||
' ' Convert value to Datatable
|
||||
' Dim oTable As DataTable = oCurrentValue.Value
|
||||
|
||||
' If oTable.Rows.Count > 1 Then
|
||||
|
||||
' 'now Checking whether the old row still remains in Vector? If not it will be deleted as it cannot be replaced in multivalues
|
||||
' For Each oRow As DataRow In oTable.Rows
|
||||
' Dim oExists As Boolean = False
|
||||
' For Each oNewValueRow As DataRow In oValueTable.Rows
|
||||
' Logger.Debug($"Checking oldValue[{oCurrentValue}] vs NewValue [{oNewValueRow.Item(1)}]")
|
||||
|
||||
' If oNewValueRow.Item(1).ToString.ToUpper = oRow.Item(0).ToString.ToUpper Then
|
||||
' oExists = True
|
||||
' Exit For
|
||||
' End If
|
||||
' Next
|
||||
|
||||
' If oExists = False Then
|
||||
' Logger.Debug($"Value [{oRow.Item(0)}] no longer existing in Vector-Attribute [{pAttributeName}] - will be deleted!")
|
||||
' DeleteTermObjectFromMetadata(pObjectId, pAttributeName, oRow.Item(0))
|
||||
' End If
|
||||
|
||||
' Next
|
||||
' End If
|
||||
' Else
|
||||
' If oValueTable.Rows.Count > 1 Then
|
||||
|
||||
' 'now Checking whether the old row still remains in Vector? If not it will be deleted as it cannot be replaced in multivalues
|
||||
' Dim oExists As Boolean = False
|
||||
' For Each oNewValueRow As DataRow In oValueTable.Rows
|
||||
' Logger.Debug($"Checking oldValue[{oCurrentValue}] vs NewValue [{oNewValueRow.Item(1)}]")
|
||||
|
||||
' If oNewValueRow.Item(1).ToString.ToUpper = oCurrentValue.ToString.ToUpper Then
|
||||
' oExists = True
|
||||
' Exit For
|
||||
' End If
|
||||
|
||||
' Next
|
||||
' If oExists = False Then
|
||||
' Logger.Debug($"Value [{oCurrentValue}] no longer existing in Vector-Attribute [{pAttributeName}] - will be deleted!")
|
||||
' DeleteTermObjectFromMetadata(pObjectId, pAttributeName, oCurrentValue.Value)
|
||||
' End If
|
||||
|
||||
' Else
|
||||
' Logger.Debug($"Value [{oCurrentValue}] of Attribute [{pAttributeName}] obviously was updated during runtime - will be deleted!")
|
||||
' DeleteTermObjectFromMetadata(pObjectId, pAttributeName, oCurrentValue.Value)
|
||||
|
||||
' End If
|
||||
|
||||
' End If
|
||||
|
||||
' For Each oNewValueRow As DataRow In oValueTable.Rows
|
||||
' Dim oResult As Boolean = NewObjectData(pObjectId, pAttributeName, pValue, New Options.NewObjectOptions With {
|
||||
' .Language = pOptions.Language,
|
||||
' .Username = pOptions.Username
|
||||
' })
|
||||
|
||||
' If oResult = False Then
|
||||
' Return False
|
||||
' End If
|
||||
' Next
|
||||
' Return True
|
||||
' Else
|
||||
' Return NewObjectData(pObjectId, pAttributeName, pValue, New Options.NewObjectOptions With {
|
||||
' .Language = pOptions.Language,
|
||||
' .Username = pOptions.Username
|
||||
' })
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Return False
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
''' <summary>
|
||||
'''
|
||||
''' </summary>
|
||||
|
||||
@@ -44,6 +44,22 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="DigitalData.Modules.Base, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Config, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Database, Version=2.3.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Logging, Version=2.6.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.0.5\lib\net46\NLog.dll</HintPath>
|
||||
@@ -295,24 +311,6 @@
|
||||
<LastGenOutput>Reference.vb</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Base\Base.vbproj">
|
||||
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
|
||||
<Name>Base</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Config\Config.vbproj">
|
||||
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Database\Database.vbproj">
|
||||
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
|
||||
<Name>Database</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Logging\Logging.vbproj">
|
||||
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||
<Name>Logging</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>powershell.exe -command "& { &'$(SolutionDir)copy-binary.ps1' '$(TargetPath)' '$(TargetFileName)' '$(ConfigurationName)' '$(ProjectName)' }"</PostBuildEvent>
|
||||
|
||||
@@ -12,8 +12,8 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("EDMIAPI")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("1.6.1.1")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2026")>
|
||||
<Assembly: AssemblyTrademark("2.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.6.1.1")>
|
||||
<Assembly: AssemblyVersion("2.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.6.1.1")>
|
||||
|
||||
Reference in New Issue
Block a user