This commit is contained in:
Jonathan Jenne
2021-10-18 14:25:51 +02:00
parent b7602d896a
commit 5c58e05204
20 changed files with 638 additions and 132 deletions

View File

@@ -5,41 +5,42 @@ Imports ImporterShared.Documents
Public Class frmRowEditor
Private Row As DataRow
Private DocumentRow As ImporterShared.DocumentRow
Private Columns As List(Of String)
Public Sub New(pRow As DataRow, pColumns As List(Of String))
Public Sub New(pColumns As List(Of String), pDocumentRow As ImporterShared.DocumentRow)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Row = pRow
Columns = pColumns
DocumentRow = pDocumentRow
End Sub
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
If Row Is Nothing Then
Exit Sub
End If
Dim oDataTable As New DataTable()
Dim oDict = New Dictionary(Of String, String)
Dim oDict = New Dictionary(Of String, ImporterShared.DocumentRow.FieldValue)
For Each oColumn As String In Columns
Dim oValue
Try
oValue = Row.Item(oColumn)
Catch ex As Exception
oValue = String.Empty
End Try
Dim oField = DocumentRow.Fields.
Where(Function(f) f.Key = oColumn).
SingleOrDefault()
If oField.Value Is Nothing Then
oDict.Add(oColumn, New ImporterShared.DocumentRow.FieldValue())
Else
oDict.Add(oColumn, oField.Value)
End If
oDict.Add(oColumn, oValue)
Next
oDataTable.Columns.Add("KEY")
oDataTable.Columns.Add("VALUE")
oDataTable.Columns.Add("VALUE_ORIGINAL")
oDataTable.Columns.Add("VALUE_EXTERNAL")
oDataTable.Columns.Add("VALUE_FINAL")
For Each oKV In oDict
oDataTable.Rows.Add(oKV.Key, oKV.Value)
oDataTable.Rows.Add(oKV.Key, oKV.Value.Original, oKV.Value.External, oKV.Value.Final)
Next
GridControl1.DataSource = oDataTable