Improve Validation, Report, Transfer document with selected mandator

This commit is contained in:
Jonathan Jenne
2021-11-17 16:25:00 +01:00
parent 47c22e9361
commit 1366343cdf
7 changed files with 119 additions and 44 deletions

View File

@@ -84,6 +84,9 @@ Partial Public Class OrderReport
Me.GroupFooter1 = New DevExpress.XtraReports.UI.GroupFooterBand()
Me.label2 = New DevExpress.XtraReports.UI.XRLabel()
Me.ObjectDataSource1 = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource(Me.components)
Me.XrTableRow4 = New DevExpress.XtraReports.UI.XRTableRow()
Me.XrTableCell11 = New DevExpress.XtraReports.UI.XRTableCell()
Me.XrTableCell12 = New DevExpress.XtraReports.UI.XRTableCell()
CType(Me.XrTable2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.XrTable1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.table3, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -274,7 +277,7 @@ Partial Public Class OrderReport
'Detail
'
Me.Detail.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrTable2, Me.XrTable1})
Me.Detail.HeightF = 50.0!
Me.Detail.HeightF = 75.0!
Me.Detail.KeepTogether = True
Me.Detail.Name = "Detail"
'
@@ -284,8 +287,8 @@ Partial Public Class OrderReport
Me.XrTable2.LocationFloat = New DevExpress.Utils.PointFloat(354.8623!, 0!)
Me.XrTable2.Name = "XrTable2"
Me.XrTable2.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 96.0!)
Me.XrTable2.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.XrTableRow3, Me.XrTableRow5})
Me.XrTable2.SizeF = New System.Drawing.SizeF(288.9166!, 50.0!)
Me.XrTable2.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.XrTableRow3, Me.XrTableRow5, Me.XrTableRow4})
Me.XrTable2.SizeF = New System.Drawing.SizeF(288.9166!, 75.0!)
Me.XrTable2.StylePriority.UseForeColor = False
'
'XrTableRow3
@@ -628,6 +631,29 @@ Partial Public Class OrderReport
Me.ObjectDataSource1.DataSource = GetType(MultiTool.[Shared].ReportSource)
Me.ObjectDataSource1.Name = "ObjectDataSource1"
'
'XrTableRow4
'
Me.XrTableRow4.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.XrTableCell11, Me.XrTableCell12})
Me.XrTableRow4.Name = "XrTableRow4"
Me.XrTableRow4.Weight = 1.0R
'
'XrTableCell11
'
Me.XrTableCell11.Font = New System.Drawing.Font("Arial", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.XrTableCell11.Multiline = True
Me.XrTableCell11.Name = "XrTableCell11"
Me.XrTableCell11.StylePriority.UseFont = False
Me.XrTableCell11.Text = "Bestellt von"
Me.XrTableCell11.Weight = 1.0R
'
'XrTableCell12
'
Me.XrTableCell12.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Text5]")})
Me.XrTableCell12.Multiline = True
Me.XrTableCell12.Name = "XrTableCell12"
Me.XrTableCell12.Text = "XrTableCell12"
Me.XrTableCell12.Weight = 1.0R
'
'OrderReport
'
Me.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.TopMargin, Me.BottomMargin, Me.ReportHeader, Me.Detail, Me.DetailReport})
@@ -713,4 +739,7 @@ Partial Public Class OrderReport
Friend WithEvents XrTableCell7 As DevExpress.XtraReports.UI.XRTableCell
Friend WithEvents XrTableCell8 As DevExpress.XtraReports.UI.XRTableCell
Friend WithEvents XrLabel3 As DevExpress.XtraReports.UI.XRLabel
Friend WithEvents XrTableRow4 As DevExpress.XtraReports.UI.XRTableRow
Friend WithEvents XrTableCell11 As DevExpress.XtraReports.UI.XRTableCell
Friend WithEvents XrTableCell12 As DevExpress.XtraReports.UI.XRTableCell
End Class

View File

