insert/update image
This commit is contained in:
parent
e3a4c59a48
commit
74580a72fa
@ -61,6 +61,9 @@
|
|||||||
<OptionInfer>On</OptionInfer>
|
<OptionInfer>On</OptionInfer>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Humanizer">
|
||||||
|
<HintPath>..\packages\Humanizer.1.37.7\lib\portable-win+net40+sl50+wp8+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Humanizer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="NLog">
|
<Reference Include="NLog">
|
||||||
<HintPath>..\..\3rdparty\NLog.4.1.2\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\..\3rdparty\NLog.4.1.2\lib\net45\NLog.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -90,6 +93,7 @@
|
|||||||
<Compile Include="Config.vb" />
|
<Compile Include="Config.vb" />
|
||||||
<Compile Include="DB.vb" />
|
<Compile Include="DB.vb" />
|
||||||
<Compile Include="DPMAConnect.vb" />
|
<Compile Include="DPMAConnect.vb" />
|
||||||
|
<Compile Include="Image.vb" />
|
||||||
<Compile Include="Mark.vb" />
|
<Compile Include="Mark.vb" />
|
||||||
<Compile Include="Main.vb" />
|
<Compile Include="Main.vb" />
|
||||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||||
|
|||||||
@ -105,6 +105,16 @@ Module Main
|
|||||||
Dim value = db.GetProperty(m, prop)
|
Dim value = db.GetProperty(m, prop)
|
||||||
' Wert einfügen
|
' Wert einfügen
|
||||||
db.InsertValue(controlId, recordId, value)
|
db.InsertValue(controlId, recordId, value)
|
||||||
|
|
||||||
|
' Wenn Bildmarke oder Wort- und Bildmarke, Bild einfügen
|
||||||
|
If prop = "MarkFeature" Then
|
||||||
|
If value = "wort-bildmarke" Or value = "bildmarke" Then
|
||||||
|
Dim imageControlId = db.GetControlId(formId, "MarkImage")
|
||||||
|
Dim bimage() As Byte = Image.ToByteArray(m.Image.BinaryImage)
|
||||||
|
db.InsertImage(bimage, imageControlId, recordId)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
logger.Debug("Value inserted - Property: {0}, Value: {1}, ControlId: {2}", prop, value, controlId)
|
logger.Debug("Value inserted - Property: {0}, Value: {1}, ControlId: {2}", prop, value, controlId)
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
@ -120,15 +130,29 @@ Module Main
|
|||||||
' Wert für die aktuelle property holen
|
' Wert für die aktuelle property holen
|
||||||
Dim value = db.GetProperty(m, prop)
|
Dim value = db.GetProperty(m, prop)
|
||||||
|
|
||||||
Dim hasChanged As Boolean = Not db.IsEqual(controlId, recordId, value)
|
|
||||||
logger.Debug("Value for {0} has changed", recordId)
|
|
||||||
|
|
||||||
If hasChanged Then
|
|
||||||
propsChanged = True
|
|
||||||
' Wert aktualisieren
|
' Wert aktualisieren
|
||||||
db.UpdateValue(controlId, recordId, value)
|
db.UpdateValue(controlId, recordId, value)
|
||||||
logger.Debug("Value updated - Property: {0}, ControlId: {1}", prop, controlId)
|
|
||||||
|
' Wenn Bildmarke oder Wort- und Bildmarke, Bild aktualisieren
|
||||||
|
If prop = "MarkFeature" Then
|
||||||
|
If value = "wort-bildmarke" Or value = "bildmarke" Then
|
||||||
|
Dim imageControlId = db.GetControlId(formId, "MarkImage")
|
||||||
|
Dim bimage() As Byte = Image.ToByteArray(m.Image.BinaryImage)
|
||||||
|
db.UpdateImage(bimage, imageControlId, recordId)
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
logger.Debug("Value updated - Property: {0}, ControlId: {1}", prop, controlId)
|
||||||
|
|
||||||
|
'Dim hasChanged As Boolean = Not db.IsEqual(controlId, recordId, value)
|
||||||
|
'logger.Debug("Value for {0} has changed", recordId)
|
||||||
|
|
||||||
|
'If hasChanged Then
|
||||||
|
' propsChanged = True
|
||||||
|
' ' Wert aktualisieren
|
||||||
|
' db.UpdateValue(controlId, recordId, value)
|
||||||
|
' logger.Debug("Value updated - Property: {0}, ControlId: {1}", prop, controlId)
|
||||||
|
'End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
If propsChanged Then
|
If propsChanged Then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user