This commit is contained in:
Jonathan Jenne
2021-10-27 16:38:19 +02:00
parent a519b93f47
commit 3fac097f46
24 changed files with 817 additions and 387 deletions

View File

@@ -6,6 +6,8 @@ Imports ImporterShared.DocumentRow
Imports DevExpress.XtraEditors.Repository
Imports ImporterShared.Winline
Imports DigitalData.Modules.Language
Imports DevExpress.XtraEditors.Controls
Imports System.Globalization
Public Class frmRowEditor
Private ReadOnly _Columns As List(Of String)
@@ -41,10 +43,27 @@ Public Class frmRowEditor
AccountPicker.DisplayMember = "Name"
AccountPicker.ValueMember = "Id"
'DatePicker.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime
'DatePicker.EditFormat.FormatString = "dd/MM/yyyy"
'DatePicker.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime
'DatePicker.DisplayFormat.FormatString = "yyyy-MM-dd"
DatePicker.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime
'DatePicker.EditFormat.FormatString = "yyyy-MM-dd"
DatePicker.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime
'DatePicker.Mask.UseMaskAsDisplayFormat = True
'DatePicker.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime
' DatePicker.Mask.EditMask = "yyyy-MM-dd"
'AddHandler DatePicker.ParseEditValue, AddressOf DatePicker_ParseEditValue
End Sub
Private Sub DatePicker_ParseEditValue(sender As Object, e As ConvertEditValueEventArgs)
If TypeOf e.Value Is String Then
Try
Dim oDateTime = Date.ParseExact(e.Value.ToString, "yyyy-MM-dd hh:mm:ss", CultureInfo.InvariantCulture)
e.Value = oDateTime
e.Handled = True
Catch ex As Exception
End Try
End If
End Sub
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
@@ -89,13 +108,18 @@ Public Class frmRowEditor
End If
Dim oFieldValue As FieldValue = oField.Value
oFieldValue.Final = Utils.Notnull(oRow.Item(COL_VALUE_FINAL), String.Empty)
Dim oGridValue = Utils.NotNull(oRow.Item(COL_VALUE_FINAL), String.Empty)
If _DocumentRow.Fields.ContainsKey(oField.Key) Then
_DocumentRow.Fields.Item(oField.Key) = oFieldValue
Else
_DocumentRow.Fields.Add(oField.Key, oFieldValue)
If Not oFieldValue.Final.Equals(oGridValue) Then
oFieldValue.Final = Utils.NotNull(oRow.Item(COL_VALUE_FINAL), String.Empty)
If _DocumentRow.Fields.ContainsKey(oField.Key) Then
_DocumentRow.Fields.Item(oField.Key) = oFieldValue
Else
_DocumentRow.Fields.Add(oField.Key, oFieldValue)
End If
End If
Next
DialogResult = DialogResult.OK