From 79cfec3173218c62b6dae892446e40751d04e5c6 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 22 Dec 2021 15:38:05 +0100 Subject: [PATCH] directories per template, export tweaks --- MultiTool.Form/FormHelpers.vb | 26 +- MultiTool.Form/MultiTool.Form.vbproj | 5 + .../My Project/Resources.Designer.vb | 50 ++ MultiTool.Form/My Project/Resources.resx | 65 +- MultiTool.Form/My Project/licenses.licx | 14 +- MultiTool.Form/Resources/actions_send4.svg | 15 + MultiTool.Form/Resources/actions_send5.svg | 15 + MultiTool.Form/Resources/open24.svg | 13 + MultiTool.Form/Resources/open25.svg | 13 + MultiTool.Form/Resources/open26.svg | 13 + MultiTool.Form/frmConfig.vb | 2 +- MultiTool.Form/frmExportMain.Designer.vb | 618 +++++++++++++++--- MultiTool.Form/frmExportMain.resx | 6 + MultiTool.Form/frmExportMain.vb | 102 ++- MultiTool.Form/frmImportMain.vb | 24 +- MultiTool.Form/frmMain.Designer.vb | 48 +- MultiTool.Form/frmMain.resx | 2 +- MultiTool.Form/frmMain.vb | 83 ++- MultiTool.Form/frmRowEditor.vb | 2 +- MultiTool.Shared/Config.vb | 1 + MultiTool.Shared/Documents/Document.vb | 2 +- MultiTool.Shared/Documents/DocumentCleaner.vb | 8 +- MultiTool.Shared/Documents/DocumentLoader.vb | 11 +- MultiTool.Shared/Report/ReportGenerator.vb | 4 +- MultiTool.Shared/Templates/GeneralConfig.vb | 20 +- MultiTool.Shared/Templates/Template.vb | 26 + MultiTool.Shared/Templates/TemplateLoader.vb | 43 +- MultiTool.Shared/Winline/Entities/Document.vb | 15 + MultiTool.Shared/Winline/WebServiceData.vb | 109 ++- MultiTool.Shared/Winline/WinlineData.vb | 64 +- 30 files changed, 1160 insertions(+), 259 deletions(-) create mode 100644 MultiTool.Form/Resources/actions_send4.svg create mode 100644 MultiTool.Form/Resources/actions_send5.svg create mode 100644 MultiTool.Form/Resources/open24.svg create mode 100644 MultiTool.Form/Resources/open25.svg create mode 100644 MultiTool.Form/Resources/open26.svg diff --git a/MultiTool.Form/FormHelpers.vb b/MultiTool.Form/FormHelpers.vb index d1b1ecc..78a55d8 100644 --- a/MultiTool.Form/FormHelpers.vb +++ b/MultiTool.Form/FormHelpers.vb @@ -3,9 +3,11 @@ Imports MultiTool.Shared.Exceptions Public Class FormHelper Private ReadOnly Logger As Logger + Private ReadOnly Form As Windows.Forms.Form - Public Sub New(pLogConfig As LogConfig) + Public Sub New(pLogConfig As LogConfig, pForm As Windows.Forms.Form) Logger = pLogConfig.GetLogger() + Form = pForm End Sub Public Sub ShowError(pException As Exception, pFunction As String, Optional pDetails As String = "") @@ -24,7 +26,7 @@ Public Class FormHelper End If Logger.Error(pException) - MsgBox(oMessage, MsgBoxStyle.Critical, Application.ProductName) + MsgBox(oMessage, MsgBoxStyle.Critical, Form.Text) End Sub Public Sub ShowWarning(pMessage As String, Optional pDetails As String = "") @@ -34,7 +36,25 @@ Public Class FormHelper End If Logger.Info(oMessage) - MsgBox(oMessage, MsgBoxStyle.Exclamation, Application.ProductName) + MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text) + End Sub + + Public Sub TryOpenDirectory(pPath As String, pDisplayName As String) + If IO.Directory.Exists(pPath) Then + Process.Start(pPath) + Else + Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName) + MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text) + End If + End Sub + + Public Sub TryOpenFile(pPath As String, pDisplayName As String) + If IO.File.Exists(pPath) Then + Process.Start(pPath) + Else + Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName) + MsgBox(oMessage, MsgBoxStyle.Exclamation, Form.Text) + End If End Sub End Class diff --git a/MultiTool.Form/MultiTool.Form.vbproj b/MultiTool.Form/MultiTool.Form.vbproj index d0c09d0..29d0946 100644 --- a/MultiTool.Form/MultiTool.Form.vbproj +++ b/MultiTool.Form/MultiTool.Form.vbproj @@ -332,6 +332,11 @@ + + + + + diff --git a/MultiTool.Form/My Project/Resources.Designer.vb b/MultiTool.Form/My Project/Resources.Designer.vb index 648d72c..8404a24 100644 --- a/MultiTool.Form/My Project/Resources.Designer.vb +++ b/MultiTool.Form/My Project/Resources.Designer.vb @@ -170,6 +170,26 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property actions_send4() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("actions_send4", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property actions_send5() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("actions_send5", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' @@ -400,6 +420,36 @@ Namespace My.Resources End Get End Property + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property open24() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("open24", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property open25() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("open25", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + + ''' + ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. + ''' + Friend ReadOnly Property open26() As DevExpress.Utils.Svg.SvgImage + Get + Dim obj As Object = ResourceManager.GetObject("open26", resourceCulture) + Return CType(obj,DevExpress.Utils.Svg.SvgImage) + End Get + End Property + ''' ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage. ''' diff --git a/MultiTool.Form/My Project/Resources.resx b/MultiTool.Form/My Project/Resources.resx index b3795cf..d3cce4e 100644 --- a/MultiTool.Form/My Project/Resources.resx +++ b/MultiTool.Form/My Project/Resources.resx @@ -133,8 +133,11 @@ ..\Resources\bo_unknown1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\insertpagecount.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\open25.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\actions_send4.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\wraptext.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -145,17 +148,14 @@ ..\Resources\actions_send3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\open23.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - ..\Resources\preview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\bo_country.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\actions_send2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\insertpagecount.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\tilelabels.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -169,11 +169,14 @@ ..\Resources\squarified.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\actions_reload.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\open21.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\itemtypechecked.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\parameters.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\bo_product.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -181,8 +184,8 @@ ..\Resources\paymentrefund.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\open1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\actions_deletecircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\bo_unknown.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -202,8 +205,8 @@ ..\Resources\singlepageview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\parameters.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\open1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\export.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -214,15 +217,18 @@ ..\Resources\bo_validation.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\actions_reload.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\rotatecounterclockwise.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\actions_deletecircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\actions_send2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\actions_arrow4down.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\actions_checkcircled1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\open2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -235,8 +241,14 @@ ..\Resources\followupall.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\bo_unknown2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\open24.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\actions_send5.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + + ..\Resources\icon_export.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\support.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -247,11 +259,14 @@ ..\Resources\open22.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\bo_unknown2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + ..\Resources\import.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\rotatecounterclockwise.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\open23.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a ..\Resources\pagesetup.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a @@ -265,10 +280,10 @@ ..\Resources\resetview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\actions_checkcircled1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\itemtypechecked.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a - - ..\Resources\icon_export.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + ..\Resources\open26.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a \ No newline at end of file diff --git a/MultiTool.Form/My Project/licenses.licx b/MultiTool.Form/My Project/licenses.licx index 5f5d285..50b2c05 100644 --- a/MultiTool.Form/My Project/licenses.licx +++ b/MultiTool.Form/My Project/licenses.licx @@ -1,5 +1,13 @@ -DevExpress.XtraEditors.GridLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemProgressBar, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a -DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.GridLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.LookUpEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.Repository.RepositoryItemProgressBar, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a +DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a diff --git a/MultiTool.Form/Resources/actions_send4.svg b/MultiTool.Form/Resources/actions_send4.svg new file mode 100644 index 0000000..c0372ba --- /dev/null +++ b/MultiTool.Form/Resources/actions_send4.svg @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/MultiTool.Form/Resources/actions_send5.svg b/MultiTool.Form/Resources/actions_send5.svg new file mode 100644 index 0000000..c0372ba --- /dev/null +++ b/MultiTool.Form/Resources/actions_send5.svg @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/MultiTool.Form/Resources/open24.svg b/MultiTool.Form/Resources/open24.svg new file mode 100644 index 0000000..04ab349 --- /dev/null +++ b/MultiTool.Form/Resources/open24.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/MultiTool.Form/Resources/open25.svg b/MultiTool.Form/Resources/open25.svg new file mode 100644 index 0000000..04ab349 --- /dev/null +++ b/MultiTool.Form/Resources/open25.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/MultiTool.Form/Resources/open26.svg b/MultiTool.Form/Resources/open26.svg new file mode 100644 index 0000000..04ab349 --- /dev/null +++ b/MultiTool.Form/Resources/open26.svg @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/MultiTool.Form/frmConfig.vb b/MultiTool.Form/frmConfig.vb index 31ffcbf..76f09db 100644 --- a/MultiTool.Form/frmConfig.vb +++ b/MultiTool.Form/frmConfig.vb @@ -18,7 +18,7 @@ Public Class frmConfig InitializeComponent() ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. - FormHelper = New FormHelper(pLogConfig) + FormHelper = New FormHelper(pLogConfig, Me) ConfigManager = pConfigManager End Sub diff --git a/MultiTool.Form/frmExportMain.Designer.vb b/MultiTool.Form/frmExportMain.Designer.vb index 651016a..e63d1df 100644 --- a/MultiTool.Form/frmExportMain.Designer.vb +++ b/MultiTool.Form/frmExportMain.Designer.vb @@ -22,79 +22,133 @@ Partial Class frmExportMain 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmExportMain)) Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() - Me.BarStaticItem1 = New DevExpress.XtraBars.BarStaticItem() - Me.BarStaticItem2 = New DevExpress.XtraBars.BarStaticItem() Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() + Me.txtResults = New DevExpress.XtraBars.BarStaticItem() + Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.GridControlDocuments = New DevExpress.XtraGrid.GridControl() Me.GridViewDocuments = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.colSelected = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colImported = New DevExpress.XtraGrid.Columns.GridColumn() + Me.RepositoryItemImageComboBox1 = New DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox() + Me.BooleanImages = New DevExpress.Utils.SvgImageCollection(Me.components) Me.colNumber = New DevExpress.XtraGrid.Columns.GridColumn() Me.colAccount = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn7 = New DevExpress.XtraGrid.Columns.GridColumn() Me.colDate = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn5 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn6 = New DevExpress.XtraGrid.Columns.GridColumn() Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl() - Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl() - Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl() + Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl() Me.lookupMandator = New DevExpress.XtraEditors.GridLookUpEdit() Me.GridLookUpEdit1View = New DevExpress.XtraGrid.Views.Grid.GridView() - Me.colId = New DevExpress.XtraGrid.Columns.GridColumn() Me.colName = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colId = New DevExpress.XtraGrid.Columns.GridColumn() + Me.dateDocDate = New DevExpress.XtraEditors.DateEdit() + Me.lookupAccount = New DevExpress.XtraEditors.GridLookUpEdit() + Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.GridColumn1 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.lookupDocumentKind = New DevExpress.XtraEditors.GridLookUpEdit() + Me.GridView2 = New DevExpress.XtraGrid.Views.Grid.GridView() + Me.GridColumn3 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.GridColumn4 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.chkShowExported = New DevExpress.XtraEditors.CheckEdit() + Me.TextEdit1 = New DevExpress.XtraEditors.TextEdit() + Me.TextEdit2 = New DevExpress.XtraEditors.TextEdit() + Me.Root = New DevExpress.XtraLayout.LayoutControlGroup() + Me.LayoutControlItem1 = New DevExpress.XtraLayout.LayoutControlItem() + Me.EmptySpaceItem1 = New DevExpress.XtraLayout.EmptySpaceItem() + Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem4 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem5 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem6 = New DevExpress.XtraLayout.LayoutControlItem() + Me.LayoutControlItem7 = New DevExpress.XtraLayout.LayoutControlItem() Me.LabelControl2 = New DevExpress.XtraEditors.LabelControl() - Me.colSelected = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colName2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.colId2 = New DevExpress.XtraGrid.Columns.GridColumn() + Me.SplashScreenManager = New DevExpress.XtraSplashScreen.SplashScreenManager(Me, GetType(Global.MultiTool.Form.frmWaitForm), True, True) + Me.RibbonPage3 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.btnOpenInputDirectory = New DevExpress.XtraBars.BarButtonItem() + Me.btnOpenOutputDirectory = New DevExpress.XtraBars.BarButtonItem() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridControlDocuments, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridViewDocuments, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.RepositoryItemImageComboBox1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.BooleanImages, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.Panel1.SuspendLayout() CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.Panel2.SuspendLayout() Me.SplitContainerControl1.SuspendLayout() - CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit() - Me.PanelControl1.SuspendLayout() + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.LayoutControl1.SuspendLayout() CType(Me.lookupMandator.Properties, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.GridLookUpEdit1View, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dateDocDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.dateDocDate.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.lookupAccount.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.lookupDocumentKind.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.GridView2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.chkShowExported.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TextEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TextEdit2.Properties, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.Root, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarStaticItem1, Me.BarStaticItem2, Me.BarButtonItem1}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem1, Me.txtResults, Me.BarButtonItem2, Me.btnOpenInputDirectory, Me.btnOpenOutputDirectory}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 4 + Me.RibbonControl1.MaxItemId = 8 Me.RibbonControl1.Name = "RibbonControl1" - Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) + Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1, Me.RibbonPage3}) Me.RibbonControl1.Size = New System.Drawing.Size(1107, 158) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 ' - 'BarStaticItem1 - ' - Me.BarStaticItem1.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right - Me.BarStaticItem1.Caption = "BarStaticItem1" - Me.BarStaticItem1.Id = 1 - Me.BarStaticItem1.Name = "BarStaticItem1" - ' - 'BarStaticItem2 - ' - Me.BarStaticItem2.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right - Me.BarStaticItem2.Caption = "BarStaticItem2" - Me.BarStaticItem2.Id = 2 - Me.BarStaticItem2.Name = "BarStaticItem2" - ' 'BarButtonItem1 ' - Me.BarButtonItem1.Caption = "Daten einlesen" + Me.BarButtonItem1.Caption = "Daten laden" Me.BarButtonItem1.Id = 3 Me.BarButtonItem1.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.icon_export Me.BarButtonItem1.Name = "BarButtonItem1" ' + 'txtResults + ' + Me.txtResults.Caption = "Keine Ergebnisse" + Me.txtResults.Id = 4 + Me.txtResults.Name = "txtResults" + ' + 'BarButtonItem2 + ' + Me.BarButtonItem2.Caption = "Ausgewählte Zeilen Exportieren" + Me.BarButtonItem2.Id = 5 + Me.BarButtonItem2.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.actions_send5 + Me.BarButtonItem2.Name = "BarButtonItem2" + ' 'RibbonPage1 ' - Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1}) + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2}) Me.RibbonPage1.Name = "RibbonPage1" Me.RibbonPage1.Text = "RibbonPage1" ' @@ -104,10 +158,16 @@ Partial Class frmExportMain Me.RibbonPageGroup1.Name = "RibbonPageGroup1" Me.RibbonPageGroup1.Text = "Start" ' + 'RibbonPageGroup2 + ' + Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far + Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem2) + Me.RibbonPageGroup2.Name = "RibbonPageGroup2" + Me.RibbonPageGroup2.Text = "Export" + ' 'RibbonStatusBar1 ' - Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItem1) - Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItem2) + Me.RibbonStatusBar1.ItemLinks.Add(Me.txtResults) Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 696) Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 @@ -121,37 +181,93 @@ Partial Class frmExportMain 'GridControlDocuments ' Me.GridControlDocuments.Dock = System.Windows.Forms.DockStyle.Fill - Me.GridControlDocuments.Location = New System.Drawing.Point(0, 33) + Me.GridControlDocuments.Location = New System.Drawing.Point(0, 0) Me.GridControlDocuments.MainView = Me.GridViewDocuments Me.GridControlDocuments.MenuManager = Me.RibbonControl1 Me.GridControlDocuments.Name = "GridControlDocuments" - Me.GridControlDocuments.Size = New System.Drawing.Size(385, 505) + Me.GridControlDocuments.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemImageComboBox1}) + Me.GridControlDocuments.Size = New System.Drawing.Size(799, 538) Me.GridControlDocuments.TabIndex = 2 Me.GridControlDocuments.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewDocuments}) ' 'GridViewDocuments ' - Me.GridViewDocuments.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSelected, Me.colNumber, Me.colAccount, Me.colDate}) + Me.GridViewDocuments.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSelected, Me.colImported, Me.colNumber, Me.colAccount, Me.GridColumn7, Me.colDate, Me.GridColumn5, Me.GridColumn6}) Me.GridViewDocuments.GridControl = Me.GridControlDocuments Me.GridViewDocuments.Name = "GridViewDocuments" ' + 'colSelected + ' + Me.colSelected.FieldName = "IsSelected" + Me.colSelected.ImageOptions.SvgImage = CType(resources.GetObject("colSelected.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) + Me.colSelected.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16) + Me.colSelected.MaxWidth = 27 + Me.colSelected.MinWidth = 27 + Me.colSelected.Name = "colSelected" + Me.colSelected.ToolTip = "Ausgewählt" + Me.colSelected.Visible = True + Me.colSelected.VisibleIndex = 0 + Me.colSelected.Width = 27 + ' + 'colImported + ' + Me.colImported.ColumnEdit = Me.RepositoryItemImageComboBox1 + Me.colImported.FieldName = "IsExported" + Me.colImported.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.actions_send4 + Me.colImported.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16) + Me.colImported.MaxWidth = 27 + Me.colImported.MinWidth = 27 + Me.colImported.Name = "colImported" + Me.colImported.OptionsColumn.AllowMove = False + Me.colImported.OptionsColumn.ReadOnly = True + Me.colImported.OptionsFilter.AllowAutoFilter = False + Me.colImported.OptionsFilter.AllowFilter = False + Me.colImported.ToolTip = "Bereits Exportiert" + Me.colImported.UnboundDataType = GetType(Boolean) + Me.colImported.Visible = True + Me.colImported.VisibleIndex = 1 + Me.colImported.Width = 27 + ' + 'RepositoryItemImageComboBox1 + ' + Me.RepositoryItemImageComboBox1.AutoHeight = False + Me.RepositoryItemImageComboBox1.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.RepositoryItemImageComboBox1.Items.AddRange(New DevExpress.XtraEditors.Controls.ImageComboBoxItem() {New DevExpress.XtraEditors.Controls.ImageComboBoxItem("True", True, 0), New DevExpress.XtraEditors.Controls.ImageComboBoxItem("False", False, 1)}) + Me.RepositoryItemImageComboBox1.LargeImages = Me.BooleanImages + Me.RepositoryItemImageComboBox1.Name = "RepositoryItemImageComboBox1" + Me.RepositoryItemImageComboBox1.SmallImages = Me.BooleanImages + ' + 'BooleanImages + ' + Me.BooleanImages.Add("true", "image://svgimages/business objects/bo_validation.svg") + Me.BooleanImages.Add("false", "image://svgimages/icon builder/actions_delete.svg") + ' 'colNumber ' Me.colNumber.Caption = "Belegnummer" Me.colNumber.FieldName = "Number" Me.colNumber.Name = "colNumber" Me.colNumber.Visible = True - Me.colNumber.VisibleIndex = 1 - Me.colNumber.Width = 110 + Me.colNumber.VisibleIndex = 2 + Me.colNumber.Width = 138 ' 'colAccount ' Me.colAccount.Caption = "Konto" - Me.colAccount.FieldName = "Account" + Me.colAccount.FieldName = "AccountName" Me.colAccount.Name = "colAccount" Me.colAccount.Visible = True - Me.colAccount.VisibleIndex = 2 - Me.colAccount.Width = 110 + Me.colAccount.VisibleIndex = 3 + Me.colAccount.Width = 138 + ' + 'GridColumn7 + ' + Me.GridColumn7.Caption = "Laufnummer" + Me.GridColumn7.FieldName = "RunningNumber" + Me.GridColumn7.Name = "GridColumn7" + Me.GridColumn7.Visible = True + Me.GridColumn7.VisibleIndex = 4 + Me.GridColumn7.Width = 94 ' 'colDate ' @@ -159,8 +275,26 @@ Partial Class frmExportMain Me.colDate.FieldName = "Date" Me.colDate.Name = "colDate" Me.colDate.Visible = True - Me.colDate.VisibleIndex = 3 - Me.colDate.Width = 110 + Me.colDate.VisibleIndex = 5 + Me.colDate.Width = 138 + ' + 'GridColumn5 + ' + Me.GridColumn5.Caption = "Netto" + Me.GridColumn5.FieldName = "NetAmount" + Me.GridColumn5.Name = "GridColumn5" + Me.GridColumn5.Visible = True + Me.GridColumn5.VisibleIndex = 6 + Me.GridColumn5.Width = 94 + ' + 'GridColumn6 + ' + Me.GridColumn6.Caption = "Brutto" + Me.GridColumn6.FieldName = "GrossAmount" + Me.GridColumn6.Name = "GridColumn6" + Me.GridColumn6.Visible = True + Me.GridColumn6.VisibleIndex = 7 + Me.GridColumn6.Width = 118 ' 'SplitContainerControl1 ' @@ -170,72 +304,276 @@ Partial Class frmExportMain ' 'SplitContainerControl1.Panel1 ' - Me.SplitContainerControl1.Panel1.Controls.Add(Me.GridControlDocuments) - Me.SplitContainerControl1.Panel1.Controls.Add(Me.PanelControl1) + Me.SplitContainerControl1.Panel1.Controls.Add(Me.LayoutControl1) Me.SplitContainerControl1.Panel1.Text = "Panel1" ' 'SplitContainerControl1.Panel2 ' + Me.SplitContainerControl1.Panel2.Controls.Add(Me.GridControlDocuments) Me.SplitContainerControl1.Panel2.Controls.Add(Me.LabelControl2) Me.SplitContainerControl1.Panel2.Text = "Panel2" Me.SplitContainerControl1.Size = New System.Drawing.Size(1107, 538) - Me.SplitContainerControl1.SplitterPosition = 385 + Me.SplitContainerControl1.SplitterPosition = 298 Me.SplitContainerControl1.TabIndex = 5 ' - 'PanelControl1 - ' - Me.PanelControl1.Controls.Add(Me.LabelControl1) - Me.PanelControl1.Controls.Add(Me.lookupMandator) - Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Top - Me.PanelControl1.Location = New System.Drawing.Point(0, 0) - Me.PanelControl1.Name = "PanelControl1" - Me.PanelControl1.Size = New System.Drawing.Size(385, 33) - Me.PanelControl1.TabIndex = 0 - ' - 'LabelControl1 - ' - Me.LabelControl1.Appearance.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold) - Me.LabelControl1.Appearance.Options.UseFont = True - Me.LabelControl1.Location = New System.Drawing.Point(5, 9) - Me.LabelControl1.Name = "LabelControl1" - Me.LabelControl1.Size = New System.Drawing.Size(50, 13) - Me.LabelControl1.TabIndex = 4 - Me.LabelControl1.Text = "Mandant" + 'LayoutControl1 + ' + Me.LayoutControl1.Controls.Add(Me.lookupMandator) + Me.LayoutControl1.Controls.Add(Me.dateDocDate) + Me.LayoutControl1.Controls.Add(Me.lookupAccount) + Me.LayoutControl1.Controls.Add(Me.lookupDocumentKind) + Me.LayoutControl1.Controls.Add(Me.chkShowExported) + Me.LayoutControl1.Controls.Add(Me.TextEdit1) + Me.LayoutControl1.Controls.Add(Me.TextEdit2) + Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill + Me.LayoutControl1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControl1.Name = "LayoutControl1" + Me.LayoutControl1.Root = Me.Root + Me.LayoutControl1.Size = New System.Drawing.Size(298, 538) + Me.LayoutControl1.TabIndex = 1 + Me.LayoutControl1.Text = "LayoutControl1" ' 'lookupMandator ' - Me.lookupMandator.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ - Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.lookupMandator.Location = New System.Drawing.Point(75, 6) + Me.lookupMandator.Location = New System.Drawing.Point(85, 15) + Me.lookupMandator.MenuManager = Me.RibbonControl1 Me.lookupMandator.Name = "lookupMandator" Me.lookupMandator.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.lookupMandator.Properties.NullText = "" + Me.lookupMandator.Properties.PopupSizeable = False Me.lookupMandator.Properties.PopupView = Me.GridLookUpEdit1View - Me.lookupMandator.Size = New System.Drawing.Size(305, 20) - Me.lookupMandator.TabIndex = 3 + Me.lookupMandator.Size = New System.Drawing.Size(198, 20) + Me.lookupMandator.StyleController = Me.LayoutControl1 + Me.lookupMandator.TabIndex = 4 ' 'GridLookUpEdit1View ' - Me.GridLookUpEdit1View.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colId, Me.colName}) + Me.GridLookUpEdit1View.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colName, Me.colId}) Me.GridLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus Me.GridLookUpEdit1View.Name = "GridLookUpEdit1View" Me.GridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = False Me.GridLookUpEdit1View.OptionsView.ShowGroupPanel = False ' - 'colId - ' - Me.colId.Caption = "Id" - Me.colId.FieldName = "Id" - Me.colId.Name = "colId" - Me.colId.Visible = True - Me.colId.VisibleIndex = 0 - ' 'colName ' Me.colName.Caption = "Name" Me.colName.FieldName = "Name" Me.colName.Name = "colName" Me.colName.Visible = True - Me.colName.VisibleIndex = 1 + Me.colName.VisibleIndex = 0 + ' + 'colId + ' + Me.colId.Caption = "Kurzname" + Me.colId.FieldName = "Id" + Me.colId.Name = "colId" + Me.colId.Visible = True + Me.colId.VisibleIndex = 1 + ' + 'dateDocDate + ' + Me.dateDocDate.EditValue = Nothing + Me.dateDocDate.Location = New System.Drawing.Point(85, 165) + Me.dateDocDate.MenuManager = Me.RibbonControl1 + Me.dateDocDate.Name = "dateDocDate" + Me.dateDocDate.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.dateDocDate.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}) + Me.dateDocDate.Properties.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower + Me.dateDocDate.Properties.SelectionMode = DevExpress.XtraEditors.Repository.CalendarSelectionMode.Multiple + Me.dateDocDate.Size = New System.Drawing.Size(198, 20) + Me.dateDocDate.StyleController = Me.LayoutControl1 + Me.dateDocDate.TabIndex = 5 + ' + 'lookupAccount + ' + Me.lookupAccount.Location = New System.Drawing.Point(85, 75) + Me.lookupAccount.MenuManager = Me.RibbonControl1 + Me.lookupAccount.Name = "lookupAccount" + Me.lookupAccount.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)}) + Me.lookupAccount.Properties.NullText = "" + Me.lookupAccount.Properties.PopupSizeable = False + Me.lookupAccount.Properties.PopupView = Me.GridView1 + Me.lookupAccount.Size = New System.Drawing.Size(198, 20) + Me.lookupAccount.StyleController = Me.LayoutControl1 + Me.lookupAccount.TabIndex = 7 + ' + 'GridView1 + ' + Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn1, Me.GridColumn2}) + Me.GridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus + Me.GridView1.Name = "GridView1" + Me.GridView1.OptionsSelection.EnableAppearanceFocusedCell = False + Me.GridView1.OptionsView.ShowGroupPanel = False + ' + 'GridColumn1 + ' + Me.GridColumn1.Caption = "Name" + Me.GridColumn1.FieldName = "Name" + Me.GridColumn1.Name = "GridColumn1" + Me.GridColumn1.Visible = True + Me.GridColumn1.VisibleIndex = 0 + ' + 'GridColumn2 + ' + Me.GridColumn2.Caption = "Nummer" + Me.GridColumn2.FieldName = "Id" + Me.GridColumn2.Name = "GridColumn2" + Me.GridColumn2.Visible = True + Me.GridColumn2.VisibleIndex = 1 + ' + 'lookupDocumentKind + ' + Me.lookupDocumentKind.Location = New System.Drawing.Point(85, 45) + Me.lookupDocumentKind.MenuManager = Me.RibbonControl1 + Me.lookupDocumentKind.Name = "lookupDocumentKind" + Me.lookupDocumentKind.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo), New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Clear)}) + Me.lookupDocumentKind.Properties.NullText = "" + Me.lookupDocumentKind.Properties.PopupSizeable = False + Me.lookupDocumentKind.Properties.PopupView = Me.GridView2 + Me.lookupDocumentKind.Size = New System.Drawing.Size(198, 20) + Me.lookupDocumentKind.StyleController = Me.LayoutControl1 + Me.lookupDocumentKind.TabIndex = 8 + ' + 'GridView2 + ' + Me.GridView2.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn3, Me.GridColumn4}) + Me.GridView2.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus + Me.GridView2.Name = "GridView2" + Me.GridView2.OptionsSelection.EnableAppearanceFocusedCell = False + Me.GridView2.OptionsView.ShowGroupPanel = False + ' + 'GridColumn3 + ' + Me.GridColumn3.Caption = "Name" + Me.GridColumn3.FieldName = "Name" + Me.GridColumn3.Name = "GridColumn3" + Me.GridColumn3.Visible = True + Me.GridColumn3.VisibleIndex = 0 + ' + 'GridColumn4 + ' + Me.GridColumn4.Caption = "Nummer" + Me.GridColumn4.FieldName = "Id" + Me.GridColumn4.Name = "GridColumn4" + Me.GridColumn4.Visible = True + Me.GridColumn4.VisibleIndex = 1 + ' + 'chkShowExported + ' + Me.chkShowExported.Location = New System.Drawing.Point(12, 192) + Me.chkShowExported.MenuManager = Me.RibbonControl1 + Me.chkShowExported.Name = "chkShowExported" + Me.chkShowExported.Properties.Caption = "Bereits exportierte Belege anzeigen" + Me.chkShowExported.Size = New System.Drawing.Size(274, 20) + Me.chkShowExported.StyleController = Me.LayoutControl1 + Me.chkShowExported.TabIndex = 9 + ' + 'TextEdit1 + ' + Me.TextEdit1.Location = New System.Drawing.Point(85, 105) + Me.TextEdit1.MenuManager = Me.RibbonControl1 + Me.TextEdit1.Name = "TextEdit1" + Me.TextEdit1.Size = New System.Drawing.Size(198, 20) + Me.TextEdit1.StyleController = Me.LayoutControl1 + Me.TextEdit1.TabIndex = 10 + ' + 'TextEdit2 + ' + Me.TextEdit2.Location = New System.Drawing.Point(85, 135) + Me.TextEdit2.MenuManager = Me.RibbonControl1 + Me.TextEdit2.Name = "TextEdit2" + Me.TextEdit2.Size = New System.Drawing.Size(198, 20) + Me.TextEdit2.StyleController = Me.LayoutControl1 + Me.TextEdit2.TabIndex = 11 + ' + 'Root + ' + Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True] + Me.Root.GroupBordersVisible = False + Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem1, Me.EmptySpaceItem1, Me.LayoutControlItem3, Me.LayoutControlItem2, Me.LayoutControlItem4, Me.LayoutControlItem5, Me.LayoutControlItem6, Me.LayoutControlItem7}) + Me.Root.Name = "Root" + Me.Root.Size = New System.Drawing.Size(298, 538) + Me.Root.TextVisible = False + ' + 'LayoutControlItem1 + ' + Me.LayoutControlItem1.Control = Me.lookupMandator + Me.LayoutControlItem1.Location = New System.Drawing.Point(0, 0) + Me.LayoutControlItem1.Name = "LayoutControlItem1" + Me.LayoutControlItem1.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem1.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem1.Text = "Mandant" + Me.LayoutControlItem1.TextSize = New System.Drawing.Size(58, 13) + ' + 'EmptySpaceItem1 + ' + Me.EmptySpaceItem1.AllowHotTrack = False + Me.EmptySpaceItem1.Location = New System.Drawing.Point(0, 204) + Me.EmptySpaceItem1.Name = "EmptySpaceItem1" + Me.EmptySpaceItem1.Size = New System.Drawing.Size(278, 314) + Me.EmptySpaceItem1.TextSize = New System.Drawing.Size(0, 0) + ' + 'LayoutControlItem3 + ' + Me.LayoutControlItem3.Control = Me.lookupAccount + Me.LayoutControlItem3.Location = New System.Drawing.Point(0, 60) + Me.LayoutControlItem3.Name = "LayoutControlItem3" + Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem3.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem3.Text = "Konto" + Me.LayoutControlItem3.TextSize = New System.Drawing.Size(58, 13) + ' + 'LayoutControlItem2 + ' + Me.LayoutControlItem2.Control = Me.dateDocDate + Me.LayoutControlItem2.Enabled = False + Me.LayoutControlItem2.Location = New System.Drawing.Point(0, 150) + Me.LayoutControlItem2.Name = "LayoutControlItem2" + Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem2.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem2.Text = "Belegdatum" + Me.LayoutControlItem2.TextSize = New System.Drawing.Size(58, 13) + ' + 'LayoutControlItem4 + ' + Me.LayoutControlItem4.Control = Me.lookupDocumentKind + Me.LayoutControlItem4.Location = New System.Drawing.Point(0, 30) + Me.LayoutControlItem4.Name = "LayoutControlItem4" + Me.LayoutControlItem4.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem4.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem4.Text = "Belegart" + Me.LayoutControlItem4.TextSize = New System.Drawing.Size(58, 13) + ' + 'LayoutControlItem5 + ' + Me.LayoutControlItem5.Control = Me.chkShowExported + Me.LayoutControlItem5.Location = New System.Drawing.Point(0, 180) + Me.LayoutControlItem5.Name = "LayoutControlItem5" + Me.LayoutControlItem5.Size = New System.Drawing.Size(278, 24) + Me.LayoutControlItem5.TextSize = New System.Drawing.Size(0, 0) + Me.LayoutControlItem5.TextVisible = False + ' + 'LayoutControlItem6 + ' + Me.LayoutControlItem6.Control = Me.TextEdit1 + Me.LayoutControlItem6.Enabled = False + Me.LayoutControlItem6.Location = New System.Drawing.Point(0, 90) + Me.LayoutControlItem6.Name = "LayoutControlItem6" + Me.LayoutControlItem6.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem6.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem6.Text = "BelegNr Von" + Me.LayoutControlItem6.TextSize = New System.Drawing.Size(58, 13) + ' + 'LayoutControlItem7 + ' + Me.LayoutControlItem7.Control = Me.TextEdit2 + Me.LayoutControlItem7.Enabled = False + Me.LayoutControlItem7.Location = New System.Drawing.Point(0, 120) + Me.LayoutControlItem7.Name = "LayoutControlItem7" + Me.LayoutControlItem7.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5) + Me.LayoutControlItem7.Size = New System.Drawing.Size(278, 30) + Me.LayoutControlItem7.Text = "BelegNr Bis" + Me.LayoutControlItem7.TextSize = New System.Drawing.Size(58, 13) ' 'LabelControl2 ' @@ -249,16 +587,50 @@ Partial Class frmExportMain Me.LabelControl2.TabIndex = 0 Me.LabelControl2.Text = "Nothing to see.." ' - 'colSelected + 'colName2 ' - Me.colSelected.FieldName = "colSelected" - Me.colSelected.ImageOptions.SvgImage = CType(resources.GetObject("colSelected.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) - Me.colSelected.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16) - Me.colSelected.Name = "colSelected" - Me.colSelected.UnboundDataType = GetType(Boolean) - Me.colSelected.Visible = True - Me.colSelected.VisibleIndex = 0 - Me.colSelected.Width = 112 + Me.colName2.Caption = "Name" + Me.colName2.FieldName = "Name" + Me.colName2.Name = "colName2" + Me.colName2.Visible = True + Me.colName2.VisibleIndex = 0 + ' + 'colId2 + ' + Me.colId2.Caption = "Kurzname" + Me.colId2.FieldName = "Id" + Me.colId2.Name = "colId2" + Me.colId2.Visible = True + Me.colId2.VisibleIndex = 1 + ' + 'SplashScreenManager + ' + Me.SplashScreenManager.ClosingDelay = 500 + ' + 'RibbonPage3 + ' + Me.RibbonPage3.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3}) + Me.RibbonPage3.Name = "RibbonPage3" + Me.RibbonPage3.Text = "RibbonPage3" + ' + 'RibbonPageGroup3 + ' + Me.RibbonPageGroup3.ItemLinks.Add(Me.btnOpenInputDirectory) + Me.RibbonPageGroup3.ItemLinks.Add(Me.btnOpenOutputDirectory) + Me.RibbonPageGroup3.Name = "RibbonPageGroup3" + Me.RibbonPageGroup3.Text = "RibbonPageGroup3" + ' + 'btnOpenInputDirectory + ' + Me.btnOpenInputDirectory.Caption = "BarButtonItem3" + Me.btnOpenInputDirectory.Id = 6 + Me.btnOpenInputDirectory.Name = "btnOpenInputDirectory" + ' + 'btnOpenOutputDirectory + ' + Me.btnOpenOutputDirectory.Caption = "BarButtonItem4" + Me.btnOpenOutputDirectory.Id = 7 + Me.btnOpenOutputDirectory.Name = "btnOpenOutputDirectory" ' 'frmExportMain ' @@ -268,6 +640,7 @@ Partial Class frmExportMain Me.Controls.Add(Me.SplitContainerControl1) Me.Controls.Add(Me.RibbonStatusBar1) Me.Controls.Add(Me.RibbonControl1) + Me.KeyPreview = True Me.Name = "frmExportMain" Me.Ribbon = Me.RibbonControl1 Me.StatusBar = Me.RibbonStatusBar1 @@ -275,6 +648,8 @@ Partial Class frmExportMain CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridControlDocuments, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridViewDocuments, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.RepositoryItemImageComboBox1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.BooleanImages, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.Panel1.ResumeLayout(False) CType(Me.SplitContainerControl1.Panel2, System.ComponentModel.ISupportInitialize).EndInit() @@ -282,11 +657,28 @@ Partial Class frmExportMain Me.SplitContainerControl1.Panel2.PerformLayout() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainerControl1.ResumeLayout(False) - CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit() - Me.PanelControl1.ResumeLayout(False) - Me.PanelControl1.PerformLayout() + CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit() + Me.LayoutControl1.ResumeLayout(False) CType(Me.lookupMandator.Properties, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.GridLookUpEdit1View, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dateDocDate.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.dateDocDate.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.lookupAccount.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.lookupDocumentKind.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.GridView2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.chkShowExported.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TextEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TextEdit2.Properties, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.Root, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem4, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem5, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem6, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.LayoutControlItem7, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -297,21 +689,55 @@ Partial Class frmExportMain Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage - Friend WithEvents BarStaticItem1 As DevExpress.XtraBars.BarStaticItem - Friend WithEvents BarStaticItem2 As DevExpress.XtraBars.BarStaticItem Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem Friend WithEvents GridControlDocuments As DevExpress.XtraGrid.GridControl Friend WithEvents GridViewDocuments As DevExpress.XtraGrid.Views.Grid.GridView Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl - Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl - Friend WithEvents LabelControl1 As DevExpress.XtraEditors.LabelControl - Friend WithEvents lookupMandator As DevExpress.XtraEditors.GridLookUpEdit - Friend WithEvents GridLookUpEdit1View As DevExpress.XtraGrid.Views.Grid.GridView - Friend WithEvents colId As DevExpress.XtraGrid.Columns.GridColumn - Friend WithEvents colName As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents LabelControl2 As DevExpress.XtraEditors.LabelControl Friend WithEvents colNumber As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colAccount As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colDate As DevExpress.XtraGrid.Columns.GridColumn Friend WithEvents colSelected As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl + Friend WithEvents Root As DevExpress.XtraLayout.LayoutControlGroup + Friend WithEvents LayoutControlItem1 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents lookupMandator As DevExpress.XtraEditors.GridLookUpEdit + Friend WithEvents GridLookUpEdit1View As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents colName As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colId As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents dateDocDate As DevExpress.XtraEditors.DateEdit + Friend WithEvents LayoutControlItem2 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents EmptySpaceItem1 As DevExpress.XtraLayout.EmptySpaceItem + Friend WithEvents lookupAccount As DevExpress.XtraEditors.GridLookUpEdit + Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents LayoutControlItem3 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents colName2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colId2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn1 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn2 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents LayoutControlItem4 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents lookupDocumentKind As DevExpress.XtraEditors.GridLookUpEdit + Friend WithEvents GridView2 As DevExpress.XtraGrid.Views.Grid.GridView + Friend WithEvents GridColumn3 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn4 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn5 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents GridColumn6 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents colImported As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents chkShowExported As DevExpress.XtraEditors.CheckEdit + Friend WithEvents LayoutControlItem5 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents TextEdit1 As DevExpress.XtraEditors.TextEdit + Friend WithEvents TextEdit2 As DevExpress.XtraEditors.TextEdit + Friend WithEvents LayoutControlItem6 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents LayoutControlItem7 As DevExpress.XtraLayout.LayoutControlItem + Friend WithEvents GridColumn7 As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents txtResults As DevExpress.XtraBars.BarStaticItem + Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + Friend WithEvents SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager + Friend WithEvents RepositoryItemImageComboBox1 As DevExpress.XtraEditors.Repository.RepositoryItemImageComboBox + Friend WithEvents BooleanImages As DevExpress.Utils.SvgImageCollection + Friend WithEvents btnOpenInputDirectory As DevExpress.XtraBars.BarButtonItem + Friend WithEvents btnOpenOutputDirectory As DevExpress.XtraBars.BarButtonItem + Friend WithEvents RibbonPage3 As DevExpress.XtraBars.Ribbon.RibbonPage + Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup End Class diff --git a/MultiTool.Form/frmExportMain.resx b/MultiTool.Form/frmExportMain.resx index 9c6d1fe..ed25826 100644 --- a/MultiTool.Form/frmExportMain.resx +++ b/MultiTool.Form/frmExportMain.resx @@ -135,4 +135,10 @@ IDExLDIwIDUsMTQgMiwxNyAxMSwyNiAzMCw3ICIgY2xhc3M9IkdyZWVuIiAvPg0KPC9zdmc+Cw== + + 189, 17 + + + 189, 17 + \ No newline at end of file diff --git a/MultiTool.Form/frmExportMain.vb b/MultiTool.Form/frmExportMain.vb index 726bd15..99fa3ce 100644 --- a/MultiTool.Form/frmExportMain.vb +++ b/MultiTool.Form/frmExportMain.vb @@ -1,10 +1,13 @@ -Imports DigitalData.GUIs.Common +Imports DevExpress.XtraEditors +Imports DevExpress.XtraGrid.Views.Grid +Imports DigitalData.GUIs.Common Imports DigitalData.Modules.Config Imports DigitalData.Modules.Database Imports DigitalData.Modules.Logging Imports MultiTool.Shared Imports MultiTool.Shared.Templates Imports MultiTool.Shared.Winline +Imports MultiTool.Shared.Winline.Entities Public Class frmExportMain Private ReadOnly LogConfig As LogConfig @@ -34,13 +37,19 @@ Public Class frmExportMain Text = String.Format(My.Resources.frmShared._0____WebService_Multitool_für_WinLine, CurrentTemplate.Name) Logger = LogConfig.GetLogger() - FormHelper = New FormHelper(LogConfig) + FormHelper = New FormHelper(LogConfig, Me) ' Initialize Database Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString) - GridBuilder = New GridBuilder(GridViewDocuments) + Dim oViews As New List(Of GridView) From { + GridViewDocuments, + lookupMandator.Properties.View, + lookupAccount.Properties.View, + lookupDocumentKind.Properties.View + } + GridBuilder = New GridBuilder(oViews) GridBuilder. WithDefaults(). WithReadOnlyOptions(). @@ -48,7 +57,7 @@ Public Class frmExportMain Winline = My.Winline FileEx = New DigitalData.Modules.Filesystem.File(LogConfig) - WebService = New WebServiceData(LogConfig, My.GeneralConfiguration.Webservice, My.GeneralConfiguration.OutputWebserviceDirectory) + WebService = New WebServiceData(LogConfig, My.GeneralConfiguration.Webservice, My.GeneralConfiguration) AddHandler WebService.WebServiceProgress, AddressOf WebService_Progress Catch ex As Exception @@ -62,35 +71,110 @@ Public Class frmExportMain lookupMandator.Properties.DataSource = Winline.Mandators lookupMandator.ForceInitialize() lookupMandator.Properties.View.BestFitColumns() + + lookupAccount.Properties.DataSource = Winline.Accounts + lookupAccount.ForceInitialize() + lookupAccount.Properties.View.BestFitColumns() + + lookupDocumentKind.Properties.DataSource = Winline.DocumentKinds + lookupDocumentKind.ForceInitialize() + lookupDocumentKind.Properties.View.BestFitColumns() Catch ex As Exception FormHelper.ShowError(ex, "Initialisierung der Form") End Try End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick + SearchDocuments() + End Sub + + Private Sub WebService_Progress(sender As Object, e As String) + SplashScreenManager.SetWaitFormDescription(e) + End Sub + + Private Sub lookupMandator_EditValueChanged(sender As Object, e As EventArgs) Handles lookupMandator.EditValueChanged + Dim oMandator As Mandator = lookupMandator.EditValue + lookupAccount.Properties.DataSource = Winline.Accounts.Where(Function(acc) acc.Mandator.Equals(oMandator)) + lookupDocumentKind.Properties.DataSource = Winline.DocumentKinds.Where(Function(kind) kind.Mandator.Equals(oMandator)) + End Sub + + Private Sub lookup_Properties_ButtonClick(sender As Object, e As DevExpress.XtraEditors.Controls.ButtonPressedEventArgs) _ + Handles lookupDocumentKind.Properties.ButtonClick, lookupAccount.Properties.ButtonClick + Dim oLookup As GridLookUpEdit = sender + If e.Button.Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Clear Then + oLookup.EditValue = Nothing + End If + End Sub + + + + Private Sub SearchDocuments() Try Dim oMandator = lookupMandator.EditValue + Dim oAccount = lookupAccount.EditValue + Dim oKind = lookupDocumentKind.EditValue + Dim oDateRanges = dateDocDate.SelectedRanges + Dim oShowExported = chkShowExported.Checked If oMandator Is Nothing Then FormHelper.ShowWarning("Bitte einen Mandanten auswählen!") Exit Sub End If - 'TODO: Make Document Type configurable + If oDateRanges.Count > 1 Then + FormHelper.ShowWarning("Bitte nur einen Datumsbereich auswählen!") + Exit Sub + End If - Dim oDocuments = Winline.GetDocuments(oMandator, WinlineData.DocumentType.Order) + Dim oStartDate As Date = Nothing + Dim oEndDate As Date = Nothing + If oDateRanges.Count > 0 Then + Dim oRange = oDateRanges.First() + oStartDate = oRange.StartDate + oEndDate = oRange.EndDate + End If + + 'TODO: Make Document Type configurable + Dim oDocuments = Winline.GetDocuments(oMandator, CurrentTemplate, WinlineData.DocumentType.Order, New WinlineData.GetDocumentArgs With { + .Account = oAccount, + .Kind = oKind, + .DateFrom = oStartDate, + .DateTo = oEndDate, + .ShowExported = oShowExported + }) GridControlDocuments.DataSource = oDocuments - Console.WriteLine() + txtResults.Caption = String.Format("{0} Ergebnisse", oDocuments.Count) + Catch ex As Exception FormHelper.ShowError(ex, "Laden der Daten") End Try End Sub - Private Sub WebService_Progress(sender As Object, e As String) - Throw New NotImplementedException() + Private Async Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick + Try + SplashScreenManager.ShowWaitForm() + + Dim oDocument As Document = GridViewDocuments.GetRow(GridViewDocuments.FocusedRowHandle) + Dim oMandator As Mandator = lookupMandator.EditValue + + Await WebService.ExportDocumentFromWinline(oDocument, CurrentTemplate, oMandator) + + Catch ex As Exception + FormHelper.ShowError(ex, "Exportieren der Daten") + + Finally + SplashScreenManager.CloseWaitForm() + + End Try End Sub + Private Sub btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick + FormHelper.TryOpenDirectory(CurrentTemplate.InputDirectory, My.Resources.frmImportMainExtra.Eingangsverzeichnis) + End Sub + Private Sub btnOpenOutputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenOutputDirectory.ItemClick + FormHelper.TryOpenDirectory(CurrentTemplate.OutputDirectory, My.Resources.frmImportMainExtra.Ausgabeverzeichnis) + End Sub End Class \ No newline at end of file diff --git a/MultiTool.Form/frmImportMain.vb b/MultiTool.Form/frmImportMain.vb index fb79b7d..a3a4214 100644 --- a/MultiTool.Form/frmImportMain.vb +++ b/MultiTool.Form/frmImportMain.vb @@ -65,7 +65,7 @@ Public Class frmImportMain Private Sub frmImportMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try Logger = LogConfig.GetLogger() - FormHelper = New FormHelper(LogConfig) + FormHelper = New FormHelper(LogConfig, Me) ' Initialize Database Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) @@ -77,7 +77,7 @@ Public Class frmImportMain Winline = My.Winline FileEx = New DigitalData.Modules.Filesystem.File(LogConfig) - WebService = New WebServiceData(LogConfig, My.GeneralConfiguration.Webservice, My.GeneralConfiguration.OutputWebserviceDirectory) + WebService = New WebServiceData(LogConfig, My.GeneralConfiguration.Webservice, My.GeneralConfiguration) AddHandler WebService.WebServiceProgress, AddressOf WebService_Progress Catch ex As Exception @@ -100,7 +100,7 @@ Public Class frmImportMain lookupMandator.Properties.View.BestFitColumns() DocumentLoader = New Documents.DocumentLoader(LogConfig, Winline, My.MappingConfiguration, My.TemplateConfiguration) - DocumentCleaner = New Documents.DocumentCleaner(LogConfig, My.GeneralConfiguration) + DocumentCleaner = New Documents.DocumentCleaner(LogConfig, CurrentTemplate) GridLoader = New GridLoader(LogConfig) ReportGenerator = New ReportGenerator(Of OrderReport)(LogConfig, Database, My.TemplateConfiguration, My.GeneralConfiguration) @@ -235,11 +235,7 @@ Public Class frmImportMain SplashScreenManager.SetWaitFormDescription(oMessage) End Sub - If DocumentLoader.LoadFiles( - My.GeneralConfiguration.InputDirectory, - CurrentTemplate, - lookupMandator.EditValue - ) Then + If DocumentLoader.LoadFiles(CurrentTemplate, lookupMandator.EditValue) Then GridControlFiles.DataSource = Nothing GridControlFiles.DataSource = DocumentLoader.Files @@ -414,13 +410,13 @@ Public Class frmImportMain End If ' Transfer to winline - Await WebService.TransferDocumentToWinline(oDocument, lookupMandator.EditValue) + Await WebService.TransferDocumentToWinline(oDocument, CurrentTemplate, lookupMandator.EditValue) WebService.RaiseWebServiceProgress("Bericht erzeugen") ' Generate the report Dim oReport = ReportGenerator.GenerateReport(oDocument) - Dim oFilePath = ReportGenerator.GetReportFilePath(oDocument) + Dim oFilePath = ReportGenerator.GetReportFilePath(oDocument, CurrentTemplate) WebService.RaiseWebServiceProgress("Bericht exportieren") @@ -451,15 +447,15 @@ Public Class frmImportMain End Sub Private Sub btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick - TryOpenDirectory(My.GeneralConfiguration.InputDirectory, My.Resources.frmImportMainExtra.Eingangsverzeichnis) + FormHelper.TryOpenDirectory(CurrentTemplate.InputDirectory, My.Resources.frmImportMainExtra.Eingangsverzeichnis) End Sub Private Sub btnOpenOutputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenOutputDirectory.ItemClick - TryOpenDirectory(My.GeneralConfiguration.OutputDirectory, My.Resources.frmImportMainExtra.Ausgabeverzeichnis) + FormHelper.TryOpenDirectory(CurrentTemplate.OutputDirectory, My.Resources.frmImportMainExtra.Ausgabeverzeichnis) End Sub Private Sub btnOpenSchemaDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenSchemaDirectory.ItemClick - TryOpenDirectory(My.GeneralConfiguration.TemplateDirectory, My.Resources.frmImportMainExtra.Vorlagenverzeichnis) + FormHelper.TryOpenDirectory(My.GeneralConfiguration.TemplateDirectory, My.Resources.frmImportMainExtra.Vorlagenverzeichnis) End Sub Private Sub TryOpenDirectory(pPath As String, pDisplayName As String) @@ -603,7 +599,7 @@ Public Class frmImportMain SplitContainerGrids.Enabled = False Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle) - Await WebService.TransferDocumentToWinline(oDocument, lookupMandator.EditValue, pIsTest:=True) + Await WebService.TransferDocumentToWinline(oDocument, CurrentTemplate, lookupMandator.EditValue, pIsTest:=True) MsgBox(My.Resources.frmImportMainExtra.Datei_erfolgreich_in_die_WinLine_übertragen, MsgBoxStyle.Information, Text) Catch ex As HttpRequestException diff --git a/MultiTool.Form/frmMain.Designer.vb b/MultiTool.Form/frmMain.Designer.vb index 57bfac7..8db1448 100644 --- a/MultiTool.Form/frmMain.Designer.vb +++ b/MultiTool.Form/frmMain.Designer.vb @@ -29,6 +29,9 @@ Partial Class frmMain Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem() Me.txtVersion = New DevExpress.XtraBars.BarStaticItem() Me.txtCulture = New DevExpress.XtraBars.BarStaticItem() + Me.btnOpenInputDirectory = New DevExpress.XtraBars.BarButtonItem() + Me.btnOpenOutputDirectory = New DevExpress.XtraBars.BarButtonItem() + Me.btnOpenSchemaDirectory = New DevExpress.XtraBars.BarButtonItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup3 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -51,16 +54,15 @@ Partial Class frmMain ' 'RibbonControl1 ' - Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnOpenImportExportForm, Me.BarButtonItem1, Me.BarButtonItem4, Me.BarButtonItem2, Me.BarButtonItem3, Me.txtVersion, Me.txtCulture}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnOpenImportExportForm, Me.BarButtonItem1, Me.BarButtonItem4, Me.BarButtonItem2, Me.BarButtonItem3, Me.txtVersion, Me.txtCulture, Me.btnOpenInputDirectory, Me.btnOpenOutputDirectory, Me.btnOpenSchemaDirectory}) Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) - Me.RibbonControl1.MaxItemId = 10 + Me.RibbonControl1.MaxItemId = 13 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1, Me.RibbonPage3}) Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] Me.RibbonControl1.ShowToolbarCustomizeItem = False - Me.RibbonControl1.Size = New System.Drawing.Size(757, 89) + Me.RibbonControl1.Size = New System.Drawing.Size(757, 158) Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 Me.RibbonControl1.Toolbar.ShowCustomizeItem = False ' @@ -113,6 +115,28 @@ Partial Class frmMain Me.txtCulture.Id = 9 Me.txtCulture.ImageOptions.SvgImage = CType(resources.GetObject("txtCulture.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.txtCulture.Name = "txtCulture" + Me.txtCulture.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph + ' + 'btnOpenInputDirectory + ' + Me.btnOpenInputDirectory.Caption = "Eingangsverzeichnis öffnen" + Me.btnOpenInputDirectory.Id = 10 + Me.btnOpenInputDirectory.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.open24 + Me.btnOpenInputDirectory.Name = "btnOpenInputDirectory" + ' + 'btnOpenOutputDirectory + ' + Me.btnOpenOutputDirectory.Caption = "Ausgangsverzeichnis öffnen" + Me.btnOpenOutputDirectory.Id = 11 + Me.btnOpenOutputDirectory.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.open25 + Me.btnOpenOutputDirectory.Name = "btnOpenOutputDirectory" + ' + 'btnOpenSchemaDirectory + ' + Me.btnOpenSchemaDirectory.Caption = "Vorlagenverzeichnis öffnen" + Me.btnOpenSchemaDirectory.Id = 12 + Me.btnOpenSchemaDirectory.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.open26 + Me.btnOpenSchemaDirectory.Name = "btnOpenSchemaDirectory" ' 'RibbonPage1 ' @@ -141,11 +165,14 @@ Partial Class frmMain ' 'RibbonPageGroup2 ' - Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem4) Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem2) + Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenInputDirectory) + Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenOutputDirectory) + Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenSchemaDirectory) + Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem4) Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem3) Me.RibbonPageGroup2.Name = "RibbonPageGroup2" - Me.RibbonPageGroup2.Text = "RibbonPageGroup2" + Me.RibbonPageGroup2.Text = "Verzeichnisse" ' 'RibbonStatusBar1 ' @@ -169,11 +196,11 @@ Partial Class frmMain 'GridControl1 ' Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill - Me.GridControl1.Location = New System.Drawing.Point(0, 89) + Me.GridControl1.Location = New System.Drawing.Point(0, 158) Me.GridControl1.MainView = Me.GridViewTemplates Me.GridControl1.MenuManager = Me.RibbonControl1 Me.GridControl1.Name = "GridControl1" - Me.GridControl1.Size = New System.Drawing.Size(757, 424) + Me.GridControl1.Size = New System.Drawing.Size(757, 355) Me.GridControl1.TabIndex = 9 Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewTemplates}) ' @@ -207,7 +234,7 @@ Partial Class frmMain Me.colFileName.Visible = True Me.colFileName.VisibleIndex = 2 ' - 'SplashScreenManager1 + 'SplashScreenManager ' Me.SplashScreenManager.ClosingDelay = 500 ' @@ -254,4 +281,7 @@ Partial Class frmMain Friend WithEvents SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager Friend WithEvents txtVersion As DevExpress.XtraBars.BarStaticItem Friend WithEvents txtCulture As DevExpress.XtraBars.BarStaticItem + Friend WithEvents btnOpenInputDirectory As DevExpress.XtraBars.BarButtonItem + Friend WithEvents btnOpenOutputDirectory As DevExpress.XtraBars.BarButtonItem + Friend WithEvents btnOpenSchemaDirectory As DevExpress.XtraBars.BarButtonItem End Class diff --git a/MultiTool.Form/frmMain.resx b/MultiTool.Form/frmMain.resx index 08c0989..4b093de 100644 --- a/MultiTool.Form/frmMain.resx +++ b/MultiTool.Form/frmMain.resx @@ -173,6 +173,6 @@ - 196, 17 + 189, 17 \ No newline at end of file diff --git a/MultiTool.Form/frmMain.vb b/MultiTool.Form/frmMain.vb index 7a5f2a9..e89a30b 100644 --- a/MultiTool.Form/frmMain.vb +++ b/MultiTool.Form/frmMain.vb @@ -23,9 +23,7 @@ Public Class frmMain Try Text = String.Format(My.Resources.frmShared._0____WebService_Multitool_für_WinLine, My.Resources.frmShared.Auswahl_der_Vorlage) - LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, Application.CompanyName, Application.ProductName) With { - .Debug = True - } + LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, Application.CompanyName, Application.ProductName) Logger = LogConfig.GetLogger() Logger.Info("Starting {0}, Version [{1}]", Application.ProductName, Application.ProductVersion) @@ -41,12 +39,13 @@ Public Class frmMain Try SplashScreenManager.SetWaitFormDescription("Initialisierung der Grundfunktionen") - FormHelper = New FormHelper(LogConfig) + FormHelper = New FormHelper(LogConfig, Me) ConfigManager = New ConfigManager(Of [Shared].Config)(LogConfig, Application.UserAppDataPath, Application.CommonAppDataPath, Application.StartupPath ) + LogConfig.Debug = ConfigManager.Config.Debug GridBuilder = New GridBuilder(GridViewTemplates) GridBuilder.WithDefaults.WithReadOnlyOptions.WithClipboardHandler() @@ -137,14 +136,30 @@ Public Class frmMain ' Fill tables oTemplate = TemplateLoader.UpdateTemplateFromFile(oTemplate, My.GeneralConfiguration.TemplateDirectory) - oTemplate = TemplateLoader.UpdateTemplateFromDatabase(oTemplate, TemplateLoader.TemplateConfiguration) - - If oTemplate.IsImport Then - Dim oForm As New frmImportMain(LogConfig, ConfigManager, oTemplate) - oForm.ShowDialog() - Else - Dim oForm As New frmExportMain(LogConfig, ConfigManager, oTemplate) - oForm.ShowDialog() + oTemplate = TemplateLoader.UpdateTemplateFromDatabase(oTemplate) + oTemplate = TemplateLoader.UpdateTemplateTablesFromDatabase(oTemplate, TemplateLoader.TemplateConfiguration) + + Dim oBaseDirectories As New List(Of String) From { + oTemplate.InputDirectory, + oTemplate.OutputDirectory, + oTemplate.ArchiveDirectory + } + Dim oOutputDirectories As New List(Of String) From { + oTemplate.OutputReportDirectory, + oTemplate.OutputWebserviceDirectory, + oTemplate.OutputXmlFileDirectory + } + + If TryCreateTemplateDirectories(oBaseDirectories) Then + If TryCreateTemplateDirectories(oOutputDirectories) Then + If oTemplate.IsImport Then + Dim oForm As New frmImportMain(LogConfig, ConfigManager, oTemplate) + oForm.ShowDialog() + Else + Dim oForm As New frmExportMain(LogConfig, ConfigManager, oTemplate) + oForm.ShowDialog() + End If + End If End If Catch ex As Exception @@ -153,23 +168,27 @@ Public Class frmMain End Try End Sub - Private Sub TryOpenDirectory(pPath As String, pDisplayName As String) - If Directory.Exists(pPath) Then - Process.Start(pPath) - Else - Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName) - MsgBox(oMessage, MsgBoxStyle.Exclamation, Text) - End If - End Sub + Private Function TryCreateTemplateDirectories(pDirectories As List(Of String)) As Boolean + For Each oDirectory In pDirectories + If Directory.Exists(oDirectory) = False Then + Dim oResult As MsgBoxResult = MsgBox($"Das Verzeichnis [{oDirectory}] existiert noch nicht, wird aber zum Benutzen des Programms benötigt. Wollen Sie es jetzt anlegen?", vbQuestion Or vbYesNo, Text) + If oResult = MsgBoxResult.Yes Then + Try + Directory.CreateDirectory(oDirectory) + Catch ex As Exception + Logger.Error(ex) + MsgBox($"Das Verzeichnis [{oDirectory}] konnte nicht angelegt werden. Grund: [{ex.Message}]") + + Return False + End Try + Else + Return False + End If + End If + Next - Private Sub TryOpenFile(pPath As String, pDisplayName As String) - If File.Exists(pPath) Then - Process.Start(pPath) - Else - Dim oMessage = String.Format(My.Resources.frmImportMainExtra._0__nicht_konfiguriert_oder_nicht_gefunden, pDisplayName) - MsgBox(oMessage, MsgBoxStyle.Exclamation, Text) - End If - End Sub + Return True + End Function Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick Dim oForm As New frmConfig(LogConfig, ConfigManager) @@ -178,14 +197,14 @@ Public Class frmMain Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick Dim oUserConfigDirectory = New FileInfo(ConfigManager.UserConfigPath).Directory - TryOpenDirectory(oUserConfigDirectory.FullName, My.Resources.frmImportMainExtra.Konfigurationsverzeichnis) + FormHelper.TryOpenDirectory(oUserConfigDirectory.FullName, My.Resources.frmImportMainExtra.Konfigurationsverzeichnis) End Sub Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick - TryOpenDirectory(LogConfig.LogDirectory, My.Resources.frmImportMainExtra.Logverzeichnis) + FormHelper.TryOpenDirectory(LogConfig.LogDirectory, My.Resources.frmImportMainExtra.Logverzeichnis) End Sub - Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click - + Private Sub btnOpenSchemaDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenSchemaDirectory.ItemClick + FormHelper.TryOpenDirectory(My.GeneralConfiguration.TemplateDirectory, My.Resources.frmImportMainExtra.Vorlagenverzeichnis) End Sub End Class \ No newline at end of file diff --git a/MultiTool.Form/frmRowEditor.vb b/MultiTool.Form/frmRowEditor.vb index 9a25791..dc6e849 100644 --- a/MultiTool.Form/frmRowEditor.vb +++ b/MultiTool.Form/frmRowEditor.vb @@ -45,7 +45,7 @@ Public Class frmRowEditor InitializeComponent() Logger = pLogConfig.GetLogger() - FormHelper = New FormHelper(pLogConfig) + FormHelper = New FormHelper(pLogConfig, Me) _Columns = pColumns _Accounts = pWinline.Accounts.Where(Function(a) a.Mandator.Id = pMandator.Id).ToList() diff --git a/MultiTool.Shared/Config.vb b/MultiTool.Shared/Config.vb index 99c7f16..23d6564 100644 --- a/MultiTool.Shared/Config.vb +++ b/MultiTool.Shared/Config.vb @@ -3,4 +3,5 @@ Public Class Config Public Property ConnectionString As String = "" + Public Property Debug As Boolean = False End Class diff --git a/MultiTool.Shared/Documents/Document.vb b/MultiTool.Shared/Documents/Document.vb index 032fc7e..e7f0806 100644 --- a/MultiTool.Shared/Documents/Document.vb +++ b/MultiTool.Shared/Documents/Document.vb @@ -10,7 +10,7 @@ Namespace Documents Public Mandator As Mandator Public TemplateName As String - Public TemplateType As Integer + Public Property TemplateType As Integer Public [Option] As Integer Public PrintVoucher As Integer diff --git a/MultiTool.Shared/Documents/DocumentCleaner.vb b/MultiTool.Shared/Documents/DocumentCleaner.vb index bd4f900..0f4a31d 100644 --- a/MultiTool.Shared/Documents/DocumentCleaner.vb +++ b/MultiTool.Shared/Documents/DocumentCleaner.vb @@ -6,18 +6,18 @@ Namespace Documents Public Class DocumentCleaner Inherits BaseClass - Private ReadOnly GeneralConfig As GeneralConfig + Private ReadOnly Template As Template Private ReadOnly FileEx As DigitalData.Modules.Filesystem.File - Public Sub New(pLogConfig As LogConfig, pGeneralConfig As GeneralConfig) + Public Sub New(pLogConfig As LogConfig, pTemplate As Template) MyBase.New(pLogConfig) - GeneralConfig = pGeneralConfig + Template = pTemplate FileEx = New DigitalData.Modules.Filesystem.File(LogConfig) End Sub Public Function CleanImportedDocuments(pDocuments As List(Of Document)) As Boolean Dim oResult = True - Dim oOutputDirectory = FileEx.GetDateDirectory(GeneralConfig.OutputXmlFileDirectory) + Dim oOutputDirectory = FileEx.GetDateDirectory(Template.OutputXmlFileDirectory) Dim oImportedDocuments = pDocuments. Where(Function(doc) doc.Imported = True). ToList() diff --git a/MultiTool.Shared/Documents/DocumentLoader.vb b/MultiTool.Shared/Documents/DocumentLoader.vb index 19c075c..b0d04da 100644 --- a/MultiTool.Shared/Documents/DocumentLoader.vb +++ b/MultiTool.Shared/Documents/DocumentLoader.vb @@ -29,17 +29,12 @@ Namespace Documents TemplateConfig = pTemplateConfig End Sub - - Public Function LoadFiles(pInputDirectory As String, pTemplate As Template, pMandator As Mandator) As Boolean - If pInputDirectory = String.Empty Then - Throw New ArgumentNullException("InputDirectory") - End If - - Logger.Info("Loading files from directory [{0}]", pInputDirectory) + Public Function LoadFiles(pTemplate As Template, pMandator As Mandator) As Boolean + Logger.Info("Loading files from directory [{0}]", pTemplate.InputDirectory) Files.Clear() Try - Dim oDirectory As New DirectoryInfo(pInputDirectory) + Dim oDirectory As New DirectoryInfo(pTemplate.InputDirectory) Dim oFiles = oDirectory.GetFiles() Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory) diff --git a/MultiTool.Shared/Report/ReportGenerator.vb b/MultiTool.Shared/Report/ReportGenerator.vb index 3024719..052730a 100644 --- a/MultiTool.Shared/Report/ReportGenerator.vb +++ b/MultiTool.Shared/Report/ReportGenerator.vb @@ -23,8 +23,8 @@ Public Class ReportGenerator(Of TReport As IReport) FileEx = New DigitalData.Modules.Filesystem.File(LogConfig) End Sub - Public Function GetReportFilePath(pDocument As Document) - Dim oFinalDirectory = FileEx.GetDateDirectory(GeneralConfig.OutputReportDirectory) + Public Function GetReportFilePath(pDocument As Document, pTemplate As Template) + Dim oFinalDirectory = FileEx.GetDateDirectory(pTemplate.OutputReportDirectory) Dim oFileName = FileEx.GetFilenameWithSuffix(IO.Path.GetFileNameWithoutExtension(pDocument.File.Name), FileEx.GetDateTimeString, "pdf") Dim oFilePath As String = IO.Path.Combine(oFinalDirectory, oFileName) Return oFilePath diff --git a/MultiTool.Shared/Templates/GeneralConfig.vb b/MultiTool.Shared/Templates/GeneralConfig.vb index c565a15..3873348 100644 --- a/MultiTool.Shared/Templates/GeneralConfig.vb +++ b/MultiTool.Shared/Templates/GeneralConfig.vb @@ -1,26 +1,8 @@ Namespace Templates Public Class GeneralConfig - Public Property InputDirectory As String = "" - Public Property OutputDirectory As String = "" Public Property TemplateDirectory As String = "" - Public ReadOnly Property OutputReportDirectory - Get - Return IO.Path.Combine(OutputDirectory, "Reports") - End Get - End Property - - Public ReadOnly Property OutputWebserviceDirectory - Get - Return IO.Path.Combine(OutputDirectory, "WebService") - End Get - End Property - - Public ReadOnly Property OutputXmlFileDirectory - Get - Return IO.Path.Combine(OutputDirectory, "XmlFiles") - End Get - End Property + Public Property Templates As New List(Of TemplateConfig) Public Property Webservice As New WebServiceConfig() Public Property DefaultYearOverride As Integer = 0 diff --git a/MultiTool.Shared/Templates/Template.vb b/MultiTool.Shared/Templates/Template.vb index 904d349..3f5c771 100644 --- a/MultiTool.Shared/Templates/Template.vb +++ b/MultiTool.Shared/Templates/Template.vb @@ -1,12 +1,38 @@ Namespace Templates Public Class Template + Public Property Guid As Integer Public Property Name As String Public Property FileName As String Public Property Description As String Public Property IsImport As Boolean + Public Property Parameter1 As String + Public Property Parameter2 As String + Public Property FinalSQL As String Public Property Tables As New List(Of Table) + Public Property InputDirectory As String + Public Property OutputDirectory As String + Public Property ArchiveDirectory As String + + Public ReadOnly Property OutputReportDirectory + Get + Return IO.Path.Combine(OutputDirectory, "Reports") + End Get + End Property + + Public ReadOnly Property OutputWebserviceDirectory + Get + Return IO.Path.Combine(OutputDirectory, "WebService") + End Get + End Property + + Public ReadOnly Property OutputXmlFileDirectory + Get + Return IO.Path.Combine(OutputDirectory, "XmlFiles") + End Get + End Property + Class Table Public Property Name As String Public Property Columns As New List(Of Column) diff --git a/MultiTool.Shared/Templates/TemplateLoader.vb b/MultiTool.Shared/Templates/TemplateLoader.vb index fb92759..1efbaa1 100644 --- a/MultiTool.Shared/Templates/TemplateLoader.vb +++ b/MultiTool.Shared/Templates/TemplateLoader.vb @@ -34,10 +34,14 @@ Namespace Templates For Each oRow As DataRow In oTable.Rows Dim oTemplate As New Template With { + .Guid = oRow.Item("GUID"), .Name = oRow.ItemEx("NAME", String.Empty), .Description = oRow.ItemEx("DESCRIPTION", String.Empty), .FileName = oRow.ItemEx("FILE_NAME", String.Empty), - .IsImport = oRow.ItemEx("IS_IMPORT", True) + .IsImport = oRow.ItemEx("IS_IMPORT", True), + .FinalSQL = oRow.ItemEx("FINAL_SQL", String.Empty), + .Parameter1 = oRow.ItemEx("PARAMETER_1", String.Empty), + .Parameter2 = oRow.ItemEx("PARAMETER_2", String.Empty) } oTemplates.Add(oTemplate) @@ -80,12 +84,6 @@ Namespace Templates Case "WEBSERVICE_IMPORT_RELATIVE_PATH" oGeneralConfig.Webservice.ImportRelativePath = oValue - Case "INPUT_DIRECTORY" - oGeneralConfig.InputDirectory = oValue - - Case "OUTPUT_DIRECTORY" - oGeneralConfig.OutputDirectory = oValue - Case "TEMPLATE_DIRECTORY" oGeneralConfig.TemplateDirectory = oValue @@ -237,7 +235,7 @@ Namespace Templates Return pTemplate End Function - Public Function UpdateTemplateFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template + Public Function UpdateTemplateTablesFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template If pTemplateConfig Is Nothing Then Return pTemplate End If @@ -260,6 +258,35 @@ Namespace Templates Return pTemplate End Function + Public Function UpdateTemplateFromDatabase(pTemplate As Template) As Template + Try + Dim oTable As DataTable = Database.GetDatatable($"{SQL_TBEDI_XML_CONFIG} WHERE TEMPLATE_ID = {pTemplate.Guid}") + Dim oGeneralConfig As New GeneralConfig + + For Each oRow As DataRow In oTable.Rows + Dim oValue As String = oRow.ItemEx("VALUE", String.Empty) + + Select Case oRow.Item("KEY") + Case "INPUT_DIRECTORY" + pTemplate.InputDirectory = oValue + + Case "OUTPUT_DIRECTORY" + pTemplate.OutputDirectory = oValue + + Case "ARCHIVE_DIRECTORY" + pTemplate.ArchiveDirectory = oValue + + End Select + Next + + Return pTemplate + Catch ex As Exception + Logger.Error(ex) + Return pTemplate + + End Try + End Function + Public Function GetElementType(pElement As XElement) As Constants.ColumnType Dim oTypeString = XmlData.GetElementAttribute(pElement, "type") diff --git a/MultiTool.Shared/Winline/Entities/Document.vb b/MultiTool.Shared/Winline/Entities/Document.vb index e70c3d7..e4d0c40 100644 --- a/MultiTool.Shared/Winline/Entities/Document.vb +++ b/MultiTool.Shared/Winline/Entities/Document.vb @@ -1,9 +1,24 @@ Namespace Winline.Entities Public Class Document + Public Property Schema As Templates.Template + Public Property Account As Account + Public ReadOnly Property AccountName As String + Get + Return Account?.ToString() + End Get + End Property + + Public Property Kind As DocumentKind Public Property RunningNumber As String Public Property Number As String Public Property [Date] As Date + Public Property DateColumn As String + Public Property NetAmount As Double + Public Property GrossAmount As Double + + Public Property IsSelected As Boolean = False + Public Property IsExported As Boolean = False End Class End Namespace \ No newline at end of file diff --git a/MultiTool.Shared/Winline/WebServiceData.vb b/MultiTool.Shared/Winline/WebServiceData.vb index 3c4ed34..13ad825 100644 --- a/MultiTool.Shared/Winline/WebServiceData.vb +++ b/MultiTool.Shared/Winline/WebServiceData.vb @@ -4,6 +4,7 @@ Imports System.Xml Imports DigitalData.Modules.Filesystem Imports DigitalData.Modules.Logging Imports MultiTool.Shared.Documents +Imports MultiTool.Shared.Templates Imports MultiTool.Shared.Templates.GeneralConfig Imports MultiTool.Shared.Winline.Entities @@ -13,16 +14,16 @@ Namespace Winline Private ReadOnly Config As WebServiceConfig Private ReadOnly Serializer As Serializer - Private ReadOnly OutputDirectory As String + Private ReadOnly GeneralConfig As GeneralConfig Private ReadOnly FileEx As File Public Event WebServiceProgress As EventHandler(Of String) - Public Sub New(pLogConfig As LogConfig, pWebserviceConfig As WebServiceConfig, pOutputDirectoryPath As String) + Public Sub New(pLogConfig As LogConfig, pWebserviceConfig As WebServiceConfig, pGeneralConfig As GeneralConfig) MyBase.New(pLogConfig) Serializer = New Serializer(pLogConfig) Config = pWebserviceConfig - OutputDirectory = pOutputDirectoryPath + GeneralConfig = pGeneralConfig FileEx = New DigitalData.Modules.Filesystem.File(LogConfig) End Sub @@ -30,13 +31,10 @@ Namespace Winline RaiseEvent WebServiceProgress(Me, pMessage) End Sub - Public Async Function TransferDocumentToWinline(pDocument As Documents.Document, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean) + Public Async Function TransferDocumentToWinline(pDocument As Documents.Document, pTemplate As Template, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean) Dim oBytes As Byte() = GetBytesFromDocument(pDocument) Dim oWS = Config - ' --- Get and create path for request/response files - Dim oOutputDirectory = FileEx.GetDateDirectory(OutputDirectory) - RaiseEvent WebServiceProgress(Me, "Einstellungen laden") ' --- Build all teh filenamez and pathz @@ -44,22 +42,24 @@ Namespace Winline Dim oBaseFileName As String = FileEx.GetDateTimeString() Dim oFileName = FileEx.GetFilenameWithSuffix(oBaseFileName, "Request", "xml") + ' --- Get and create path for request/response files + Dim oOutputDirectory = FileEx.GetDateDirectory(pTemplate.OutputWebserviceDirectory) + ' Relative Path for Webservice Call Dim oImportRelativeFilePath = IO.Path.Combine(FileEx.GetDateDirectory(oWS.ImportRelativePath), oFileName) ' Absolute Path to copy Request file - Dim oImportAbsolutePath = IO.Path.Combine(oWS.ImportBasePath, oWS.ImportRelativePath) - Dim oImportAbsoluteFilePath = IO.Path.Combine(FileEx.GetDateDirectory(oImportAbsolutePath), oFileName) + Dim oImportAbsoluteFilePath = IO.Path.Combine(oWS.ImportBasePath, FileEx.GetDateDirectory(oWS.ImportRelativePath), oFileName) - ' --- Serialize Data into XML string + ' Output path + Dim oOutputFilePath = IO.Path.Combine(oOutputDirectory, oFileName) RaiseEvent WebServiceProgress(Me, "Dateien schreiben") - Dim oOutputFilePath = IO.Path.Combine(oOutputDirectory, oFileName) + ' --- Serialize Data into XML string IO.File.WriteAllBytes(oOutputFilePath, oBytes) ' --- Copy file to Winline Import Directory - Try IO.File.Copy(oOutputFilePath, oImportAbsoluteFilePath, True) Catch ex As Exception @@ -94,7 +94,60 @@ Namespace Winline ' --- Bring the action! Try Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL) - Await HandleResponse(oResponse, oOutputDirectory, oBaseFileName) + Await HandleImportResponse(oResponse, pTemplate, oBaseFileName) + + Return True + Catch ex As Exception + Logger.Error(ex) + Throw ex + Finally + oClient.Dispose() + End Try + End Function + + Async Function ExportDocumentFromWinline(pDocument As Entities.Document, pTemplate As Template, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean) + Dim oWS = Config + + ' --- Build all teh filenamez and pathz + + Dim oBaseFileName As String = FileEx.GetDateTimeString() + Dim oFileName = FileEx.GetFilenameWithSuffix(oBaseFileName, "Request", "xml") + + ' Absolute Path to copy Request file + Dim oImportAbsolutePath = IO.Path.Combine(oWS.ImportBasePath, oWS.ImportRelativePath) + Dim oImportAbsoluteFilePath = IO.Path.Combine(FileEx.GetDateDirectory(oImportAbsolutePath), oFileName) + + RaiseEvent WebServiceProgress(Me, "Dateien schreiben") + + ' --- Prepare URL and HTTP Client + Dim oTemplateType = 30 + Dim oTemplateName = pDocument.Schema.Name + Dim oKey = $"{pDocument.Account.Id}-{pDocument.RunningNumber}" + + ' ActionCode: Should this be a test or not? + ' 0 = Test call + ' 1 = Real call + Dim oActionCode = 1 + If pIsTest = True Then + oActionCode = 0 + End If + + ' Byref: Should data be supplied as file or as string? + ' 0 = As String + ' 1 = As File (relative to Winline Server directory) + Dim oByref = 0 + + Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/export?User={oWS.Username}&Password={oWS.Password}&Company={pMandator.Id}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Key={oKey}" + Dim oClient As New HttpClient() + + Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl) + + RaiseEvent WebServiceProgress(Me, "Anfrage absenden") + + ' --- Bring the action! + Try + Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL) + Await HandleExportResponse(oResponse, pTemplate, oBaseFileName) Return True Catch ex As Exception @@ -105,11 +158,31 @@ Namespace Winline End Try End Function - Async Function ExportDocumentFromWinline() As Task - 'TODO: Implement export call to winline + Private Async Function HandleExportResponse(pResponse As HttpResponseMessage, pTemplate As Template, pBaseFileNAme As String) As Task + pResponse.EnsureSuccessStatusCode() + Dim oResponseBody As String = Await pResponse.Content.ReadAsStringAsync() + Dim oContentType = pResponse.Content.Headers.ContentType.MediaType + Dim oSerializer = Serializer.GetSerializer(GetType(Templates.Entities.MESOWebServiceResult)) + + RaiseEvent WebServiceProgress(Me, "Antwort verarbeiten") + + Select Case oContentType + Case "text/xml" + WriteResponseFile(pTemplate.OutputWebserviceDirectory, pBaseFileNAme, oResponseBody, "xml") + WriteResponseFile(pTemplate.OutputXmlFileDirectory, pBaseFileNAme, oResponseBody, "xml") + WriteResponseFile(FileEx.GetDateDirectory(pTemplate.ArchiveDirectory), pBaseFileNAme, oResponseBody, "xml") + + Case "text/html" + WriteResponseFile(pTemplate.OutputWebserviceDirectory, pBaseFileNAme, oResponseBody, "txt") + + Throw New ApplicationException(oResponseBody) + + Case Else + Throw New ApplicationException(oResponseBody) + End Select End Function - Private Async Function HandleResponse(pResponse As HttpResponseMessage, pOutputPath As String, pBaseFileNAme As String) As Task + Private Async Function HandleImportResponse(pResponse As HttpResponseMessage, pTemplate As Template, pBaseFileNAme As String) As Task pResponse.EnsureSuccessStatusCode() Dim oResponseBody As String = Await pResponse.Content.ReadAsStringAsync() Dim oContentType = pResponse.Content.Headers.ContentType.MediaType @@ -119,7 +192,7 @@ Namespace Winline Select Case oContentType Case "text/xml" - WriteResponseFile(pOutputPath, pBaseFileNAme, oResponseBody, "xml") + WriteResponseFile(pTemplate.OutputWebserviceDirectory, pBaseFileNAme, oResponseBody, "xml") Dim oBytes As Byte() = Encoding.UTF8.GetBytes(oResponseBody) Using oStream As New IO.MemoryStream(oBytes) @@ -148,7 +221,7 @@ Namespace Winline End Using Case "text/html" - WriteResponseFile(pOutputPath, pBaseFileNAme, oResponseBody, "txt") + WriteResponseFile(pTemplate.OutputWebserviceDirectory, pBaseFileNAme, oResponseBody, "txt") Throw New ApplicationException(oResponseBody) diff --git a/MultiTool.Shared/Winline/WinlineData.vb b/MultiTool.Shared/Winline/WinlineData.vb index 78116c4..47ffaf7 100644 --- a/MultiTool.Shared/Winline/WinlineData.vb +++ b/MultiTool.Shared/Winline/WinlineData.vb @@ -36,6 +36,14 @@ Namespace Winline Invoice = 4 End Enum + Public Class GetDocumentArgs + Public Property Account As Account + Public Property Kind As DocumentKind + Public Property DateFrom As Date + Public Property DateTo As Date + Public Property ShowExported As Boolean + End Class + Public Async Function LoadArticles(pMandator As Mandator) As Task Logger.Info("Loading Articles for Mandator [{0}]", pMandator) @@ -391,8 +399,6 @@ Namespace Winline Dim oYear = Config.GetWinLineYear() Dim oMandatorId As String = String.Empty - - ' TODO: Instead load whitelisted mandators from database Dim oWhitelistedMandators = Mandators. Where(Function(m) m.IsWhitelisted = True). OrderBy(Function(m) m.Order). @@ -455,13 +461,35 @@ Namespace Winline Return Nothing End Function - Public Function GetDocuments(pMandator As Mandator, pDocumentType As DocumentType) As List(Of Document) + Public Function GetDocuments(pMandator As Mandator, pTemplate As Template, pDocumentType As DocumentType, pOptions As GetDocumentArgs) As List(Of Document) Try Dim oYear As Integer = Config.GetWinLineYear() + + Dim oAccountConstraint = "" + If pOptions.Account IsNot Nothing Then + oAccountConstraint = $"c021 = '{pOptions.Account.Id}' AND " + End If + + Dim oKindConstraint = "" + If pOptions.Kind IsNot Nothing Then + oKindConstraint = $"c035 = {pOptions.Kind.Id} AND " + End If + + Dim oDateConstraint = "" + If pOptions.DateFrom <> Date.MinValue And pOptions.DateTo <> Date.MinValue Then + oDateConstraint = $"" + End If + + Dim oExportedConstraint = "c111 = 0 AND" + If pOptions.ShowExported Then + oExportedConstraint = "" + End If + Dim oDocumentType As Integer = pDocumentType Dim oSql = $" SELECT c139 DOCUMENT_TYPE, + c035 DOCUMENT_KIND, c021 ACCOUNT_NUMBER, c022 RUNNING_NUMBER, @@ -478,10 +506,17 @@ Namespace Winline c055 INVOICE_NUMBER, c032 INVOICE_DATE, - mesoyear + c100 GROSS_AMOUNT, + c114 NET_AMOUNT, + + c111 ALREADY_EXPORTED + FROM [{pMandator.Database}].[dbo].[T025] WHERE c139 = {oDocumentType} AND + {oAccountConstraint} + {oKindConstraint} + {oExportedConstraint} [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}" Dim oTable As DataTable = Database.GetDatatable(oSql) Dim oDocuments As New List(Of Document) @@ -489,6 +524,7 @@ Namespace Winline For Each oRow As DataRow In oTable.Rows Try Dim oDocument = GetDocumentFromDataRow(oRow) + oDocument.Schema = pTemplate oDocuments.Add(oDocument) Catch ex As Exception @@ -511,26 +547,39 @@ Namespace Winline Dim oAccountNumber = pDataRow.Item("ACCOUNT_NUMBER") Dim oRunningNumber As String = pDataRow.Item("RUNNING_NUMBER") Dim oDocumentType As Integer = pDataRow.Item("DOCUMENT_TYPE") + Dim oDocumentKind As Integer = pDataRow.Item("DOCUMENT_KIND") + Dim oGrossAmount As Double = pDataRow.Item("GROSS_AMOUNT") + Dim oNetAmount As Double = pDataRow.Item("NET_AMOUNT") + Dim oExported As Boolean = pDataRow.Item("ALREADY_EXPORTED") Dim oDocumentNumber As String = Nothing Dim oDocumentDate As Date = Nothing + Dim oDocumentDateColumn As String = Nothing Dim oAccount = Accounts. Where(Function(acc) acc.Id = oAccountNumber). FirstOrDefault() + Dim oKind = DocumentKinds. + Where(Function(kind) kind.Id = oDocumentKind). + FirstOrDefault() + Select Case oDocumentType Case 1 oDocumentNumber = pDataRow.Item("OFFER_NUMBER") oDocumentDate = pDataRow.Item("OFFER_DATE") + oDocumentDateColumn = "c027" Case 2 oDocumentNumber = pDataRow.Item("ORDER_NUMBER") oDocumentDate = pDataRow.Item("ORDER_DATE") + oDocumentDateColumn = "c028" Case 3 oDocumentNumber = pDataRow.Item("DELIVERY_NUMBER") oDocumentDate = pDataRow.Item("DELIVERY_DATE") + oDocumentDateColumn = "c029" Case 4 oDocumentNumber = pDataRow.Item("INVOICE_NUMBER") oDocumentDate = pDataRow.Item("INVOICE_DATE") + oDocumentDateColumn = "c032" End Select @@ -538,7 +587,12 @@ Namespace Winline .Account = oAccount, .RunningNumber = oRunningNumber, .Number = oDocumentNumber, - .[Date] = oDocumentDate + .[Date] = oDocumentDate, + .DateColumn = oDocumentDateColumn, + .Kind = oKind, + .GrossAmount = oGrossAmount, + .NetAmount = oNetAmount, + .IsExported = oExported } Return oDocument