@@ -422,7 +422,7 @@ Public Class frmImportMain
SplitContainerGrids.Enabled = False
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
Await WebService.TransferDocumentToWinline(oDocument)
Await WebService.TransferDocumentToWinline(oDocument, lookupMandator.EditValue)
MsgBox(My.Resources.frmImportMainExtra.Datei_erfolgreich_in_die_WinLine_übertragen, MsgBoxStyle.Information, Text)
Catch ex As HttpRequestException
@@ -565,9 +565,11 @@ Public Class frmImportMain
Dim oMapperConfig As New Mapper(LogConfig)
Dim oHeadMapper = oMapperConfig.GetMapper(Of ReportHead)(New Dictionary(Of String, String) From {
{"Fakt_Kontonummer[External]", "Text1"},
{"Fakt_Kontonummer[Final]", "Text2"},
{"Auftrags-Bestellnummer", "Text3"},
{"Datum_Auftrag-Bestellung", "Text4"}
{"Datum_Auftrag-Bestellung", "Text4"},
{"Bestellt_von", "Text5"}
})
Dim oPositionMapper = oMapperConfig.GetMapper(Of ReportPosition)(New Dictionary(Of String, String) From {

View File

@@ -1,14 +1,15 @@
Imports DevExpress.XtraGrid.Views.Grid
Imports System.Globalization
Imports MultiTool.Shared.Documents
Imports MultiTool.Shared.Documents.DocumentRow
Imports DevExpress.XtraEditors.Repository
Imports MultiTool.Shared.Winline
Imports DigitalData.Modules.Language
Imports DevExpress.XtraEditors.Controls
Imports System.Globalization
Imports DevExpress.XtraEditors
Imports DigitalData.Modules.Logging
Imports MultiTool.Shared.Schemas
Imports MultiTool.Shared.Constants
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Logging
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraEditors.Controls
Imports DevExpress.XtraGrid.Views.Grid
Public Class frmRowEditor
Private ReadOnly LogConfig As LogConfig
@@ -29,10 +30,6 @@ Public Class frmRowEditor
Private ReadOnly DocumentKindPicker As New RepositoryItemSearchLookUpEdit
Private ReadOnly ReadOnlyEditor As New RepositoryItemTextEdit
'Private ReadOnly MaskDateEditor As New RepositoryItemTextEdit
'Private ReadOnly DatePicker As New RepositoryItemDateEdit
Private Const COL_KEY = "KEY"
Private Const COL_VALUE_ORIGINAL = "VALUE_ORIGINAL"
Private Const COL_VALUE_EXTERNAL = "VALUE_EXTERNAL"
@@ -45,7 +42,6 @@ Public Class frmRowEditor
End Property
Public Sub New(pLogConfig As LogConfig, pColumns As List(Of String), pDocumentRow As DocumentRow, pMandator As Mandator, pWinline As WinlineData, pTable As Schema.Table)
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
LogConfig = pLogConfig
@@ -105,11 +101,12 @@ Public Class frmRowEditor
Dim oField = _DocumentRow.Fields.
Where(Function(f) f.Key = oColumnName).
SingleOrDefault()
Dim oColumn = _Table.Columns.
Where(Function(c) c.Name = oColumnName).
SingleOrDefault()
' Only Show Columns that are set to visible true
' Only Show Columns that are set to visible
If oColumn?.Config?.IsVisible = False Then
Continue For
End If
@@ -160,6 +157,13 @@ Public Class frmRowEditor
If Not oFieldValue.Final.Equals(oGridValue) Then
Dim oValue = Utils.NotNull(oRow.Item(COL_VALUE_FINAL), String.Empty).ToString
' If new value is not empty, any error will be removed.
' Could cause problems in the future because a value might not equal to 'no error'.
If oValue <> String.Empty Then
oFieldValue.Error = FieldError.None
End If
oFieldValue.Final = oValue.Trim()
If _DocumentRow.Fields.ContainsKey(oField.Key) Then
@@ -222,15 +226,16 @@ Public Class frmRowEditor
Where(Function(c) c.Name = oKey).
SingleOrDefault()
If oColumn Is Nothing Then
Exit Sub
End If
If oColumn.Config?.Function.Name = "GLN" Then
If oColumn.Config?.Function?.Name = FUNCTION_GLN Then
e.RepositoryItem = AccountPicker
End If
If oColumn.Config?.Function.Name = "EAN" Then
If oColumn.Config?.Function?.Name = FUNCTION_EAN Then
e.RepositoryItem = ArticlePicker
End If
@@ -249,22 +254,25 @@ Public Class frmRowEditor
Dim oKey As String = oDataRow.Item(COL_KEY)
Dim oValue As String = oDataRow.Item(COL_VALUE_FINAL)
Dim oColumn = _Table.Columns.
Where(Function(c) c.Name = oKey).
SingleOrDefault()
Where(Function(c) c.Name = oKey).
SingleOrDefault()
Dim oField = _DocumentRow.Fields.
Where(Function(f) f.Key = oKey).
SingleOrDefault()
If e.Column.FieldName = COL_VALUE_FINAL Then
If oColumn Is Nothing Then
If oColumn IsNot Nothing Then
If oColumn.Config?.IsReadOnly Then
e.Appearance.BackColor = Color.LightGray
End If
End If
If oColumn.Config?.IsRequired AndAlso e.CellValue.ToString.Length = 0 Then
e.Appearance.BackColor = Color.LightCoral
End If
If oField.Value.HasError Then
e.Appearance.BackColor = Color.LightCoral
End If
End If
If oColumn.Config?.IsRequired AndAlso oValue.ToString.Length = 0 Then
If oField.Value.HasError Then
e.Appearance.BackColor = Color.LightCoral
End If
End Sub