diff --git a/EDIDocumentImport/DocumentPositions.vb b/EDIDocumentImport/DocumentPositions.vb deleted file mode 100644 index a61704e..0000000 --- a/EDIDocumentImport/DocumentPositions.vb +++ /dev/null @@ -1,72 +0,0 @@ -Imports DevExpress.XtraGrid.Columns - -Public Class DocumentPositions - ''' - ''' Class to determine the displayed columns in the positions grid - ''' - Public Class OrderPosition - Public Property RowNumber As Integer - Public Property EuropeanArticleNumber As String - Public Property ArticleNumber As String - Public Property ArticleNumberVendor As String - Public Property ArticleDescription As String - Public Property EDIPrice As Double - Public Property WinLinePrice As Double - Public Property Price As Double - Public Property Amount As Double - End Class - - Public Shared Property ColumnRowNumber As New GridColumn With { - .FieldName = "RowNumber", - .Caption = "Nr.", - .VisibleIndex = 0, - .MaxWidth = 30 - } - Public Shared Property ColumnArticleNumber As New GridColumn With { - .FieldName = "ArticleNumber", - .Caption = "Artikelnummer", - .VisibleIndex = 1 - } - Public Shared Property ColumnEuropeanArticleNumber As New GridColumn With { - .FieldName = "EuropeanArticleNumber", - .Caption = "EAN", - .VisibleIndex = 2 - } - Public Shared Property ColumnArticleNumberVendor As New GridColumn With { - .FieldName = "ArticleNumberVendor", - .Caption = "Artikel Lieferant", - .VisibleIndex = 3 - } - Public Shared Property ColumnArticleDescription As New GridColumn With { - .FieldName = "ArticleDescription", - .Caption = "Artikel Beschreibung", - .VisibleIndex = 4 - } - Public Shared Property ColumnAmount As New GridColumn With { - .FieldName = "Amount", - .Caption = "Menge", - .VisibleIndex = 5 - } - Public Shared Property ColumnEDIPrice As New GridColumn With { - .FieldName = "EDIPrice", - .Caption = "Einzelpreis EDI", - .VisibleIndex = 6 - } - Public Shared Property ColumnWinLinePrice As New GridColumn With { - .FieldName = "WinLinePrice", - .Caption = "Einzelpreis WinLine", - .VisibleIndex = 7 - } - Public Shared Property ColumnPrice As New GridColumn With { - .FieldName = "Price", - .Caption = "Einzelpreis", - .VisibleIndex = 8 - } - - ''' - ''' Columns that can be changed in the positions grid - ''' - Public Shared Property WritableColumns As New List(Of GridColumn) From { - ColumnPrice - } -End Class diff --git a/EDIDocumentImport/Exceptions.vb b/EDIDocumentImport/Exceptions.vb index 28c8192..9fb25a8 100644 --- a/EDIDocumentImport/Exceptions.vb +++ b/EDIDocumentImport/Exceptions.vb @@ -1,9 +1,33 @@ Public Class Exceptions - Public Class NoMandatorException + Public MustInherit Class DocumentShowException Inherits ApplicationException Public Sub New(message As String) MyBase.New(message) End Sub End Class + + Public Class NoMandatorException + Inherits DocumentShowException + + Public Sub New(message As String) + MyBase.New(message) + End Sub + End Class + + Public Class MultipleAccountsException + Inherits DocumentShowException + + Public Sub New(message As String) + MyBase.New(message) + End Sub + End Class + + Public Class NoAccountException + Inherits DocumentShowException + + Public Sub New(message As String) + MyBase.New(message) + End Sub + End Class End Class diff --git a/EDIDocumentImport/ImporterForm.vbproj b/EDIDocumentImport/ImporterForm.vbproj index c32d195..e19418b 100644 --- a/EDIDocumentImport/ImporterForm.vbproj +++ b/EDIDocumentImport/ImporterForm.vbproj @@ -148,7 +148,6 @@ - frmMain.vb @@ -156,6 +155,12 @@ Form + + frmMandatorSelection.vb + + + Form + True @@ -172,6 +177,10 @@ Settings.settings True + + + + OrderReport.vb @@ -183,6 +192,9 @@ frmMain.vb + + frmMandatorSelection.vb + VbMyResourcesResXFileCodeGenerator @@ -232,5 +244,6 @@ ImporterShared + \ No newline at end of file diff --git a/EDIDocumentImport/My Project/Resources.resx.bak b/EDIDocumentImport/My Project/Resources.resx.bak new file mode 100644 index 0000000..5c37681 --- /dev/null +++ b/EDIDocumentImport/My Project/Resources.resx.bak @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\singlepageview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\preview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\tilelabels.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\import.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\tableproperties.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\open.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\itemtypechecked.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\bo_validation.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\wraptext.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\open2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\pagesetup.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\deletetablerows.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\showallfieldcodes.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\paymentrefund.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + \ No newline at end of file diff --git a/EDIDocumentImport/My Project/licenses.licx.bak b/EDIDocumentImport/My Project/licenses.licx.bak new file mode 100644 index 0000000..1a37add --- /dev/null +++ b/EDIDocumentImport/My Project/licenses.licx.bak @@ -0,0 +1,16 @@ +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraReports.UserDesigner.XRDesignDockManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraReports.UserDesigner.XRDesignBarManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/EDIDocumentImport/Positions/Position.vb b/EDIDocumentImport/Positions/Position.vb new file mode 100644 index 0000000..1279f22 --- /dev/null +++ b/EDIDocumentImport/Positions/Position.vb @@ -0,0 +1,14 @@ +Namespace Positions + Public Class Position + Public Property RowNumber As Integer + Public Property EuropeanArticleNumber As String + Public Property ArticleNumber As String + Public Property ArticleNumberVendor As String + Public Property ArticleDescription As String + Public Property EDIPrice As Double + Public Property WinLinePrice As Double + Public Property Price As Double + Public Property Amount As Double + End Class + +End Namespace \ No newline at end of file diff --git a/EDIDocumentImport/Positions/PositionColumns.vb b/EDIDocumentImport/Positions/PositionColumns.vb new file mode 100644 index 0000000..b069096 --- /dev/null +++ b/EDIDocumentImport/Positions/PositionColumns.vb @@ -0,0 +1,70 @@ +Imports DevExpress.XtraGrid.Columns + +Namespace Positions + Public Class PositionColumns + Public Shared Property ColumnRowNumber As New GridColumn With { + .FieldName = "RowNumber", + .Caption = "Nr.", + .VisibleIndex = 0, + .MaxWidth = 30 + } + Public Shared Property ColumnArticleNumber As New GridColumn With { + .FieldName = "ArticleNumber", + .Caption = "Artikelnummer", + .VisibleIndex = 1 + } + Public Shared Property ColumnEuropeanArticleNumber As New GridColumn With { + .FieldName = "EuropeanArticleNumber", + .Caption = "EAN", + .VisibleIndex = 2 + } + Public Shared Property ColumnArticleNumberVendor As New GridColumn With { + .FieldName = "ArticleNumberVendor", + .Caption = "Artikel Lieferant", + .VisibleIndex = 3 + } + Public Shared Property ColumnArticleDescription As New GridColumn With { + .FieldName = "ArticleDescription", + .Caption = "Artikel Beschreibung", + .VisibleIndex = 4 + } + Public Shared Property ColumnAmount As New GridColumn With { + .FieldName = "Amount", + .Caption = "Menge", + .VisibleIndex = 5 + } + Public Shared Property ColumnEDIPrice As New GridColumn With { + .FieldName = "EDIPrice", + .Caption = "Einzelpreis EDI", + .VisibleIndex = 6 + } + Public Shared Property ColumnWinLinePrice As New GridColumn With { + .FieldName = "WinLinePrice", + .Caption = "Einzelpreis WinLine", + .VisibleIndex = 7 + } + Public Shared Property ColumnPrice As New GridColumn With { + .FieldName = "Price", + .Caption = "Einzelpreis", + .VisibleIndex = 8 + } + + ''' + ''' Columns that can be changed in the positions grid + ''' + Public Shared Property WritableColumns As New List(Of GridColumn) From { + ColumnPrice + } + + Public Shared Property AllColumns As New List(Of GridColumn) From { + ColumnRowNumber, + ColumnArticleNumber, + ColumnArticleNumberVendor, + ColumnEuropeanArticleNumber, + ColumnArticleDescription, + ColumnEDIPrice, + ColumnWinLinePrice, + ColumnPrice + } + End Class +End Namespace diff --git a/EDIDocumentImport/Positions/PositionData.vb b/EDIDocumentImport/Positions/PositionData.vb new file mode 100644 index 0000000..fd49a37 --- /dev/null +++ b/EDIDocumentImport/Positions/PositionData.vb @@ -0,0 +1,30 @@ +Imports ImporterForm.Positions +Imports ImporterShared.Schemas + +Public Class PositionData + Public Shared Function Load(pData As Orders.Input.MESOWebService, pDataOriginal As Orders.Input.MESOWebService) As List(Of Position) + Dim oPositions = Orders.Helpers.GetOrderPositions(pData) + Dim oPositionsOriginal = Orders.Helpers.GetOrderPositions(pDataOriginal) + Dim oPositionList As New List(Of Position) + + For Each oPosition In oPositions + Dim oPositionOriginal = oPositionsOriginal. + Where(Function(p) p.Zeilennummer = oPosition.Zeilennummer). + SingleOrDefault() + + oPositionList.Add(New Position With { + .ArticleNumber = oPosition.Artikelnummer, + .RowNumber = oPosition.Zeilennummer, + .ArticleDescription = oPosition.Bezeichnung, + .ArticleNumberVendor = oPosition.Lieferantenartikelnummer, + .EDIPrice = oPosition.Einzelpreis, + .WinLinePrice = 0, + .Price = 0, + .Amount = oPosition.Menge_bestellt, + .EuropeanArticleNumber = oPositionOriginal.Artikelnummer + }) + Next + + Return oPositionList + End Function +End Class diff --git a/EDIDocumentImport/Positions/PositionGrid.vb b/EDIDocumentImport/Positions/PositionGrid.vb new file mode 100644 index 0000000..4a44d28 --- /dev/null +++ b/EDIDocumentImport/Positions/PositionGrid.vb @@ -0,0 +1,45 @@ +Imports DevExpress.XtraGrid.Columns +Imports DevExpress.XtraGrid.Views.Grid +Imports ImporterShared.Documents +Imports ImporterForm.Positions + +Namespace Positions + Public Class PositionGrid + Public Shared Sub LoadPositionViewAndColumns(pView As GridView, pDocumentType As DocumentType) + Dim oColumns As List(Of GridColumn) + + ' Create columns list depending on DocumentType + Select Case pDocumentType + Case DocumentType.Order + oColumns = PositionColumns.AllColumns + + Case Else + oColumns = New List(Of GridColumn) + End Select + + ' Reset the grid + pView.GridControl.DataSource = Nothing + pView.GridControl.ForceInitialize() + + ' Clear, add and adjust columns + pView.Columns.Clear() + pView.Columns.AddRange(oColumns.ToArray()) + pView.BestFitColumns() + + ' Set columns readonly that need it + Dim oReadOnlyColumns = oColumns. + Except(PositionColumns.WritableColumns). + ToList() + + For Each oColumn As GridColumn In pView.Columns + If oReadOnlyColumns.Contains(oColumn) Then + oColumn.OptionsColumn.ReadOnly = True + oColumn.OptionsColumn.AllowEdit = False + Else + oColumn.Caption &= " *" + End If + Next + End Sub + End Class + +End Namespace \ No newline at end of file diff --git a/EDIDocumentImport/frmMain.Designer.vb b/EDIDocumentImport/frmMain.Designer.vb index f7a4721..c0dd579 100644 --- a/EDIDocumentImport/frmMain.Designer.vb +++ b/EDIDocumentImport/frmMain.Designer.vb @@ -30,7 +30,7 @@ Partial Class frmMain Me.BarButtonItem4 = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonItem5 = New DevExpress.XtraBars.BarButtonItem() Me.txtVersion = New DevExpress.XtraBars.BarStaticItem() - Me.BarButtonItem6 = New DevExpress.XtraBars.BarButtonItem() + Me.btnDeletePosition = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonItem7 = New DevExpress.XtraBars.BarButtonItem() Me.BarButtonItem8 = New DevExpress.XtraBars.BarButtonItem() Me.btnPreviewReport = New DevExpress.XtraBars.BarButtonItem() @@ -51,7 +51,7 @@ Partial Class frmMain Me.colFilePath = New DevExpress.XtraGrid.Columns.GridColumn() Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl() - Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl() + Me.LayoutControlHead = New DevExpress.XtraLayout.LayoutControl() Me.txtOrderIssuer = New DevExpress.XtraEditors.TextEdit() Me.MemoEdit1 = New DevExpress.XtraEditors.MemoEdit() Me.txtOrderNumber = New DevExpress.XtraEditors.TextEdit() @@ -64,6 +64,8 @@ Partial Class frmMain Me.dateOrderDate = New DevExpress.XtraEditors.DateEdit() Me.cmbMandator = New DevExpress.XtraEditors.SearchLookUpEdit() Me.SearchLookUpEdit1View = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colId = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colName = New DevExpress.XtraGrid.Columns.GridColumn() Me.cmbCustomer = New DevExpress.XtraEditors.SearchLookUpEdit() Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() Me.cmbDeliveryAddress = New DevExpress.XtraEditors.SearchLookUpEdit() @@ -79,7 +81,6 @@ Partial Class frmMain Me.LayoutControlItem5 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutItemOrderIssuer = New DevExpress.XtraLayout.LayoutControlItem() - Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutItemOrderNumber = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutItemOrderDate = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem12 = New DevExpress.XtraLayout.LayoutControlItem() @@ -89,6 +90,7 @@ Partial Class frmMain Me.LayoutControlItem11 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItemRunningNumber = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem14 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlGroup1 = New DevExpress.XtraLayout.LayoutControlGroup() Me.LayoutControlItem10 = New DevExpress.XtraLayout.LayoutControlItem() Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem() @@ -106,8 +108,8 @@ Partial Class frmMain Me.SplitContainerControl1.SuspendLayout() CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl2.SuspendLayout() - CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.LayoutControl1.SuspendLayout() + CType(Me.LayoutControlHead, System.ComponentModel.ISupportInitialize).BeginInit() + Me.LayoutControlHead.SuspendLayout() CType(Me.txtOrderIssuer.Properties, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.MemoEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.txtOrderNumber.Properties, System.ComponentModel.ISupportInitialize).BeginInit() @@ -136,7 +138,6 @@ Partial Class frmMain CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutItemOrderIssuer, System.ComponentModel.ISupportInitialize).BeginInit() - CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutItemOrderNumber, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutItemOrderDate, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem12, System.ComponentModel.ISupportInitialize).BeginInit() @@ -146,6 +147,7 @@ Partial Class frmMain CType(Me.LayoutControlItem11, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItemRunningNumber, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem14, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit() @@ -161,7 +163,7 @@ Partial Class frmMain 'RibbonControl ' Me.RibbonControl.ExpandCollapseItem.Id = 0 - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.btnLoadDocuments, Me.txtFilesLoaded, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3, Me.checkShowXml, Me.BarButtonItem4, Me.BarButtonItem5, Me.txtVersion, Me.BarButtonItem6, Me.BarButtonItem7, Me.BarButtonItem8, Me.btnPreviewReport, Me.btnReportPreview, Me.btnReloadDocument}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.btnLoadDocuments, Me.txtFilesLoaded, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3, Me.checkShowXml, Me.BarButtonItem4, Me.BarButtonItem5, Me.txtVersion, Me.btnDeletePosition, Me.BarButtonItem7, Me.BarButtonItem8, Me.btnPreviewReport, Me.btnReportPreview, Me.btnReloadDocument}) Me.RibbonControl.Location = New System.Drawing.Point(0, 0) Me.RibbonControl.MaxItemId = 19 Me.RibbonControl.Name = "RibbonControl" @@ -235,12 +237,12 @@ Partial Class frmMain Me.txtVersion.Id = 12 Me.txtVersion.Name = "txtVersion" ' - 'BarButtonItem6 + 'btnDeletePosition ' - Me.BarButtonItem6.Caption = "Zeile löschen" - Me.BarButtonItem6.Id = 13 - Me.BarButtonItem6.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.deletetablerows - Me.BarButtonItem6.Name = "BarButtonItem6" + Me.btnDeletePosition.Caption = "Zeile löschen" + Me.btnDeletePosition.Id = 13 + Me.btnDeletePosition.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.deletetablerows + Me.btnDeletePosition.Name = "btnDeletePosition" ' 'BarButtonItem7 ' @@ -272,6 +274,7 @@ Partial Class frmMain 'btnReloadDocument ' Me.btnReloadDocument.Caption = "Aktuelles Dokument erneut laden" + Me.btnReloadDocument.Enabled = False Me.btnReloadDocument.Id = 18 Me.btnReloadDocument.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.paymentrefund Me.btnReloadDocument.Name = "btnReloadDocument" @@ -324,7 +327,7 @@ Partial Class frmMain 'RibbonGroupPositions ' Me.RibbonGroupPositions.Enabled = False - Me.RibbonGroupPositions.ItemLinks.Add(Me.BarButtonItem6) + Me.RibbonGroupPositions.ItemLinks.Add(Me.btnDeletePosition) Me.RibbonGroupPositions.ItemLinks.Add(Me.BarButtonItem7) Me.RibbonGroupPositions.Name = "RibbonGroupPositions" Me.RibbonGroupPositions.Text = "Belegpositionen" @@ -407,7 +410,7 @@ Partial Class frmMain Me.SplitContainerControl2.Horizontal = False Me.SplitContainerControl2.Location = New System.Drawing.Point(0, 0) Me.SplitContainerControl2.Name = "SplitContainerControl2" - Me.SplitContainerControl2.Panel1.Controls.Add(Me.LayoutControl1) + Me.SplitContainerControl2.Panel1.Controls.Add(Me.LayoutControlHead) Me.SplitContainerControl2.Panel1.Text = "Panel1" Me.SplitContainerControl2.Panel2.Controls.Add(Me.GridControlPositions) Me.SplitContainerControl2.Panel2.Text = "Panel2" @@ -415,34 +418,35 @@ Partial Class frmMain Me.SplitContainerControl2.SplitterPosition = 275 Me.SplitContainerControl2.TabIndex = 0 ' - 'LayoutControl1 + 'LayoutControlHead ' - Me.LayoutControl1.Controls.Add(Me.txtOrderIssuer) - Me.LayoutControl1.Controls.Add(Me.MemoEdit1) - Me.LayoutControl1.Controls.Add(Me.txtOrderNumber) - Me.LayoutControl1.Controls.Add(Me.TextEdit5) - Me.LayoutControl1.Controls.Add(Me.TextEdit6) - Me.LayoutControl1.Controls.Add(Me.TextEdit7) - Me.LayoutControl1.Controls.Add(Me.TextEdit8) - Me.LayoutControl1.Controls.Add(Me.TextEdit9) - Me.LayoutControl1.Controls.Add(Me.txtRunningNumber) - Me.LayoutControl1.Controls.Add(Me.dateOrderDate) - Me.LayoutControl1.Controls.Add(Me.cmbMandator) - Me.LayoutControl1.Controls.Add(Me.cmbCustomer) - Me.LayoutControl1.Controls.Add(Me.cmbDeliveryAddress) - Me.LayoutControl1.Controls.Add(Me.cmbYears) - Me.LayoutControl1.Controls.Add(Me.txtCustomerGLN) - Me.LayoutControl1.Controls.Add(Me.txtDeliveryAddressGLN) - Me.LayoutControl1.Controls.Add(Me.txtDocumentKind) - Me.LayoutControl1.Controls.Add(Me.txtDocumentReference) - Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.LayoutControl1.Location = New System.Drawing.Point(0, 0) - Me.LayoutControl1.Name = "LayoutControl1" - Me.LayoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = New System.Drawing.Rectangle(1270, 166, 650, 400) - Me.LayoutControl1.Root = Me.Root - Me.LayoutControl1.Size = New System.Drawing.Size(1062, 275) - Me.LayoutControl1.TabIndex = 0 - Me.LayoutControl1.Text = "LayoutControl1" + Me.LayoutControlHead.Controls.Add(Me.txtOrderIssuer) + Me.LayoutControlHead.Controls.Add(Me.MemoEdit1) + Me.LayoutControlHead.Controls.Add(Me.txtOrderNumber) + Me.LayoutControlHead.Controls.Add(Me.TextEdit5) + Me.LayoutControlHead.Controls.Add(Me.TextEdit6) + Me.LayoutControlHead.Controls.Add(Me.TextEdit7) + Me.LayoutControlHead.Controls.Add(Me.TextEdit8) + Me.LayoutControlHead.Controls.Add(Me.TextEdit9) + Me.LayoutControlHead.Controls.Add(Me.txtRunningNumber) + Me.LayoutControlHead.Controls.Add(Me.dateOrderDate) + Me.LayoutControlHead.Controls.Add(Me.cmbMandator) + Me.LayoutControlHead.Controls.Add(Me.cmbCustomer) + Me.LayoutControlHead.Controls.Add(Me.cmbDeliveryAddress) + Me.LayoutControlHead.Controls.Add(Me.cmbYears) + Me.LayoutControlHead.Controls.Add(Me.txtCustomerGLN) + Me.LayoutControlHead.Controls.Add(Me.txtDeliveryAddressGLN) + Me.LayoutControlHead.Controls.Add(Me.txtDocumentKind) + Me.LayoutControlHead.Controls.Add(Me.txtDocumentReference) + Me.LayoutControlHead.Dock = System.Windows.Forms.DockStyle.Fill + Me.LayoutControlHead.Enabled = False + Me.LayoutControlHead.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlHead.Name = "LayoutControlHead" + Me.LayoutControlHead.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = New System.Drawing.Rectangle(1270, 166, 650, 400) + Me.LayoutControlHead.Root = Me.Root + Me.LayoutControlHead.Size = New System.Drawing.Size(1062, 275) + Me.LayoutControlHead.TabIndex = 0 + Me.LayoutControlHead.Text = "LayoutControl1" ' 'txtOrderIssuer ' @@ -450,16 +454,16 @@ Partial Class frmMain Me.txtOrderIssuer.MenuManager = Me.RibbonControl Me.txtOrderIssuer.Name = "txtOrderIssuer" Me.txtOrderIssuer.Size = New System.Drawing.Size(264, 20) - Me.txtOrderIssuer.StyleController = Me.LayoutControl1 + Me.txtOrderIssuer.StyleController = Me.LayoutControlHead Me.txtOrderIssuer.TabIndex = 6 ' 'MemoEdit1 ' - Me.MemoEdit1.Location = New System.Drawing.Point(123, 170) + Me.MemoEdit1.Location = New System.Drawing.Point(632, 170) Me.MemoEdit1.MenuManager = Me.RibbonControl Me.MemoEdit1.Name = "MemoEdit1" - Me.MemoEdit1.Size = New System.Drawing.Size(912, 34) - Me.MemoEdit1.StyleController = Me.LayoutControl1 + Me.MemoEdit1.Size = New System.Drawing.Size(403, 78) + Me.MemoEdit1.StyleController = Me.LayoutControlHead Me.MemoEdit1.TabIndex = 12 ' 'txtOrderNumber @@ -468,7 +472,7 @@ Partial Class frmMain Me.txtOrderNumber.MenuManager = Me.RibbonControl Me.txtOrderNumber.Name = "txtOrderNumber" Me.txtOrderNumber.Size = New System.Drawing.Size(217, 20) - Me.txtOrderNumber.StyleController = Me.LayoutControl1 + Me.txtOrderNumber.StyleController = Me.LayoutControlHead Me.txtOrderNumber.TabIndex = 7 ' 'TextEdit5 @@ -477,7 +481,7 @@ Partial Class frmMain Me.TextEdit5.MenuManager = Me.RibbonControl Me.TextEdit5.Name = "TextEdit5" Me.TextEdit5.Size = New System.Drawing.Size(599, 20) - Me.TextEdit5.StyleController = Me.LayoutControl1 + Me.TextEdit5.StyleController = Me.LayoutControlHead Me.TextEdit5.TabIndex = 3 ' 'TextEdit6 @@ -486,7 +490,7 @@ Partial Class frmMain Me.TextEdit6.MenuManager = Me.RibbonControl Me.TextEdit6.Name = "TextEdit6" Me.TextEdit6.Size = New System.Drawing.Size(207, 20) - Me.TextEdit6.StyleController = Me.LayoutControl1 + Me.TextEdit6.StyleController = Me.LayoutControlHead Me.TextEdit6.TabIndex = 5 ' 'TextEdit7 @@ -495,7 +499,7 @@ Partial Class frmMain Me.TextEdit7.MenuManager = Me.RibbonControl Me.TextEdit7.Name = "TextEdit7" Me.TextEdit7.Size = New System.Drawing.Size(689, 20) - Me.TextEdit7.StyleController = Me.LayoutControl1 + Me.TextEdit7.StyleController = Me.LayoutControlHead Me.TextEdit7.TabIndex = 11 ' 'TextEdit8 @@ -504,7 +508,7 @@ Partial Class frmMain Me.TextEdit8.MenuManager = Me.RibbonControl Me.TextEdit8.Name = "TextEdit8" Me.TextEdit8.Size = New System.Drawing.Size(117, 20) - Me.TextEdit8.StyleController = Me.LayoutControl1 + Me.TextEdit8.StyleController = Me.LayoutControlHead Me.TextEdit8.TabIndex = 9 ' 'TextEdit9 @@ -513,7 +517,7 @@ Partial Class frmMain Me.TextEdit9.MenuManager = Me.RibbonControl Me.TextEdit9.Name = "TextEdit9" Me.TextEdit9.Size = New System.Drawing.Size(912, 20) - Me.TextEdit9.StyleController = Me.LayoutControl1 + Me.TextEdit9.StyleController = Me.LayoutControlHead Me.TextEdit9.TabIndex = 13 ' 'txtRunningNumber @@ -522,7 +526,7 @@ Partial Class frmMain Me.txtRunningNumber.MenuManager = Me.RibbonControl Me.txtRunningNumber.Name = "txtRunningNumber" Me.txtRunningNumber.Size = New System.Drawing.Size(124, 20) - Me.txtRunningNumber.StyleController = Me.LayoutControl1 + Me.txtRunningNumber.StyleController = Me.LayoutControlHead Me.txtRunningNumber.TabIndex = 2 ' 'dateOrderDate @@ -534,7 +538,7 @@ Partial Class frmMain Me.dateOrderDate.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateOrderDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.dateOrderDate.Size = New System.Drawing.Size(219, 20) - Me.dateOrderDate.StyleController = Me.LayoutControl1 + Me.dateOrderDate.StyleController = Me.LayoutControlHead Me.dateOrderDate.TabIndex = 8 ' 'cmbMandator @@ -546,16 +550,33 @@ Partial Class frmMain Me.cmbMandator.Properties.NullText = "" Me.cmbMandator.Properties.PopupView = Me.SearchLookUpEdit1View Me.cmbMandator.Size = New System.Drawing.Size(235, 20) - Me.cmbMandator.StyleController = Me.LayoutControl1 + Me.cmbMandator.StyleController = Me.LayoutControlHead Me.cmbMandator.TabIndex = 4 ' 'SearchLookUpEdit1View ' + Me.SearchLookUpEdit1View.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colId, Me.colName}) Me.SearchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus Me.SearchLookUpEdit1View.Name = "SearchLookUpEdit1View" Me.SearchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = False Me.SearchLookUpEdit1View.OptionsView.ShowGroupPanel = False ' + 'colId + ' + Me.colId.Caption = "Kürzel" + Me.colId.FieldName = "Id" + Me.colId.Name = "colId" + Me.colId.Visible = True + Me.colId.VisibleIndex = 0 + ' + 'colName + ' + Me.colName.Caption = "Bezeichnung" + Me.colName.FieldName = "Name" + Me.colName.Name = "colName" + Me.colName.Visible = True + Me.colName.VisibleIndex = 1 + ' 'cmbCustomer ' Me.cmbCustomer.Location = New System.Drawing.Point(123, 80) @@ -565,7 +586,7 @@ Partial Class frmMain Me.cmbCustomer.Properties.NullText = "" Me.cmbCustomer.Properties.PopupView = Me.GridView1 Me.cmbCustomer.Size = New System.Drawing.Size(402, 20) - Me.cmbCustomer.StyleController = Me.LayoutControl1 + Me.cmbCustomer.StyleController = Me.LayoutControlHead Me.cmbCustomer.TabIndex = 10 ' 'GridView1 @@ -585,7 +606,7 @@ Partial Class frmMain Me.cmbDeliveryAddress.Properties.PopupSizeable = False Me.cmbDeliveryAddress.Properties.PopupView = Me.GridView2 Me.cmbDeliveryAddress.Size = New System.Drawing.Size(402, 20) - Me.cmbDeliveryAddress.StyleController = Me.LayoutControl1 + Me.cmbDeliveryAddress.StyleController = Me.LayoutControlHead Me.cmbDeliveryAddress.TabIndex = 14 ' 'GridView2 @@ -602,7 +623,7 @@ Partial Class frmMain Me.cmbYears.Name = "cmbYears" Me.cmbYears.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) Me.cmbYears.Size = New System.Drawing.Size(132, 20) - Me.cmbYears.StyleController = Me.LayoutControl1 + Me.cmbYears.StyleController = Me.LayoutControlHead Me.cmbYears.TabIndex = 15 ' 'txtCustomerGLN @@ -611,7 +632,7 @@ Partial Class frmMain Me.txtCustomerGLN.MenuManager = Me.RibbonControl Me.txtCustomerGLN.Name = "txtCustomerGLN" Me.txtCustomerGLN.Size = New System.Drawing.Size(404, 20) - Me.txtCustomerGLN.StyleController = Me.LayoutControl1 + Me.txtCustomerGLN.StyleController = Me.LayoutControlHead Me.txtCustomerGLN.TabIndex = 16 ' 'txtDeliveryAddressGLN @@ -620,7 +641,7 @@ Partial Class frmMain Me.txtDeliveryAddressGLN.MenuManager = Me.RibbonControl Me.txtDeliveryAddressGLN.Name = "txtDeliveryAddressGLN" Me.txtDeliveryAddressGLN.Size = New System.Drawing.Size(404, 20) - Me.txtDeliveryAddressGLN.StyleController = Me.LayoutControl1 + Me.txtDeliveryAddressGLN.StyleController = Me.LayoutControlHead Me.txtDeliveryAddressGLN.TabIndex = 17 ' 'txtDocumentKind @@ -629,16 +650,16 @@ Partial Class frmMain Me.txtDocumentKind.MenuManager = Me.RibbonControl Me.txtDocumentKind.Name = "txtDocumentKind" Me.txtDocumentKind.Size = New System.Drawing.Size(103, 20) - Me.txtDocumentKind.StyleController = Me.LayoutControl1 + Me.txtDocumentKind.StyleController = Me.LayoutControlHead Me.txtDocumentKind.TabIndex = 18 ' 'txtDocumentReference ' - Me.txtDocumentReference.Location = New System.Drawing.Point(123, 214) + Me.txtDocumentReference.Location = New System.Drawing.Point(123, 170) Me.txtDocumentReference.MenuManager = Me.RibbonControl Me.txtDocumentReference.Name = "txtDocumentReference" - Me.txtDocumentReference.Size = New System.Drawing.Size(912, 34) - Me.txtDocumentReference.StyleController = Me.LayoutControl1 + Me.txtDocumentReference.Size = New System.Drawing.Size(403, 78) + Me.txtDocumentReference.StyleController = Me.LayoutControlHead Me.txtDocumentReference.TabIndex = 19 ' 'Root @@ -660,7 +681,7 @@ Partial Class frmMain ' 'LayoutControlGroup2 ' - Me.LayoutControlGroup2.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem5, Me.LayoutControlItem2, Me.LayoutItemOrderIssuer, Me.LayoutControlItem3, Me.LayoutItemOrderNumber, Me.LayoutItemOrderDate, Me.LayoutControlItem12, Me.LayoutControlItem13, Me.LayoutControlItem1, Me.LayoutControlItem4, Me.LayoutControlItem11, Me.LayoutControlItemRunningNumber, Me.LayoutControlItem14}) + Me.LayoutControlGroup2.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem5, Me.LayoutControlItem2, Me.LayoutItemOrderIssuer, Me.LayoutItemOrderNumber, Me.LayoutItemOrderDate, Me.LayoutControlItem12, Me.LayoutControlItem13, Me.LayoutControlItem1, Me.LayoutControlItem4, Me.LayoutControlItem11, Me.LayoutControlItemRunningNumber, Me.LayoutControlItem14, Me.LayoutControlItem3}) Me.LayoutControlGroup2.Location = New System.Drawing.Point(0, 0) Me.LayoutControlGroup2.Name = "LayoutControlGroup2" Me.LayoutControlGroup2.Size = New System.Drawing.Size(1018, 208) @@ -696,16 +717,6 @@ Partial Class frmMain Me.LayoutItemOrderIssuer.Text = "Besteller" Me.LayoutItemOrderIssuer.TextSize = New System.Drawing.Size(93, 13) ' - 'LayoutControlItem3 - ' - Me.LayoutControlItem3.Control = Me.MemoEdit1 - Me.LayoutControlItem3.Location = New System.Drawing.Point(0, 120) - Me.LayoutControlItem3.Name = "LayoutControlItem3" - Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) - Me.LayoutControlItem3.Size = New System.Drawing.Size(1018, 44) - Me.LayoutControlItem3.Text = "Freitext" - Me.LayoutControlItem3.TextSize = New System.Drawing.Size(93, 13) - ' 'LayoutItemOrderNumber ' Me.LayoutItemOrderNumber.Control = Me.txtOrderNumber @@ -789,13 +800,23 @@ Partial Class frmMain 'LayoutControlItem14 ' Me.LayoutControlItem14.Control = Me.txtDocumentReference - Me.LayoutControlItem14.Location = New System.Drawing.Point(0, 164) + Me.LayoutControlItem14.Location = New System.Drawing.Point(0, 120) Me.LayoutControlItem14.Name = "LayoutControlItem14" Me.LayoutControlItem14.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) - Me.LayoutControlItem14.Size = New System.Drawing.Size(1018, 44) + Me.LayoutControlItem14.Size = New System.Drawing.Size(509, 88) Me.LayoutControlItem14.Text = "Auftragsreferenz" Me.LayoutControlItem14.TextSize = New System.Drawing.Size(93, 13) ' + 'LayoutControlItem3 + ' + Me.LayoutControlItem3.Control = Me.MemoEdit1 + Me.LayoutControlItem3.Location = New System.Drawing.Point(509, 120) + Me.LayoutControlItem3.Name = "LayoutControlItem3" + Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem3.Size = New System.Drawing.Size(509, 88) + Me.LayoutControlItem3.Text = "Freitext" + Me.LayoutControlItem3.TextSize = New System.Drawing.Size(93, 13) + ' 'LayoutControlGroup1 ' Me.LayoutControlGroup1.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem10, Me.LayoutControlItem6, Me.LayoutControlItem7, Me.LayoutControlItem8, Me.LayoutControlItem9}) @@ -857,6 +878,7 @@ Partial Class frmMain 'GridControlPositions ' Me.GridControlPositions.Dock = System.Windows.Forms.DockStyle.Fill + Me.GridControlPositions.Enabled = False Me.GridControlPositions.Location = New System.Drawing.Point(0, 0) Me.GridControlPositions.MainView = Me.GridViewPositions Me.GridControlPositions.MenuManager = Me.RibbonControl @@ -869,7 +891,6 @@ Partial Class frmMain ' Me.GridViewPositions.GridControl = Me.GridControlPositions Me.GridViewPositions.Name = "GridViewPositions" - Me.GridViewPositions.OptionsView.ShowFooter = True ' 'SplitContainerControl3 ' @@ -919,8 +940,8 @@ Partial Class frmMain Me.SplitContainerControl1.ResumeLayout(False) CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl2.ResumeLayout(False) - CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit() - Me.LayoutControl1.ResumeLayout(False) + CType(Me.LayoutControlHead, System.ComponentModel.ISupportInitialize).EndInit() + Me.LayoutControlHead.ResumeLayout(False) CType(Me.txtOrderIssuer.Properties, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.MemoEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.txtOrderNumber.Properties, System.ComponentModel.ISupportInitialize).EndInit() @@ -949,7 +970,6 @@ Partial Class frmMain CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutItemOrderIssuer, System.ComponentModel.ISupportInitialize).EndInit() - CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutItemOrderNumber, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutItemOrderDate, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem12, System.ComponentModel.ISupportInitialize).EndInit() @@ -959,6 +979,7 @@ Partial Class frmMain CType(Me.LayoutControlItem11, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItemRunningNumber, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem14, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlGroup1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem10, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit() @@ -982,7 +1003,7 @@ Partial Class frmMain Friend WithEvents GridViewFiles As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl Friend WithEvents SplitContainerControl2 As DevExpress.XtraEditors.SplitContainerControl - Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl + Friend WithEvents LayoutControlHead As DevExpress.XtraLayout.LayoutControl Friend WithEvents txtOrderIssuer As DevExpress.XtraEditors.TextEdit Friend WithEvents MemoEdit1 As DevExpress.XtraEditors.MemoEdit Friend WithEvents txtOrderNumber As DevExpress.XtraEditors.TextEdit @@ -1018,7 +1039,7 @@ Partial Class frmMain Friend WithEvents BarButtonItem5 As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonGroupData As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents txtVersion As DevExpress.XtraBars.BarStaticItem - Friend WithEvents BarButtonItem6 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents btnDeletePosition As DevExpress.XtraBars.BarButtonItem Friend WithEvents RibbonGroupPositions As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents BarButtonItem7 As DevExpress.XtraBars.BarButtonItem Friend WithEvents colSelected As DevExpress.XtraGrid.Columns.GridColumn @@ -1053,4 +1074,6 @@ Partial Class frmMain Friend WithEvents LayoutControlItem14 As DevExpress.XtraLayout.LayoutControlItem Friend WithEvents btnReportPreview As DevExpress.XtraBars.BarButtonItem Friend WithEvents btnReloadDocument As DevExpress.XtraBars.BarButtonItem + Friend WithEvents colId As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colName As DevExpress.XtraGrid.Columns.GridColumn End Class diff --git a/EDIDocumentImport/frmMain.vb b/EDIDocumentImport/frmMain.vb index 68cd90c..e556f9a 100644 --- a/EDIDocumentImport/frmMain.vb +++ b/EDIDocumentImport/frmMain.vb @@ -4,6 +4,7 @@ Imports DevExpress.XtraGrid.Columns Imports DevExpress.XtraRichEdit Imports DevExpress.XtraEditors Imports DevExpress.XtraReports.UI +Imports DevExpress.DataAccess.ObjectBinding Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Database Imports DigitalData.Modules.Config @@ -12,7 +13,7 @@ Imports DigitalData.GUIs.Common Imports ImporterShared.Documents Imports ImporterShared.Winline Imports ImporterShared.Schemas -Imports ImporterForm.DocumentPositions +Imports ImporterForm.Positions Public Class frmMain Public LogConfig As LogConfig @@ -65,10 +66,12 @@ Public Class frmMain ' Load data for UI Fields cmbMandator.Properties.DataSource = Winline.Mandators + cmbCustomer.Properties.DataSource = Winline.Accounts cmbDeliveryAddress.Properties.DataSource = Winline.Accounts + cmbYears.Properties.Items.AddRange(Winline.Years) - cmbYears.SelectedItem = Now.Year + cmbYears.SelectedItem = ConfigManager.Config.GetYear() ' Initialize Grids GridBuilder = New GridBuilder(New List(Of GridView) From {GridViewFiles, GridViewPositions}) @@ -82,6 +85,32 @@ Public Class frmMain End Try End Sub +#Region "Helpers" + Private Function GetValidationMessage(FieldName As String) As String + Return $"Das Feld '{FieldName}' muss ausgefüllt werden!" + End Function + + Private Function GetFocusedDocument() As Document + Dim oRowHandles = GridViewFiles.GetSelectedRows().ToList() + Dim oDocument As Document = GridViewFiles.GetRow(oRowHandles.First()) + Return oDocument + End Function + + Private Function GetFocusedPosition() As Position + Dim oRowHandles = GridViewPositions.GetSelectedRows().ToList() + Dim oPosition As Position = GridViewPositions.GetRow(oRowHandles.First()) + Return oPosition + End Function + + Private Sub TryOpenDirectory(pPath As String, pDisplayName As String) + If Directory.Exists(pPath) Then + Process.Start(pPath) + Else + MsgBox($"{pDisplayName} nicht konfiguriert oder nicht gefunden!", MsgBoxStyle.Exclamation, Text) + End If + End Sub +#End Region + Private Sub btnLoadDocuments_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnLoadDocuments.ItemClick Try If DocumentLoader.LoadFiles(ConfigManager.Config.InputDirectory) = True Then @@ -90,6 +119,11 @@ Public Class frmMain RibbonGroupDocument.Enabled = True RibbonGroupPositions.Enabled = True + LayoutControlHead.Enabled = True + GridControlPositions.Enabled = True + + btnReloadDocument.Enabled = True + GridControlFiles.DataSource = DocumentLoader.Files txtFilesLoaded.Caption = $"{DocumentLoader.Files.Count} Dokumente geladen" End If @@ -111,42 +145,63 @@ Public Class frmMain Exit Sub End If - RichEditXml.LoadDocument(oDocument.FullName, DocumentFormat.PlainText) + ShowDocument(oDocument) + End Sub + + Private Sub ShowDocument(pDocument As Document) + ' Load XML File in the sidebar + RichEditXml.LoadDocument(pDocument.FullName, DocumentFormat.PlainText) + + If pDocument.Mandator Is Nothing Then + Dim oForm As New frmMandatorSelection() With { + .Mandators = Winline.Mandators, + .SelectedMandator = Nothing + } + Dim oResult = oForm.ShowDialog() + + If oResult <> DialogResult.OK Then + Exit Sub + End If + + pDocument.Mandator = oForm.SelectedMandator.Id + End If Try - Select Case oDocument.Type + Select Case pDocument.Type Case DocumentType.Order - ShowDocument(oDocument, oDocument.Data, oDocument.DataOriginal) + ShowOrderDocument(pDocument) End Select Catch ex As Xml.XmlException - Dim oMessage As String = $"Fehler beim Laden des Dokuments {oDocument.Name}:{vbNewLine}{ex.Message}" + Dim oMessage As String = $"Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}" MsgBox(oMessage, MsgBoxStyle.Critical, Text) Logger.Error(ex) Catch ex As Exceptions.NoMandatorException - Dim oMessage As String = $"Fehler beim Laden des Dokuments {oDocument.Name}:{vbNewLine}{ex.Message}" + Dim oMessage As String = $"Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}" MsgBox(oMessage, MsgBoxStyle.Critical, Text) Logger.Error(ex) Catch ex As Exception - Dim oMessage As String = $"Unerwarteter Fehler beim Laden des Dokuments {oDocument.Name}:{vbNewLine}{ex.Message}" + Dim oMessage As String = $"Unerwarteter Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}" MsgBox(oMessage, MsgBoxStyle.Critical, Text) Logger.Error(ex) End Try End Sub - Private Sub ShowDocument(pDocument As Document, pData As Orders.Input.MESOWebService, pDataOriginal As Orders.Input.MESOWebService) + Private Sub ShowOrderDocument(pDocument As Document) If pDocument.Mandator Is Nothing Then Throw New Exceptions.NoMandatorException("Es konnte kein Mandant gefunden werden") End If - Dim oHead = GetOrderHead(pData) - Dim oHeadOriginal = GetOrderHead(pDataOriginal) + Dim oData As Orders.Input.MESOWebService = DirectCast(pDocument.Data, Orders.Input.MESOWebService) + Dim oDataOriginal As Orders.Input.MESOWebService = DirectCast(pDocument.DataOriginal, Orders.Input.MESOWebService) + Dim oHead = Orders.Helpers.GetOrderHead(oData) + Dim oHeadOriginal = Orders.Helpers.GetOrderHead(oDataOriginal) - ' ====== Head Data ====== + ' --- Head Data -------------------------------------------------------------------------------------- ' Original, Unreplaced Data txtCustomerGLN.Text = oHeadOriginal.Fakt_Kontonummer @@ -160,121 +215,67 @@ Public Class frmMain txtDocumentReference.Text = oHead.Auftragsreferenz dateOrderDate.EditValue = oHead.Datum_AuftragBestellung - Dim oMandator = Winline.Mandators. - Where(Function(m) m.Id = pDocument.Mandator). - SingleOrDefault() + ' --- Find Mandator -------------------------------------------------------------------------------------- - If oMandator Is Nothing Then - cmbMandator.ErrorText = "Dieses Feld muss ausgefüllt werden!" - cmbMandator.EditValue = Nothing - Else - cmbMandator.EditValue = oMandator - End If + Dim oMandator = Winline.Mandators. + Where(Function(m) m.Id = pDocument.Mandator). + SingleOrDefault() + cmbMandator.EditValue = oMandator + + ' --- Find Accounts -------------------------------------------------------------------------------------- + + ' FAKTURA If oHead.Fakt_Kontonummer = oHeadOriginal.Fakt_Kontonummer Then - cmbCustomer.ErrorText = "Dieses Feld muss ausgefüllt werden!" + cmbCustomer.ErrorText = GetValidationMessage("Faktura Konto") cmbCustomer.EditValue = Nothing Else - cmbCustomer.EditValue = Winline.Accounts. - Where(Function(oAccount) - Dim oSelectedMandator As Mandator = cmbMandator.EditValue - Return oAccount.Id = oHead.Fakt_Kontonummer And oAccount.Mandator = oSelectedMandator.Id - End Function). - SingleOrDefault() + Dim oMatchingAccounts = Winline.Accounts. + Where(Function(oAccount) oAccount.Mandator = oMandator.Id). + Where(Function(oAccount) oAccount.Id = oHead.Fakt_Kontonummer) + + If oMatchingAccounts.Count() > 1 Then + Throw New Exceptions.MultipleAccountsException("Für die Kontonummer wurden mehrere Konten gefunden.") + End If + + If oMatchingAccounts.Count() = 0 Then + Throw New Exceptions.NoAccountException("Für die Kontonummer wurde kein Konto gefunden.") + End If + + cmbCustomer.EditValue = oMatchingAccounts.SingleOrDefault() + End If + ' DEVLIERY If oHead.Lief_Kontonummer = oHeadOriginal.Lief_Kontonummer Then - cmbDeliveryAddress.ErrorText = "Dieses Feld muss ausgefüllt werden!" + cmbDeliveryAddress.ErrorText = GetValidationMessage("Lieferanten Konto") cmbDeliveryAddress.EditValue = Nothing Else - cmbDeliveryAddress.EditValue = Winline.Accounts. - Where(Function(oAccount) oAccount.Id = oHead.Lief_Kontonummer And oAccount.Mandator = cmbMandator.EditValue). - SingleOrDefault() + Dim oMatchingAccounts = Winline.Accounts. + Where(Function(oAccount) oAccount.Mandator = oMandator.Id). + Where(Function(oAccount) oAccount.Id = oHead.Lief_Kontonummer) + + If oMatchingAccounts.Count() > 1 Then + Throw New Exceptions.MultipleAccountsException("Für die Kontonummer wurden mehrere Konten gefunden.") + End If + + If oMatchingAccounts.Count() = 0 Then + Throw New Exceptions.NoAccountException("Für die Kontonummer wurde kein Konto gefunden.") + End If + + cmbDeliveryAddress.EditValue = oMatchingAccounts.SingleOrDefault() + End If - ' TODO - 'cmbMandator.EditValue = Winline.Mandators. - ' Where(Function(m) m.Id = "SIVT"). - ' SingleOrDefault() - 'cmbCustomer.EditValue = Winline.Accounts. - ' Where(Function(oAccount) oAccount.Id = oHead.Fakt_Kontonummer And oAccount.Mandator = cmbMandator.EditValue). - ' SingleOrDefault() + PositionGrid.LoadPositionViewAndColumns(GridViewPositions, DocumentType.Order) - LoadPositionViewAndColumns(GridViewPositions, DocumentType.Order) - LoadPositionData(pData, pDataOriginal) + Dim oPositionList = PositionData.Load(oData, oDataOriginal) + GridControlPositions.DataSource = oPositionList GridViewPositions.BestFitColumns() End Sub - Public Sub LoadPositionData(pData As Orders.Input.MESOWebService, pDataOriginal As Orders.Input.MESOWebService) - Dim oPositions = GetOrderPositions(pData) - Dim oPositionsOriginal = GetOrderPositions(pDataOriginal) - Dim oPositionList As New List(Of OrderPosition) - For Each oPosition In oPositions - Dim oPositionOriginal = oPositionsOriginal. - Where(Function(p) p.Zeilennummer = oPosition.Zeilennummer). - SingleOrDefault() - - oPositionList.Add(New OrderPosition With { - .ArticleNumber = oPosition.Artikelnummer, - .RowNumber = oPosition.Zeilennummer, - .ArticleDescription = oPosition.Bezeichnung, - .ArticleNumberVendor = oPosition.Lieferantenartikelnummer, - .EDIPrice = oPosition.Einzelpreis, - .WinLinePrice = 0, - .Price = 0, - .Amount = oPosition.Menge_bestellt, - .EuropeanArticleNumber = oPositionOriginal.Artikelnummer - }) - Next - - GridControlPositions.DataSource = oPositionList - End Sub - - Public Sub LoadPositionViewAndColumns(pView As GridView, pDocumentType As DocumentType) - Dim oColumns As List(Of GridColumn) - - ' Create columns list depending on DocumentType - Select Case pDocumentType - Case DocumentType.Order - oColumns = New List(Of GridColumn) From { - ColumnRowNumber, - ColumnArticleNumber, - ColumnArticleNumberVendor, - ColumnEuropeanArticleNumber, - ColumnArticleDescription, - ColumnEDIPrice, - ColumnWinLinePrice, - ColumnPrice - } - - Case Else - oColumns = New List(Of GridColumn) - End Select - - ' Reset the grid - pView.GridControl.DataSource = Nothing - pView.GridControl.ForceInitialize() - - ' Add and adjust columns - pView.Columns.AddRange(oColumns.ToArray()) - pView.BestFitColumns() - - ' Set columns readonly that need it - Dim oReadOnlyColumns = oColumns. - Except(DocumentPositions.WritableColumns). - ToList() - - For Each oColumn As GridColumn In GridViewPositions.Columns - If oReadOnlyColumns.Contains(oColumn) Then - oColumn.OptionsColumn.ReadOnly = True - oColumn.OptionsColumn.AllowEdit = False - Else - oColumn.Caption &= " *" - End If - Next - End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick TryOpenDirectory(ConfigManager.Config.InputDirectory, "Eingangsverzeichnis") @@ -313,36 +314,6 @@ Public Class frmMain sender.ErrorText = "" End If End Sub - - Private Sub TryOpenDirectory(pPath As String, pDisplayName As String) - If Directory.Exists(pPath) Then - Process.Start(pPath) - Else - MsgBox($"{pDisplayName} nicht konfiguriert oder nicht gefunden!", MsgBoxStyle.Exclamation, Text) - End If - End Sub - - Private Function GetOrderHead(pData As Orders.Input.MESOWebService) As Orders.Input.MESOWebServiceEXIMVRG_ordersT025 - Dim oHead As Orders.Input.MESOWebServiceEXIMVRG_ordersT025 = pData.Items. - Where(Function(i) TypeOf i Is Orders.Input.MESOWebServiceEXIMVRG_ordersT025). - FirstOrDefault() - Return oHead - End Function - - Private Function GetOrderPositions(pData As Orders.Input.MESOWebService) As List(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026) - Dim oPositions As List(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items. - Where(Function(i) TypeOf i Is Orders.Input.MESOWebServiceEXIMVRG_ordersT026). - Select(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i). - ToList() - Return oPositions - End Function - - Private Function GetFocusedDocument() As Document - Dim oRowHandles = GridViewFiles.GetSelectedRows().ToList() - Dim oDocument As Document = GridViewFiles.GetRow(oRowHandles.First()) - Return oDocument - End Function - Private Sub btnPreviewReport_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnPreviewReport.ItemClick Dim oDocument As Document = GetFocusedDocument() If oDocument Is Nothing Then @@ -352,8 +323,8 @@ Public Class frmMain Dim oReport As New OrderReport() Dim oDataSource = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource With { .DataSource = New Orders.ReportSource With { - .Head = GetOrderHead(oDocument.Data), - .Positions = GetOrderPositions(oDocument.Data) + .Head = Orders.Helpers.GetOrderHead(oDocument.Data), + .Positions = Orders.Helpers.GetOrderPositions(oDocument.Data) } } oDataSource.Fill() @@ -364,6 +335,32 @@ Public Class frmMain End Sub Private Sub btnReloadDocument_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnReloadDocument.ItemClick + Dim oDocument As Document = GetFocusedDocument() + If oDocument Is Nothing Then + Exit Sub + End If + + ShowDocument(oDocument) + End Sub + + Private Sub btnDeletePosition_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeletePosition.ItemClick + Dim oPosition = GetFocusedPosition() + + If oPosition Is Nothing Then + MsgBox("Bitte wählen Sie eine Position aus!", MsgBoxStyle.Exclamation, Text) + Exit Sub + End If + + Dim oResult = MsgBox($"Wollen Sie die ausgewählte Position Artikel [{oPosition.ArticleNumber}] wirklich löschen?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text) + + If oResult = MsgBoxResult.Yes Then + GridViewPositions.DeleteSelectedRows() + MsgBox("Position gelöscht") + End If + End Sub + + Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick + MsgBox("Mach et!") End Sub End Class \ No newline at end of file diff --git a/EDIDocumentImport/frmMandatorSelection.Designer.vb b/EDIDocumentImport/frmMandatorSelection.Designer.vb new file mode 100644 index 0000000..7236fdb --- /dev/null +++ b/EDIDocumentImport/frmMandatorSelection.Designer.vb @@ -0,0 +1,115 @@ + _ +Partial Class frmMandatorSelection + Inherits DevExpress.XtraEditors.XtraForm + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMandatorSelection)) + Me.GridMandators = New DevExpress.XtraGrid.GridControl() + Me.ViewMandators = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl() + Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton() + Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl() + Me.SimpleButton2 = New DevExpress.XtraEditors.SimpleButton() + CType(Me.GridMandators, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.ViewMandators, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.PanelControl1.SuspendLayout() + Me.SuspendLayout() + ' + 'GridMandators + ' + Me.GridMandators.Dock = System.Windows.Forms.DockStyle.Top + Me.GridMandators.Location = New System.Drawing.Point(0, 0) + Me.GridMandators.MainView = Me.ViewMandators + Me.GridMandators.Name = "GridMandators" + Me.GridMandators.Size = New System.Drawing.Size(606, 292) + Me.GridMandators.TabIndex = 0 + Me.GridMandators.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewMandators}) + ' + 'ViewMandators + ' + Me.ViewMandators.GridControl = Me.GridMandators + Me.ViewMandators.Name = "ViewMandators" + ' + 'PanelControl1 + ' + Me.PanelControl1.Controls.Add(Me.LabelControl1) + Me.PanelControl1.Controls.Add(Me.SimpleButton2) + Me.PanelControl1.Controls.Add(Me.SimpleButton1) + Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.PanelControl1.Location = New System.Drawing.Point(0, 292) + Me.PanelControl1.Name = "PanelControl1" + Me.PanelControl1.Size = New System.Drawing.Size(606, 61) + Me.PanelControl1.TabIndex = 1 + ' + 'SimpleButton1 + ' + Me.SimpleButton1.DialogResult = System.Windows.Forms.DialogResult.OK + Me.SimpleButton1.Location = New System.Drawing.Point(465, 6) + Me.SimpleButton1.Name = "SimpleButton1" + Me.SimpleButton1.Size = New System.Drawing.Size(129, 43) + Me.SimpleButton1.TabIndex = 0 + Me.SimpleButton1.Text = "OK" + ' + 'LabelControl1 + ' + Me.LabelControl1.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.LabelControl1.Appearance.Options.UseFont = True + Me.LabelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical + Me.LabelControl1.Location = New System.Drawing.Point(12, 6) + Me.LabelControl1.Name = "LabelControl1" + Me.LabelControl1.Size = New System.Drawing.Size(312, 45) + Me.LabelControl1.TabIndex = 1 + Me.LabelControl1.Text = "Für das Dokument konnte kein eindeutiger Mandant bestimmt werden. Bitte wählen si" & + "e einen Mandanten aus der Liste oder klicken Sie auf Überspringen." + ' + 'SimpleButton2 + ' + Me.SimpleButton2.DialogResult = System.Windows.Forms.DialogResult.Ignore + Me.SimpleButton2.Location = New System.Drawing.Point(330, 6) + Me.SimpleButton2.Name = "SimpleButton2" + Me.SimpleButton2.Size = New System.Drawing.Size(129, 43) + Me.SimpleButton2.TabIndex = 0 + Me.SimpleButton2.Text = "Überspringen" + ' + 'frmMandatorSelection + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(606, 353) + Me.Controls.Add(Me.PanelControl1) + Me.Controls.Add(Me.GridMandators) + Me.IconOptions.SvgImage = CType(resources.GetObject("frmMandatorSelection.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.Name = "frmMandatorSelection" + Me.Text = "Mandanten Auswahl" + CType(Me.GridMandators, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.ViewMandators, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.PanelControl1.ResumeLayout(False) + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents GridMandators As DevExpress.XtraGrid.GridControl + Friend WithEvents ViewMandators As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl + Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton + Friend WithEvents LabelControl1 As DevExpress.XtraEditors.LabelControl + Friend WithEvents SimpleButton2 As DevExpress.XtraEditors.SimpleButton +End Class diff --git a/EDIDocumentImport/frmMandatorSelection.resx b/EDIDocumentImport/frmMandatorSelection.resx new file mode 100644 index 0000000..4185b21 --- /dev/null +++ b/EDIDocumentImport/frmMandatorSelection.resx @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z + LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl + dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAOkDAAAC77u/ + PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi + IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv + MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh + Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg + MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z + ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5SZWR7ZmlsbDojRDExQzFDO30KCS5HcmVlbntmaWxsOiMwMzlD + MjM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuV2hpdGV7ZmlsbDojRkZGRkZGO30KCS5zdDB7b3Bh + Y2l0eTowLjU7fQoJLnN0MXtvcGFjaXR5OjAuNzU7fQoJLnN0MntkaXNwbGF5Om5vbmU7fQoJLnN0M3tk + aXNwbGF5OmlubGluZTtmaWxsOiNGRkIxMTU7fQoJLnN0NHtkaXNwbGF5OmlubGluZTt9Cgkuc3Q1e2Rp + c3BsYXk6aW5saW5lO29wYWNpdHk6MC43NTt9Cgkuc3Q2e2Rpc3BsYXk6aW5saW5lO29wYWNpdHk6MC41 + O30KCS5zdDd7ZGlzcGxheTppbmxpbmU7ZmlsbDojMDM5QzIzO30KCS5zdDh7ZGlzcGxheTppbmxpbmU7 + ZmlsbDojRDExQzFDO30KCS5zdDl7ZGlzcGxheTppbmxpbmU7ZmlsbDojMTE3N0Q3O30KCS5zdDEwe2Rp + c3BsYXk6aW5saW5lO2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU+DQogIDxnIGlkPSJPcmdhbml6YXRpb24i + Pg0KICAgIDxwYXRoIGQ9Ik0yNywxMmgtOVY2aC00djZoLTJWMkg4djEwSDVjLTAuNiwwLTEsMC41LTEs + MXYxNmMwLDAuNSwwLjQsMSwxLDFoMjJjMC42LDAsMS0wLjUsMS0xVjEzICAgQzI4LDEyLjUsMjcuNiwx + MiwyNywxMnogTTEyLDIwSDh2LTRoNFYyMHogTTE4LDIwaC00di00aDRWMjB6IE0yNCwyMGgtNHYtNGg0 + VjIweiIgY2xhc3M9IkJsYWNrIiAvPg0KICA8L2c+DQo8L3N2Zz4L + + + \ No newline at end of file diff --git a/EDIDocumentImport/frmMandatorSelection.vb b/EDIDocumentImport/frmMandatorSelection.vb new file mode 100644 index 0000000..94c672a --- /dev/null +++ b/EDIDocumentImport/frmMandatorSelection.vb @@ -0,0 +1,10 @@ +Imports ImporterShared.Winline + +Public Class frmMandatorSelection + Public Property Mandators As List(Of Mandator) + Public Property SelectedMandator As Mandator + + Private Sub frmMandatorSelection_Load(sender As Object, e As EventArgs) Handles MyBase.Load + MsgBox("TODO: Mach et!") + End Sub +End Class \ No newline at end of file diff --git a/ImporterShared/ImporterShared.vbproj b/ImporterShared/ImporterShared.vbproj index 7a5b2a6..5ed7b6d 100644 --- a/ImporterShared/ImporterShared.vbproj +++ b/ImporterShared/ImporterShared.vbproj @@ -112,6 +112,7 @@ True + diff --git a/ImporterShared/ImporterShared.vbproj.bak b/ImporterShared/ImporterShared.vbproj.bak new file mode 100644 index 0000000..7a5b2a6 --- /dev/null +++ b/ImporterShared/ImporterShared.vbproj.bak @@ -0,0 +1,146 @@ + + + + + Debug + AnyCPU + {DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0} + Library + ImporterShared + ImporterShared + 512 + Windows + v4.6.1 + true + + + true + full + true + true + bin\Debug\ + ImporterShared.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + ImporterShared.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + ..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll + + + + ..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll + + + ..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll + + + ..\..\DDMonorepo\Modules.Language\bin\Release\DigitalData.Modules.Language.dll + + + ..\..\DDMonorepo\Modules.Logging\bin\Release\DigitalData.Modules.Logging.dll + + + + ..\packages\NLog.4.7.10\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + + + + + + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + \ No newline at end of file diff --git a/ImporterShared/Mapper.vb b/ImporterShared/Mapper.vb index e446b1c..c2c1096 100644 --- a/ImporterShared/Mapper.vb +++ b/ImporterShared/Mapper.vb @@ -2,10 +2,10 @@ Imports AutoMapper Imports AutoMapper.Configuration -Public Class Mapper +Public Class MapperFactory Private Shared MapperConfig As Object - Public Shared Function GetMapper() + Public Shared Function GetMapper() As Mapper MapperConfig = New MapperConfiguration(CreateMapperConfig()) MapperConfig.AssertConfigurationIsValid() Return MapperConfig.CreateMapper() diff --git a/ImporterShared/Schemas/Orders/Helpers.vb b/ImporterShared/Schemas/Orders/Helpers.vb new file mode 100644 index 0000000..5aca00d --- /dev/null +++ b/ImporterShared/Schemas/Orders/Helpers.vb @@ -0,0 +1,18 @@ +Namespace Schemas.Orders + Public Class Helpers + Public Shared Function GetOrderHead(pData As Input.MESOWebService) As Input.MESOWebServiceEXIMVRG_ordersT025 + Dim oHead As Input.MESOWebServiceEXIMVRG_ordersT025 = pData.Items. + Where(Function(i) TypeOf i Is Input.MESOWebServiceEXIMVRG_ordersT025). + FirstOrDefault() + Return oHead + End Function + + Public Shared Function GetOrderPositions(pData As Input.MESOWebService) As List(Of Input.MESOWebServiceEXIMVRG_ordersT026) + Dim oPositions As List(Of Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items. + Where(Function(i) TypeOf i Is Input.MESOWebServiceEXIMVRG_ordersT026). + Select(Of Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i). + ToList() + Return oPositions + End Function + End Class +End Namespace diff --git a/ImporterShared/Winline/Account.vb b/ImporterShared/Winline/Account.vb index 6d0eeaf..16cb6cd 100644 --- a/ImporterShared/Winline/Account.vb +++ b/ImporterShared/Winline/Account.vb @@ -3,6 +3,15 @@ Public Property Id As String Public Property Name As String Public Property Mandator As String + + Public Overrides Function GetHashCode() As Integer + Return Id.GetHashCode() + End Function + + Public Overrides Function Equals(obj As Object) As Boolean + Return DirectCast(obj, Account).Id = Id + End Function + Public Overrides Function ToString() As String Return $"{Name} ({Id})" End Function diff --git a/ImporterShared/Winline/Data.vb b/ImporterShared/Winline/Data.vb index 5df3adf..4376a96 100644 --- a/ImporterShared/Winline/Data.vb +++ b/ImporterShared/Winline/Data.vb @@ -162,9 +162,9 @@ Namespace Winline Public Function FindMatchingMandatorFromOrder(pData As Schemas.Orders.Input.MESOWebService) As Mandator Dim oPositions As List(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items. - Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026). - Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i). - ToList() + Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026). + Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i). + ToList() Dim oYear = GetWinLineYear() Dim oMandatorId As String = String.Empty Dim oWhitelistedMandators = Mandators. diff --git a/ImporterShared/Winline/Mandator.vb b/ImporterShared/Winline/Mandator.vb index 10c1762..ec8e9b6 100644 --- a/ImporterShared/Winline/Mandator.vb +++ b/ImporterShared/Winline/Mandator.vb @@ -8,6 +8,14 @@ Public Property Order As Integer Public Property IsWhitelisted As Boolean + Public Overrides Function GetHashCode() As Integer + Return Id.GetHashCode() + End Function + + Public Overrides Function Equals(obj As Object) As Boolean + Return DirectCast(obj, Mandator).Id = Id + End Function + Public Overrides Function ToString() As String Return $"{Name} ({Id})" End Function diff --git a/ImporterShared/Winline/WebService.vb b/ImporterShared/Winline/WebService.vb index 30cd464..774f615 100644 --- a/ImporterShared/Winline/WebService.vb +++ b/ImporterShared/Winline/WebService.vb @@ -20,6 +20,7 @@ Namespace Winline FileEx = New File(pLogConfig) Serializer = New Serializer(pLogConfig) Config = pConfig + Mapper = MapperFactory.GetMapper() End Sub Public Function TransferDocumentToWinLine(pDocument As Document) As Boolean