WIP
This commit is contained in:
parent
5c58e05204
commit
8dfc659ef8
@ -36,6 +36,9 @@ INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('DATE')
|
||||
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('BOOLEAN')
|
||||
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('DECIMAL')
|
||||
|
||||
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('ACCOUNT')
|
||||
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('ARTICLE')
|
||||
|
||||
/* TBEDI_XML_NODES */
|
||||
|
||||
DROP TABLE [dbo].[TBEDI_XML_FUNCTIONS]
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports ImporterShared
|
||||
|
||||
@ -16,6 +17,11 @@ Public Class GridLoader
|
||||
.Name = pTable.Name
|
||||
}
|
||||
|
||||
Dim oInvisibleColumns As New List(Of String) From {
|
||||
"Zeilennummer",
|
||||
"BELEGKEY",
|
||||
"Infotext"
|
||||
}
|
||||
|
||||
oGrid.ForceInitialize()
|
||||
oGrid.MainView.PopulateColumns()
|
||||
@ -25,18 +31,33 @@ Public Class GridLoader
|
||||
oView.OptionsBehavior.Editable = False
|
||||
|
||||
For Each oCol In pTable.Columns
|
||||
Dim oVisibleIndex As Integer = 0
|
||||
|
||||
' Hide certain columns
|
||||
If oInvisibleColumns.Contains(oCol.Name) Then
|
||||
oVisibleIndex = -1
|
||||
End If
|
||||
|
||||
Dim oColumn = New Columns.GridColumn With {
|
||||
.Name = oCol.Name,
|
||||
.Caption = oCol.Name,
|
||||
.FieldName = oCol.Name,
|
||||
.UnboundType = GetColumnType(oCol),
|
||||
.VisibleIndex = 0
|
||||
.VisibleIndex = oVisibleIndex
|
||||
}
|
||||
|
||||
oView.Columns.Add(oColumn)
|
||||
|
||||
Next
|
||||
|
||||
oView.BestFitColumns()
|
||||
|
||||
Dim oGridBuilder As New GridBuilder(oView)
|
||||
oGridBuilder.
|
||||
WithDefaults().
|
||||
WithReadOnlyOptions().
|
||||
WithClipboardHandler()
|
||||
|
||||
Return oGrid
|
||||
End Function
|
||||
|
||||
|
||||
@ -261,6 +261,12 @@
|
||||
<ItemGroup>
|
||||
<Content Include="CREATE_DATABASE.sql" />
|
||||
<Content Include="README.txt" />
|
||||
<None Include="Resources\rotatecounterclockwise.svg" />
|
||||
<None Include="Resources\open1.svg" />
|
||||
<None Include="Resources\actions_checkcircled.svg" />
|
||||
<None Include="Resources\export.svg" />
|
||||
<None Include="Resources\up.svg" />
|
||||
<None Include="Resources\open22.svg" />
|
||||
<None Include="Resources\resetview.svg" />
|
||||
<None Include="Resources\actions_arrow4down.svg" />
|
||||
<None Include="Resources\save.svg" />
|
||||
|
||||
60
EDIDocumentImport/My Project/Resources.Designer.vb
generated
60
EDIDocumentImport/My Project/Resources.Designer.vb
generated
@ -70,6 +70,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property actions_checkcircled() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("actions_checkcircled", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
@ -90,6 +100,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property export() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("export", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
@ -120,6 +140,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property open1() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("open1", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
@ -140,6 +170,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property open22() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("open22", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
@ -180,6 +220,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property rotatecounterclockwise() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("rotatecounterclockwise", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
@ -230,6 +280,16 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property up() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("up", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
|
||||
@ -124,6 +124,12 @@
|
||||
<data name="paymentrefund" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\paymentrefund.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="open22" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\open22.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="resetview" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\resetview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="preview" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\preview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
@ -133,6 +139,9 @@
|
||||
<data name="import" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\import.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="open1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\open1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\save.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
@ -148,18 +157,27 @@
|
||||
<data name="bo_validation" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\bo_validation.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="up" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\up.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="wraptext" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\wraptext.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="open21" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\open21.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="export" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\export.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="actions_arrow4down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\actions_arrow4down.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="open2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\open2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="actions_checkcircled" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\actions_checkcircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="pagesetup" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\pagesetup.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
@ -169,7 +187,7 @@
|
||||
<data name="showallfieldcodes" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\showallfieldcodes.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
<data name="resetview" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\resetview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
<data name="rotatecounterclockwise" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\rotatecounterclockwise.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||
</data>
|
||||
</root>
|
||||
@ -1,17 +1,18 @@
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignBarManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignDockManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraVerticalGrid.PropertyGridControl, DevExpress.XtraVerticalGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraVerticalGrid.VGridControl, DevExpress.XtraVerticalGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignBarManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.Repository.RepositoryItemDateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignDockManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
|
||||
15
EDIDocumentImport/Resources/actions_checkcircled.svg
Normal file
15
EDIDocumentImport/Resources/actions_checkcircled.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Blue{fill:#1177D7;}
|
||||
.Yellow{fill:#FFB115;}
|
||||
.Black{fill:#727272;}
|
||||
.Green{fill:#039C23;}
|
||||
.Red{fill:#D11C1C;}
|
||||
.st0{opacity:0.75;}
|
||||
.st1{opacity:0.5;}
|
||||
</style>
|
||||
<g id="CheckCircled">
|
||||
<path d="M16,4C9.4,4,4,9.4,4,16c0,6.6,5.4,12,12,12s12-5.4,12-12C28,9.4,22.6,4,16,4z M14,22l-6-6l2-2l4,4l8-8l2,2 L14,22z" class="Green" />
|
||||
</g>
|
||||
</svg>
|
||||
18
EDIDocumentImport/Resources/export.svg
Normal file
18
EDIDocumentImport/Resources/export.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Black{fill:#727272;}
|
||||
.Yellow{fill:#FFB115;}
|
||||
.Blue{fill:#1177D7;}
|
||||
.Green{fill:#039C23;}
|
||||
.Red{fill:#D11C1C;}
|
||||
.White{fill:#FFFFFF;}
|
||||
.st0{opacity:0.75;}
|
||||
.st1{opacity:0.5;}
|
||||
.st2{opacity:0.25;}
|
||||
</style>
|
||||
<g id="Export">
|
||||
<path d="M10,12H6V6h4V12z M22,12v6v9c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h3v8h14v-2H22z M18,18H4 v6h14V18z" class="Black" />
|
||||
<polygon points="16,10 24,10 24,14 32,8 24,2 24,6 16,6 " class="Green" />
|
||||
</g>
|
||||
</svg>
|
||||
11
EDIDocumentImport/Resources/open1.svg
Normal file
11
EDIDocumentImport/Resources/open1.svg
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Open" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Yellow{fill:#FFB115;}
|
||||
.st0{opacity:0.75;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<path d="M2.2,25.2l5.5-12c0.3-0.7,1-1.2,1.8-1.2H26V9c0-0.6-0.4-1-1-1H12V5c0-0.6-0.4-1-1-1H3C2.4,4,2,4.4,2,5v20 c0,0.2,0,0.3,0.1,0.4C2.1,25.3,2.2,25.3,2.2,25.2z" class="Yellow" />
|
||||
</g>
|
||||
<path d="M31.3,14H9.6L4,26h21.8c0.5,0,1.1-0.3,1.3-0.7L32,14.7C32.1,14.3,31.8,14,31.3,14z" class="Yellow" />
|
||||
</svg>
|
||||
13
EDIDocumentImport/Resources/open22.svg
Normal file
13
EDIDocumentImport/Resources/open22.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Open2" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Green{fill:#039C23;}
|
||||
.Yellow{fill:#FFB115;}
|
||||
.st0{opacity:0.75;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<path d="M19.2,10H12V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.5,2,7v18c0,0.2,0,0.3,0.1,0.4c0,0,0.1-0.1,0.1-0.2l5.5-10 C8,14.5,8.7,14,9.5,14h13.7L19.2,10z" class="Yellow" />
|
||||
</g>
|
||||
<path d="M29.3,16H9.6L4,26h19.8c0.5,0,1.1-0.2,1.3-0.6l4.9-8.9C30.1,16.2,29.8,16,29.3,16z" class="Yellow" />
|
||||
<path d="M28,8c0-3.3-2.7-6-6-6s-6,2.7-6,6c0-2.2,1.8-4,4-4s4,1.8,4,4h-4l6,6l6-6H28z" class="Green" />
|
||||
</svg>
|
||||
15
EDIDocumentImport/Resources/rotatecounterclockwise.svg
Normal file
15
EDIDocumentImport/Resources/rotatecounterclockwise.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Yellow{fill:#FFB115;}
|
||||
.Red{fill:#D11C1C;}
|
||||
.Blue{fill:#1177D7;}
|
||||
.Green{fill:#039C23;}
|
||||
.Black{fill:#727272;}
|
||||
.White{fill:#FFFFFF;}
|
||||
.st0{opacity:0.75;}
|
||||
</style>
|
||||
<g id="RotateCounterclockwise">
|
||||
<path d="M18,4C11.4,4,6,9.4,6,16H1l7,7l7-7h-5c0-4.4,3.6-8,8-8s8,3.6,8,8s-3.6,8-8,8c-1.7,0-3.3-0.5-4.6-1.4 l-2.9,2.9c2,1.6,4.6,2.6,7.4,2.6c6.6,0,12-5.4,12-12C30,9.4,24.6,4,18,4z" class="Green" />
|
||||
</g>
|
||||
</svg>
|
||||
13
EDIDocumentImport/Resources/up.svg
Normal file
13
EDIDocumentImport/Resources/up.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Layer_1" style="enable-background:new 0 0 32 32">
|
||||
<style type="text/css">
|
||||
.Green{fill:#039C23;}
|
||||
.Yellow{fill:#FFB115;}
|
||||
.st0{opacity:0.5;}
|
||||
</style>
|
||||
<g class="st0">
|
||||
<path d="M2.2,25.2l5.5-10C8,14.5,8.7,14,9.5,14H20v-4h-8V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.5,2,7v18 c0,0.2,0,0.3,0.1,0.4C2.1,25.4,2.2,25.3,2.2,25.2z" class="Yellow" />
|
||||
</g>
|
||||
<path d="M29.3,16H9.6L4,26h19.8c0.5,0,1.1-0.2,1.3-0.6l4.9-8.9C30.1,16.2,29.8,16,29.3,16z" class="Yellow" />
|
||||
<polygon points="24,2 18,8 22,8 22,14 26,14 26,8 30,8 " class="Green" />
|
||||
</svg>
|
||||
285
EDIDocumentImport/frmImportMain.Designer.vb
generated
285
EDIDocumentImport/frmImportMain.Designer.vb
generated
@ -19,52 +19,58 @@ Partial Class frmImportMain
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmImportMain))
|
||||
Dim UnboundSourceProperty4 As DevExpress.Data.UnboundSourceProperty = New DevExpress.Data.UnboundSourceProperty()
|
||||
Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||
Me.txtVersion = New DevExpress.XtraBars.BarStaticItem()
|
||||
Me.txtFilesLoaded = New DevExpress.XtraBars.BarStaticItem()
|
||||
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnLoadFiles = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnTransferFile = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnOpenInputDirectory = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnOpenOutputDirectory = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnOpenSchemaDirectory = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnReloadFile = 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.RibbonStatusBar = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
|
||||
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.GridControlFiles = New DevExpress.XtraGrid.GridControl()
|
||||
Me.GridViewFiles = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.GridColumn1 = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.GridColumn2 = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.GridColumn3 = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.SplitContainerControl2 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerControl3 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerControl4 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.UnboundSource1 = New DevExpress.Data.UnboundSource(Me.components)
|
||||
Me.colSelected = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.colFilename = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||
Me.SplitContainerMain = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerGrids = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerGrids1 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
Me.SplitContainerGrids2 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl1.SuspendLayout()
|
||||
CType(Me.GridControlFiles, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.GridViewFiles, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl2.SuspendLayout()
|
||||
CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl3.SuspendLayout()
|
||||
CType(Me.SplitContainerControl4, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerControl4.SuspendLayout()
|
||||
CType(Me.UnboundSource1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.SplitContainerMain, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerMain.SuspendLayout()
|
||||
CType(Me.SplitContainerGrids, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerGrids.SuspendLayout()
|
||||
CType(Me.SplitContainerGrids1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerGrids1.SuspendLayout()
|
||||
CType(Me.SplitContainerGrids2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SplitContainerGrids2.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'RibbonControl
|
||||
'
|
||||
Me.RibbonControl.ExpandCollapseItem.Id = 0
|
||||
Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.txtVersion, Me.txtFilesLoaded, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3})
|
||||
Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.txtVersion, Me.txtFilesLoaded, Me.btnLoadFiles, Me.btnTransferFile, Me.btnOpenInputDirectory, Me.btnOpenOutputDirectory, Me.btnOpenSchemaDirectory, Me.btnReloadFile})
|
||||
Me.RibbonControl.Location = New System.Drawing.Point(0, 0)
|
||||
Me.RibbonControl.MaxItemId = 6
|
||||
Me.RibbonControl.MaxItemId = 12
|
||||
Me.RibbonControl.Name = "RibbonControl"
|
||||
Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
|
||||
Me.RibbonControl.Size = New System.Drawing.Size(1215, 158)
|
||||
Me.RibbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
|
||||
Me.RibbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Hide
|
||||
Me.RibbonControl.ShowToolbarCustomizeItem = False
|
||||
Me.RibbonControl.Size = New System.Drawing.Size(1215, 132)
|
||||
Me.RibbonControl.StatusBar = Me.RibbonStatusBar
|
||||
Me.RibbonControl.Toolbar.ShowCustomizeItem = False
|
||||
'
|
||||
'txtVersion
|
||||
'
|
||||
@ -79,37 +85,70 @@ Partial Class frmImportMain
|
||||
Me.txtFilesLoaded.Id = 2
|
||||
Me.txtFilesLoaded.Name = "txtFilesLoaded"
|
||||
'
|
||||
'BarButtonItem1
|
||||
'btnLoadFiles
|
||||
'
|
||||
Me.BarButtonItem1.Caption = "Import"
|
||||
Me.BarButtonItem1.Id = 3
|
||||
Me.BarButtonItem1.Name = "BarButtonItem1"
|
||||
Me.btnLoadFiles.Caption = "Dateien einlesen"
|
||||
Me.btnLoadFiles.Id = 3
|
||||
Me.btnLoadFiles.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.export
|
||||
Me.btnLoadFiles.Name = "btnLoadFiles"
|
||||
'
|
||||
'BarButtonItem2
|
||||
'btnTransferFile
|
||||
'
|
||||
Me.BarButtonItem2.Caption = "Export"
|
||||
Me.BarButtonItem2.Id = 4
|
||||
Me.BarButtonItem2.Name = "BarButtonItem2"
|
||||
Me.btnTransferFile.Caption = "Aktuelle Datei übermitteln"
|
||||
Me.btnTransferFile.Id = 4
|
||||
Me.btnTransferFile.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.actions_checkcircled
|
||||
Me.btnTransferFile.Name = "btnTransferFile"
|
||||
'
|
||||
'BarButtonItem3
|
||||
'btnOpenInputDirectory
|
||||
'
|
||||
Me.BarButtonItem3.Caption = "Edit"
|
||||
Me.BarButtonItem3.Id = 5
|
||||
Me.BarButtonItem3.Name = "BarButtonItem3"
|
||||
Me.btnOpenInputDirectory.Caption = "Eingangsverzeichnis öffnen"
|
||||
Me.btnOpenInputDirectory.Id = 6
|
||||
Me.btnOpenInputDirectory.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.open22
|
||||
Me.btnOpenInputDirectory.Name = "btnOpenInputDirectory"
|
||||
'
|
||||
'btnOpenOutputDirectory
|
||||
'
|
||||
Me.btnOpenOutputDirectory.Caption = "Ausgangsverzeichnis öffnen"
|
||||
Me.btnOpenOutputDirectory.Id = 7
|
||||
Me.btnOpenOutputDirectory.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.up
|
||||
Me.btnOpenOutputDirectory.Name = "btnOpenOutputDirectory"
|
||||
'
|
||||
'btnOpenSchemaDirectory
|
||||
'
|
||||
Me.btnOpenSchemaDirectory.Caption = "Vorlagenverzeichnis öffnen"
|
||||
Me.btnOpenSchemaDirectory.Id = 9
|
||||
Me.btnOpenSchemaDirectory.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.open1
|
||||
Me.btnOpenSchemaDirectory.Name = "btnOpenSchemaDirectory"
|
||||
'
|
||||
'btnReloadFile
|
||||
'
|
||||
Me.btnReloadFile.Caption = "Aktuelle Datei neu laden"
|
||||
Me.btnReloadFile.Id = 11
|
||||
Me.btnReloadFile.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.rotatecounterclockwise
|
||||
Me.btnReloadFile.Name = "btnReloadFile"
|
||||
'
|
||||
'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"
|
||||
'
|
||||
'RibbonPageGroup1
|
||||
'
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem1)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem2)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem3)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnLoadFiles)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnTransferFile)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnReloadFile)
|
||||
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
|
||||
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
|
||||
Me.RibbonPageGroup1.Text = "Start"
|
||||
'
|
||||
'RibbonPageGroup2
|
||||
'
|
||||
Me.RibbonPageGroup2.Alignment = DevExpress.XtraBars.Ribbon.RibbonPageGroupAlignment.Far
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenInputDirectory)
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenOutputDirectory)
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnOpenSchemaDirectory)
|
||||
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
|
||||
Me.RibbonPageGroup2.Text = "Debugging"
|
||||
'
|
||||
'RibbonStatusBar
|
||||
'
|
||||
@ -123,13 +162,13 @@ Partial Class frmImportMain
|
||||
'SplitContainerControl1
|
||||
'
|
||||
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 158)
|
||||
Me.SplitContainerControl1.Location = New System.Drawing.Point(0, 132)
|
||||
Me.SplitContainerControl1.Name = "SplitContainerControl1"
|
||||
Me.SplitContainerControl1.Panel1.Controls.Add(Me.GridControlFiles)
|
||||
Me.SplitContainerControl1.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl1.Panel2.Controls.Add(Me.SplitContainerControl2)
|
||||
Me.SplitContainerControl1.Panel2.Controls.Add(Me.SplitContainerMain)
|
||||
Me.SplitContainerControl1.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl1.Size = New System.Drawing.Size(1215, 564)
|
||||
Me.SplitContainerControl1.Size = New System.Drawing.Size(1215, 590)
|
||||
Me.SplitContainerControl1.SplitterPosition = 325
|
||||
Me.SplitContainerControl1.TabIndex = 2
|
||||
'
|
||||
@ -140,86 +179,86 @@ Partial Class frmImportMain
|
||||
Me.GridControlFiles.MainView = Me.GridViewFiles
|
||||
Me.GridControlFiles.MenuManager = Me.RibbonControl
|
||||
Me.GridControlFiles.Name = "GridControlFiles"
|
||||
Me.GridControlFiles.Size = New System.Drawing.Size(325, 564)
|
||||
Me.GridControlFiles.Size = New System.Drawing.Size(325, 590)
|
||||
Me.GridControlFiles.TabIndex = 0
|
||||
Me.GridControlFiles.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewFiles})
|
||||
'
|
||||
'GridViewFiles
|
||||
'
|
||||
Me.GridViewFiles.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn3, Me.GridColumn1, Me.GridColumn2})
|
||||
Me.GridViewFiles.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colSelected, Me.colFilename})
|
||||
Me.GridViewFiles.GridControl = Me.GridControlFiles
|
||||
Me.GridViewFiles.Name = "GridViewFiles"
|
||||
'
|
||||
'GridColumn1
|
||||
'colSelected
|
||||
'
|
||||
Me.GridColumn1.Caption = "GridColumn1"
|
||||
Me.GridColumn1.FieldName = "Name"
|
||||
Me.GridColumn1.Name = "GridColumn1"
|
||||
Me.GridColumn1.Visible = True
|
||||
Me.GridColumn1.VisibleIndex = 1
|
||||
Me.colSelected.Caption = "Ausgewählt"
|
||||
Me.colSelected.FieldName = "Selected"
|
||||
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.UnboundType = DevExpress.Data.UnboundColumnType.[Boolean]
|
||||
Me.colSelected.Visible = True
|
||||
Me.colSelected.VisibleIndex = 0
|
||||
Me.colSelected.Width = 30
|
||||
'
|
||||
'GridColumn2
|
||||
'colFilename
|
||||
'
|
||||
Me.GridColumn2.Caption = "GridColumn2"
|
||||
Me.GridColumn2.FieldName = "FullName"
|
||||
Me.GridColumn2.Name = "GridColumn2"
|
||||
Me.GridColumn2.Visible = True
|
||||
Me.GridColumn2.VisibleIndex = 2
|
||||
Me.colFilename.Caption = "Dateiname"
|
||||
Me.colFilename.FieldName = "Name"
|
||||
Me.colFilename.Name = "colFilename"
|
||||
Me.colFilename.Visible = True
|
||||
Me.colFilename.VisibleIndex = 1
|
||||
'
|
||||
'GridColumn3
|
||||
'SplitContainerMain
|
||||
'
|
||||
Me.GridColumn3.FieldName = "Selected"
|
||||
Me.GridColumn3.ImageOptions.SvgImage = CType(resources.GetObject("GridColumn3.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
||||
Me.GridColumn3.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16)
|
||||
Me.GridColumn3.Name = "GridColumn3"
|
||||
Me.GridColumn3.UnboundType = DevExpress.Data.UnboundColumnType.[Boolean]
|
||||
Me.GridColumn3.Visible = True
|
||||
Me.GridColumn3.VisibleIndex = 0
|
||||
Me.GridColumn3.Width = 30
|
||||
Me.SplitContainerMain.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerMain.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerMain.Name = "SplitContainerMain"
|
||||
Me.SplitContainerMain.Panel1.Controls.Add(Me.SplitContainerGrids)
|
||||
Me.SplitContainerMain.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerMain.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerMain.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
|
||||
Me.SplitContainerMain.Size = New System.Drawing.Size(880, 590)
|
||||
Me.SplitContainerMain.SplitterPosition = 588
|
||||
Me.SplitContainerMain.TabIndex = 1
|
||||
'
|
||||
'SplitContainerControl2
|
||||
'SplitContainerGrids
|
||||
'
|
||||
Me.SplitContainerControl2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl2.Horizontal = False
|
||||
Me.SplitContainerControl2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerControl2.Name = "SplitContainerControl2"
|
||||
Me.SplitContainerControl2.Panel1.Controls.Add(Me.SplitContainerControl3)
|
||||
Me.SplitContainerControl2.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl2.Panel2.Controls.Add(Me.SplitContainerControl4)
|
||||
Me.SplitContainerControl2.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl2.Size = New System.Drawing.Size(880, 564)
|
||||
Me.SplitContainerControl2.SplitterPosition = 288
|
||||
Me.SplitContainerControl2.TabIndex = 0
|
||||
Me.SplitContainerGrids.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerGrids.Horizontal = False
|
||||
Me.SplitContainerGrids.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerGrids.Name = "SplitContainerGrids"
|
||||
Me.SplitContainerGrids.Panel1.Controls.Add(Me.SplitContainerGrids1)
|
||||
Me.SplitContainerGrids.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerGrids.Panel2.Controls.Add(Me.SplitContainerGrids2)
|
||||
Me.SplitContainerGrids.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerGrids.Size = New System.Drawing.Size(880, 590)
|
||||
Me.SplitContainerGrids.SplitterPosition = 288
|
||||
Me.SplitContainerGrids.TabIndex = 0
|
||||
'
|
||||
'SplitContainerControl3
|
||||
'SplitContainerGrids1
|
||||
'
|
||||
Me.SplitContainerControl3.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl3.Horizontal = False
|
||||
Me.SplitContainerControl3.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerControl3.Name = "SplitContainerControl3"
|
||||
Me.SplitContainerControl3.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl3.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl3.Size = New System.Drawing.Size(880, 288)
|
||||
Me.SplitContainerControl3.SplitterPosition = 118
|
||||
Me.SplitContainerControl3.TabIndex = 0
|
||||
Me.SplitContainerGrids1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerGrids1.Horizontal = False
|
||||
Me.SplitContainerGrids1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerGrids1.Name = "SplitContainerGrids1"
|
||||
Me.SplitContainerGrids1.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerGrids1.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerGrids1.Size = New System.Drawing.Size(880, 288)
|
||||
Me.SplitContainerGrids1.SplitterPosition = 118
|
||||
Me.SplitContainerGrids1.TabIndex = 0
|
||||
'
|
||||
'SplitContainerControl4
|
||||
'SplitContainerGrids2
|
||||
'
|
||||
Me.SplitContainerControl4.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerControl4.Horizontal = False
|
||||
Me.SplitContainerControl4.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerControl4.Name = "SplitContainerControl4"
|
||||
Me.SplitContainerControl4.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerControl4.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl4.Size = New System.Drawing.Size(880, 266)
|
||||
Me.SplitContainerControl4.SplitterPosition = 126
|
||||
Me.SplitContainerControl4.TabIndex = 0
|
||||
'
|
||||
'UnboundSource1
|
||||
'
|
||||
UnboundSourceProperty4.DisplayName = Nothing
|
||||
UnboundSourceProperty4.Name = "Property0"
|
||||
Me.UnboundSource1.Properties.Add(UnboundSourceProperty4)
|
||||
Me.SplitContainerGrids2.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.SplitContainerGrids2.Horizontal = False
|
||||
Me.SplitContainerGrids2.Location = New System.Drawing.Point(0, 0)
|
||||
Me.SplitContainerGrids2.Name = "SplitContainerGrids2"
|
||||
Me.SplitContainerGrids2.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerGrids2.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerGrids2.Size = New System.Drawing.Size(880, 292)
|
||||
Me.SplitContainerGrids2.SplitterPosition = 126
|
||||
Me.SplitContainerGrids2.TabIndex = 0
|
||||
'
|
||||
'frmImportMain
|
||||
'
|
||||
@ -232,19 +271,20 @@ Partial Class frmImportMain
|
||||
Me.Name = "frmImportMain"
|
||||
Me.Ribbon = Me.RibbonControl
|
||||
Me.StatusBar = Me.RibbonStatusBar
|
||||
Me.Text = "frmImportMain"
|
||||
Me.Text = "WebService Multitool für WinLine"
|
||||
CType(Me.RibbonControl, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl1.ResumeLayout(False)
|
||||
CType(Me.GridControlFiles, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.GridViewFiles, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.SplitContainerControl2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl2.ResumeLayout(False)
|
||||
CType(Me.SplitContainerControl3, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl3.ResumeLayout(False)
|
||||
CType(Me.SplitContainerControl4, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerControl4.ResumeLayout(False)
|
||||
CType(Me.UnboundSource1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.SplitContainerMain, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerMain.ResumeLayout(False)
|
||||
CType(Me.SplitContainerGrids, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerGrids.ResumeLayout(False)
|
||||
CType(Me.SplitContainerGrids1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerGrids1.ResumeLayout(False)
|
||||
CType(Me.SplitContainerGrids2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.SplitContainerGrids2.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@ -259,14 +299,17 @@ Partial Class frmImportMain
|
||||
Friend WithEvents GridViewFiles As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents txtVersion As DevExpress.XtraBars.BarStaticItem
|
||||
Friend WithEvents txtFilesLoaded As DevExpress.XtraBars.BarStaticItem
|
||||
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents SplitContainerControl2 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents SplitContainerControl3 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents SplitContainerControl4 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents GridColumn1 As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents GridColumn2 As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents GridColumn3 As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents UnboundSource1 As DevExpress.Data.UnboundSource
|
||||
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnLoadFiles As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents SplitContainerGrids As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents SplitContainerGrids1 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents SplitContainerGrids2 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents colFilename As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents colSelected As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents btnTransferFile As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnOpenInputDirectory As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnOpenOutputDirectory As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents btnOpenSchemaDirectory As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents SplitContainerMain As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents btnReloadFile As DevExpress.XtraBars.BarButtonItem
|
||||
End Class
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="DevExpress.Data.v19.2" name="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<data name="GridColumn3.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<data name="colSelected.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
|
||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||
@ -136,7 +136,4 @@
|
||||
ZWVuIiAvPg0KICA8L2c+DQo8L3N2Zz4L
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="UnboundSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@ -4,6 +4,7 @@ Imports System.Xml
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
@ -18,13 +19,15 @@ Public Class frmImportMain
|
||||
Private ConfigManager As ConfigManager(Of ImporterShared.Config)
|
||||
Private Database As MSSQLServer
|
||||
Private Winline As Data
|
||||
Private FileEx As DigitalData.Modules.Filesystem.File
|
||||
Private WebService As WebService
|
||||
Private PositionData As PositionData
|
||||
Private DocumentLoader As Documents.DocumentLoader
|
||||
Private SchemaLoader As Schemas.SchemaLoader
|
||||
Private GridLoader As GridLoader
|
||||
|
||||
Private Grids As List(Of GridControl)
|
||||
Private GridLoader As GridLoader
|
||||
Private GridBuilder As GridBuilder
|
||||
|
||||
Private CurrentSchema As String
|
||||
Private CurrentDocument As Document
|
||||
@ -36,11 +39,19 @@ Public Class frmImportMain
|
||||
Logger = LogConfig.GetLogger()
|
||||
Logger.Info("EDI Document Importer, Version [{0}]", Application.ProductVersion)
|
||||
|
||||
ConfigManager = New ConfigManager(Of ImporterShared.Config)(LogConfig,
|
||||
ConfigManager = New ConfigManager(Of Config)(LogConfig,
|
||||
Application.UserAppDataPath,
|
||||
Application.CommonAppDataPath,
|
||||
Application.StartupPath)
|
||||
|
||||
GridBuilder = New GridBuilder(GridViewFiles)
|
||||
GridBuilder.
|
||||
WithDefaults.
|
||||
WithReadOnlyOptions.
|
||||
WithClipboardHandler()
|
||||
|
||||
FileEx = New DigitalData.Modules.Filesystem.File(LogConfig)
|
||||
|
||||
' If ConnectionString does not exist, show SQL Config Form
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
Dim oForm As New frmSQLConfig(LogConfig) With {
|
||||
@ -93,28 +104,28 @@ Public Class frmImportMain
|
||||
If oTableCounter = 0 Then
|
||||
Dim oGrid = GridLoader.GetGridFromElement(oTable)
|
||||
AddHandler oGrid.DoubleClick, AddressOf Grid_DoubleClick
|
||||
SplitContainerControl3.Panel1.Controls.Add(oGrid)
|
||||
SplitContainerGrids1.Panel1.Controls.Add(oGrid)
|
||||
oGrids.Add(oGrid)
|
||||
End If
|
||||
|
||||
If oTableCounter = 1 Then
|
||||
Dim oGrid = GridLoader.GetGridFromElement(oTable)
|
||||
AddHandler oGrid.DoubleClick, AddressOf Grid_DoubleClick
|
||||
SplitContainerControl3.Panel2.Controls.Add(oGrid)
|
||||
SplitContainerGrids1.Panel2.Controls.Add(oGrid)
|
||||
oGrids.Add(oGrid)
|
||||
End If
|
||||
|
||||
If oTableCounter = 2 Then
|
||||
Dim oGrid = GridLoader.GetGridFromElement(oTable)
|
||||
AddHandler oGrid.DoubleClick, AddressOf Grid_DoubleClick
|
||||
SplitContainerControl4.Panel1.Controls.Add(oGrid)
|
||||
SplitContainerGrids2.Panel1.Controls.Add(oGrid)
|
||||
oGrids.Add(oGrid)
|
||||
End If
|
||||
|
||||
If oTableCounter = 3 Then
|
||||
Dim oGrid = GridLoader.GetGridFromElement(oTable)
|
||||
AddHandler oGrid.DoubleClick, AddressOf Grid_DoubleClick
|
||||
SplitContainerControl4.Panel2.Controls.Add(oGrid)
|
||||
SplitContainerGrids2.Panel2.Controls.Add(oGrid)
|
||||
oGrids.Add(oGrid)
|
||||
End If
|
||||
|
||||
@ -126,7 +137,7 @@ Public Class frmImportMain
|
||||
Next
|
||||
|
||||
If oTableCounter < 3 Then
|
||||
SplitContainerControl2.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
|
||||
SplitContainerGrids.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
|
||||
End If
|
||||
|
||||
Return oGrids
|
||||
@ -135,17 +146,35 @@ Public Class frmImportMain
|
||||
Private Sub Grid_DoubleClick(sender As Object, e As EventArgs)
|
||||
Dim oGrid As GridControl = DirectCast(sender, GridControl)
|
||||
Dim oView As GridView = DirectCast(oGrid.FocusedView, GridView)
|
||||
|
||||
If Not oView.IsDataRow(oView.FocusedRowHandle) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oRow As DataRow = oView.GetDataRow(oView.FocusedRowHandle)
|
||||
Dim oColumns = oView.Columns.Select(Function(c) c.FieldName).ToList()
|
||||
Dim oDocumentRow = CurrentDocument.Rows.
|
||||
Where(Function(r) r.Id.ToString = oRow.Item("GUID")).
|
||||
SingleOrDefault()
|
||||
|
||||
Dim oForm As New frmRowEditor(oColumns, oDocumentRow)
|
||||
oForm.Showdialog()
|
||||
Dim oAccounts = Winline.Accounts.
|
||||
Where(Function(a) a.Mandator = CurrentDocument.Mandator).
|
||||
ToList()
|
||||
|
||||
Dim oForm As New frmRowEditor(oColumns, oDocumentRow, oAccounts)
|
||||
If oForm.ShowDialog() = DialogResult.OK Then
|
||||
'Dim oModifiedRow = oForm.DocumentRow
|
||||
|
||||
'For Each oField In oModifiedRow.Fields
|
||||
' oRow.Item(oField.Key) = oField.Value.Final
|
||||
|
||||
'Next
|
||||
|
||||
'oRow.AcceptChanges()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
Private Sub btnLoadFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnLoadFiles.ItemClick
|
||||
If DocumentLoader.LoadFiles(ConfigManager.Config.InputDirectory) Then
|
||||
GridControlFiles.DataSource = DocumentLoader.Files
|
||||
End If
|
||||
@ -154,83 +183,113 @@ Public Class frmImportMain
|
||||
Private Sub GridViewFiles_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewFiles.FocusedRowChanged
|
||||
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(e.FocusedRowHandle)
|
||||
Dim oDatasources As New Dictionary(Of String, DataTable)
|
||||
If LoadDocument(oDocument) Then
|
||||
CurrentDocument = oDocument
|
||||
Else
|
||||
MsgBox("Das Laden des Dokuments ist fehlgeschlagen!", MsgBoxStyle.Critical, Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' List of Root Elements in XML
|
||||
For Each oRow In oDocument.Rows
|
||||
Dim oGrid As GridControl = Grids.
|
||||
Where(Function(g) g.Name = oRow.Name).
|
||||
SingleOrDefault()
|
||||
Private Function LoadDocument(pDocument As Document)
|
||||
Try
|
||||
Dim oDatasources As New Dictionary(Of String, DataTable)
|
||||
|
||||
' Create initial Datatable if none exists for this Root Element
|
||||
If Not oDatasources.ContainsKey(oRow.Name) Then
|
||||
Dim oTable As New DataTable()
|
||||
' List of Root Elements in XML
|
||||
For Each oRow In pDocument.Rows
|
||||
Dim oGrid As GridControl = Grids.
|
||||
Where(Function(g) g.Name = oRow.Name).
|
||||
SingleOrDefault()
|
||||
|
||||
oTable.Columns.Add(New DataColumn("GUID"))
|
||||
' Create initial Datatable if none exists for this Root Element
|
||||
If Not oDatasources.ContainsKey(oRow.Name) Then
|
||||
Dim oTable As New DataTable()
|
||||
|
||||
oTable.Columns.Add(New DataColumn("GUID"))
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
oTable.Columns.Add(New DataColumn(oField.Key))
|
||||
Next
|
||||
|
||||
oDatasources.Add(oRow.Name, oTable)
|
||||
|
||||
oGrid.DataSource = oTable
|
||||
End If
|
||||
|
||||
Dim oDataTable = oDatasources.Item(oRow.Name)
|
||||
Dim oDataRow = oDataTable.NewRow()
|
||||
|
||||
oDataRow.Item("GUID") = oRow.Id.ToString
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
oTable.Columns.Add(New DataColumn(oField.Key))
|
||||
oDataRow.Item(oField.Key) = oField.Value
|
||||
Next
|
||||
|
||||
oDatasources.Add(oRow.Name, oTable)
|
||||
|
||||
oGrid.DataSource = oTable
|
||||
End If
|
||||
|
||||
Dim oDataTable = oDatasources.Item(oRow.Name)
|
||||
Dim oDataRow = oDataTable.NewRow()
|
||||
|
||||
oDataRow.Item("GUID") = oRow.Id.ToString
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
oDataRow.Item(oField.Key) = oField.Value
|
||||
oDataTable.Rows.Add(oDataRow)
|
||||
oDataTable.AcceptChanges()
|
||||
Next
|
||||
|
||||
oDataTable.Rows.Add(oDataRow)
|
||||
oDataTable.AcceptChanges()
|
||||
Next
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
CurrentDocument = oDocument
|
||||
Private Async Sub btnTransferFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnTransferFile.ItemClick
|
||||
Try
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
|
||||
GridViewFiles.ShowLoadingPanel()
|
||||
SplitContainerGrids.Enabled = False
|
||||
Await WebService.TransferDocumentToWinline(oDocument)
|
||||
|
||||
MsgBox("Document successfully transferred to WinLine!", MsgBoxStyle.Information, Text)
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error while transferring to WinLine: " & ex.Message, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
Finally
|
||||
SplitContainerGrids.Enabled = True
|
||||
GridViewFiles.HideLoadingPanel()
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
|
||||
Private Sub btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.InputDirectory)
|
||||
End Sub
|
||||
|
||||
Using oStream As New MemoryStream()
|
||||
Dim w = XmlWriter.Create(oStream)
|
||||
Private Sub btnOpenOutputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenOutputDirectory.ItemClick
|
||||
TryOpenDirectory(IO.Path.Combine(FileEx.GetAppDataPath("Digital Data", "EDI Document Importer"), "WebService"))
|
||||
End Sub
|
||||
|
||||
w.WriteStartDocument()
|
||||
Private Sub btnOpenSchemaDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenSchemaDirectory.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.SchemaDirectory)
|
||||
End Sub
|
||||
|
||||
w.WriteStartElement("MESOWebService")
|
||||
w.WriteAttributeString("Template", oDocument.TemplateName)
|
||||
w.WriteAttributeString("TemplateType", oDocument.TemplateType)
|
||||
w.WriteAttributeString("option", oDocument.Option)
|
||||
w.WriteAttributeString("printVoucher", oDocument.PrintVoucher)
|
||||
Private Sub TryOpenDirectory(pPath As String)
|
||||
Try
|
||||
Process.Start(pPath)
|
||||
Catch ex As Exception
|
||||
MsgBox($"Path {pPath} could not be found!", MsgBoxStyle.Exclamation, Text)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
For Each oRow In oDocument.Rows
|
||||
w.WriteStartElement(oRow.Name)
|
||||
|
||||
For Each oField As KeyValuePair(Of String, DocumentRow.FieldValue) In oRow.Fields
|
||||
w.WriteStartElement(oField.Key)
|
||||
w.WriteValue(oField.Value.Final)
|
||||
w.WriteEndElement() ' Field
|
||||
Next
|
||||
|
||||
w.WriteEndElement() ' Row
|
||||
Next
|
||||
|
||||
|
||||
w.WriteEndElement() ' MESOWebService
|
||||
|
||||
|
||||
w.WriteEndDocument() ' Document
|
||||
|
||||
w.Close()
|
||||
|
||||
File.WriteAllBytes(ConfigManager.Config.OutputDirectory, oStream.ToArray)
|
||||
End Using
|
||||
Private Sub btnReloadFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnReloadFile.ItemClick
|
||||
Dim oResult As DialogResult = MsgBox("Wollen Sie wirklich die Aktuelle Datei neu laden? Alle von Ihnen getätigte Änderungen werden dabei verworfen.", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text)
|
||||
|
||||
If oResult = DialogResult.Yes Then
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(GridViewFiles.FocusedRowHandle)
|
||||
|
||||
Dim oNewDocument = DocumentLoader.LoadFile(oDocument.File)
|
||||
Dim oIndex = DocumentLoader.Files.IndexOf(oDocument)
|
||||
DocumentLoader.Files.Item(oIndex) = oNewDocument
|
||||
|
||||
If LoadDocument(oNewDocument) Then
|
||||
CurrentDocument = oNewDocument
|
||||
Else
|
||||
MsgBox("Das Laden des Dokuments ist fehlgeschlagen!", MsgBoxStyle.Critical, Text)
|
||||
CurrentDocument = Nothing
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
51
EDIDocumentImport/frmRowEditor.Designer.vb
generated
51
EDIDocumentImport/frmRowEditor.Designer.vb
generated
@ -20,9 +20,9 @@ Partial Class frmRowEditor
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnSave = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnApplyFromWinline = New DevExpress.XtraBars.BarButtonItem()
|
||||
Me.btnApplyFromOriginal = 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()
|
||||
@ -43,7 +43,7 @@ Partial Class frmRowEditor
|
||||
'
|
||||
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.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3})
|
||||
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnSave, Me.btnApplyFromWinline, Me.btnApplyFromOriginal})
|
||||
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.RibbonControl1.MaxItemId = 4
|
||||
Me.RibbonControl1.Name = "RibbonControl1"
|
||||
@ -53,26 +53,26 @@ Partial Class frmRowEditor
|
||||
Me.RibbonControl1.Size = New System.Drawing.Size(914, 63)
|
||||
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
|
||||
'
|
||||
'BarButtonItem1
|
||||
'btnSave
|
||||
'
|
||||
Me.BarButtonItem1.Caption = "Save"
|
||||
Me.BarButtonItem1.Id = 1
|
||||
Me.BarButtonItem1.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.save
|
||||
Me.BarButtonItem1.Name = "BarButtonItem1"
|
||||
Me.btnSave.Caption = "Speichern und Schließen"
|
||||
Me.btnSave.Id = 1
|
||||
Me.btnSave.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.save
|
||||
Me.btnSave.Name = "btnSave"
|
||||
'
|
||||
'BarButtonItem2
|
||||
'btnApplyFromWinline
|
||||
'
|
||||
Me.BarButtonItem2.Caption = "Aus Winline übernehmen"
|
||||
Me.BarButtonItem2.Id = 2
|
||||
Me.BarButtonItem2.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.actions_arrow4down
|
||||
Me.BarButtonItem2.Name = "BarButtonItem2"
|
||||
Me.btnApplyFromWinline.Caption = "Aus Winline übernehmen"
|
||||
Me.btnApplyFromWinline.Id = 2
|
||||
Me.btnApplyFromWinline.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.actions_arrow4down
|
||||
Me.btnApplyFromWinline.Name = "btnApplyFromWinline"
|
||||
'
|
||||
'BarButtonItem3
|
||||
'btnApplyFromOriginal
|
||||
'
|
||||
Me.BarButtonItem3.Caption = "Zurücksetzen"
|
||||
Me.BarButtonItem3.Id = 3
|
||||
Me.BarButtonItem3.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.resetview
|
||||
Me.BarButtonItem3.Name = "BarButtonItem3"
|
||||
Me.btnApplyFromOriginal.Caption = "Zurücksetzen"
|
||||
Me.btnApplyFromOriginal.Id = 3
|
||||
Me.btnApplyFromOriginal.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.resetview
|
||||
Me.btnApplyFromOriginal.Name = "btnApplyFromOriginal"
|
||||
'
|
||||
'RibbonPage1
|
||||
'
|
||||
@ -82,14 +82,14 @@ Partial Class frmRowEditor
|
||||
'
|
||||
'RibbonPageGroup1
|
||||
'
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem1)
|
||||
Me.RibbonPageGroup1.ItemLinks.Add(Me.btnSave)
|
||||
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
|
||||
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
|
||||
'
|
||||
'RibbonPageGroup2
|
||||
'
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem2)
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem3)
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnApplyFromWinline)
|
||||
Me.RibbonPageGroup2.ItemLinks.Add(Me.btnApplyFromOriginal)
|
||||
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
|
||||
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
|
||||
'
|
||||
@ -121,6 +121,7 @@ Partial Class frmRowEditor
|
||||
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.Key, Me.ValueOriginal, Me.ValueExternal, Me.ValueFinal})
|
||||
Me.GridView1.GridControl = Me.GridControl1
|
||||
Me.GridView1.Name = "GridView1"
|
||||
Me.GridView1.OptionsView.RowAutoHeight = True
|
||||
'
|
||||
'Key
|
||||
'
|
||||
@ -193,14 +194,14 @@ Partial Class frmRowEditor
|
||||
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 BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnSave As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
|
||||
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents Key As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents ValueOriginal As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents ValueFinal As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents ValueExternal As DevExpress.XtraGrid.Columns.GridColumn
|
||||
Friend WithEvents BarButtonItem2 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnApplyFromWinline As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents btnApplyFromOriginal As DevExpress.XtraBars.BarButtonItem
|
||||
Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
End Class
|
||||
|
||||
@ -2,52 +2,136 @@
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraVerticalGrid.Rows
|
||||
Imports ImporterShared.Documents
|
||||
Imports ImporterShared.DocumentRow
|
||||
Imports DevExpress.XtraEditors.Repository
|
||||
Imports ImporterShared.Winline
|
||||
|
||||
Public Class frmRowEditor
|
||||
Private Row As DataRow
|
||||
Private DocumentRow As ImporterShared.DocumentRow
|
||||
Private Columns As List(Of String)
|
||||
Private ReadOnly _Columns As List(Of String)
|
||||
Private ReadOnly _DataTable As New DataTable
|
||||
Private ReadOnly _Accounts As List(Of Account)
|
||||
Private _DocumentRow As ImporterShared.DocumentRow
|
||||
|
||||
Public Sub New(pColumns As List(Of String), pDocumentRow As ImporterShared.DocumentRow)
|
||||
Private DatePicker As New RepositoryItemDateEdit()
|
||||
Private MultilineEditor As New RepositoryItemMemoEdit()
|
||||
Private AccountPicker As New RepositoryItemSearchLookUpEdit
|
||||
|
||||
Private Const COL_KEY = "KEY"
|
||||
Private Const COL_VALUE_ORIGINAL = "VALUE_ORIGINAL"
|
||||
Private Const COL_VALUE_EXTERNAL = "VALUE_EXTERNAL"
|
||||
Private Const COL_VALUE_FINAL = "VALUE_FINAL"
|
||||
|
||||
Public ReadOnly Property DocumentRow As ImporterShared.DocumentRow
|
||||
Get
|
||||
Return _DocumentRow
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(pColumns As List(Of String), pDocumentRow As ImporterShared.DocumentRow, pAccounts As List(Of Account))
|
||||
' Dieser Aufruf ist für den Designer erforderlich.
|
||||
InitializeComponent()
|
||||
|
||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||
Columns = pColumns
|
||||
DocumentRow = pDocumentRow
|
||||
_Columns = pColumns
|
||||
_Accounts = pAccounts
|
||||
_DocumentRow = pDocumentRow
|
||||
|
||||
AccountPicker.DataSource = _Accounts
|
||||
AccountPicker.DisplayMember = "Name"
|
||||
AccountPicker.ValueMember = "Id"
|
||||
End Sub
|
||||
|
||||
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Dim oDataTable As New DataTable()
|
||||
Dim oDict = New Dictionary(Of String, ImporterShared.DocumentRow.FieldValue)
|
||||
Dim oDict = New Dictionary(Of String, FieldValue)
|
||||
|
||||
For Each oColumn As String In Columns
|
||||
Dim oField = DocumentRow.Fields.
|
||||
For Each oColumn As String In _Columns
|
||||
Dim oField = _DocumentRow.Fields.
|
||||
Where(Function(f) f.Key = oColumn).
|
||||
SingleOrDefault()
|
||||
|
||||
If oField.Value Is Nothing Then
|
||||
oDict.Add(oColumn, New ImporterShared.DocumentRow.FieldValue())
|
||||
oDict.Add(oColumn, New FieldValue())
|
||||
Else
|
||||
oDict.Add(oColumn, oField.Value)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
oDataTable.Columns.Add("KEY")
|
||||
oDataTable.Columns.Add("VALUE_ORIGINAL")
|
||||
oDataTable.Columns.Add("VALUE_EXTERNAL")
|
||||
oDataTable.Columns.Add("VALUE_FINAL")
|
||||
_DataTable.Columns.Clear()
|
||||
_DataTable.Columns.Add(COL_KEY)
|
||||
_DataTable.Columns.Add(COL_VALUE_ORIGINAL)
|
||||
_DataTable.Columns.Add(COL_VALUE_EXTERNAL)
|
||||
_DataTable.Columns.Add(COL_VALUE_FINAL)
|
||||
|
||||
For Each oKV In oDict
|
||||
oDataTable.Rows.Add(oKV.Key, oKV.Value.Original, oKV.Value.External, oKV.Value.Final)
|
||||
_DataTable.Rows.Add(oKV.Key, oKV.Value.Original, oKV.Value.External, oKV.Value.Final)
|
||||
Next
|
||||
|
||||
GridControl1.DataSource = oDataTable
|
||||
GridView1.BestFitColumns()
|
||||
GridControl1.DataSource = _DataTable
|
||||
End Sub
|
||||
|
||||
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
|
||||
GridView1.CloseEditor()
|
||||
|
||||
For Each oRow As DataRow In _DataTable.Rows
|
||||
Dim oField = _DocumentRow.Fields.
|
||||
Where(Function(f) f.Key = oRow.Item(COL_KEY)).
|
||||
SingleOrDefault()
|
||||
|
||||
If oField.Key Is Nothing Then
|
||||
oField = New KeyValuePair(Of String, FieldValue)(oRow.Item(COL_KEY), New FieldValue())
|
||||
End If
|
||||
|
||||
Dim oFieldValue = oField.Value
|
||||
oFieldValue.Final = oRow.Item(COL_VALUE_FINAL)
|
||||
|
||||
If _DocumentRow.Fields.ContainsKey(oField.Key) Then
|
||||
_DocumentRow.Fields.Item(oField.Key) = oFieldValue
|
||||
Else
|
||||
_DocumentRow.Fields.Add(oField.Key, oFieldValue)
|
||||
End If
|
||||
Next
|
||||
|
||||
DialogResult = DialogResult.OK
|
||||
Close()
|
||||
End Sub
|
||||
|
||||
Private Sub btnApplyFromWinline_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnApplyFromWinline.ItemClick
|
||||
Dim oSelectedRow As DataRow = GridView1.GetDataRow(GridView1.FocusedRowHandle)
|
||||
|
||||
If oSelectedRow Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
oSelectedRow.Item(COL_VALUE_FINAL) = oSelectedRow.Item(COL_VALUE_EXTERNAL)
|
||||
oSelectedRow.AcceptChanges()
|
||||
End Sub
|
||||
|
||||
Private Sub btnApplyFromOriginal_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnApplyFromOriginal.ItemClick
|
||||
Dim oSelectedRow As DataRow = GridView1.GetDataRow(GridView1.FocusedRowHandle)
|
||||
|
||||
If oSelectedRow Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
oSelectedRow.Item(COL_VALUE_FINAL) = oSelectedRow.Item(COL_VALUE_ORIGINAL)
|
||||
oSelectedRow.AcceptChanges()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GridView1_CustomRowCellEdit(sender As Object, e As CustomRowCellEditEventArgs) Handles GridView1.CustomRowCellEdit
|
||||
Dim oDataRow As DataRow = GridView1.GetDataRow(e.RowHandle)
|
||||
|
||||
If e.Column.FieldName = COL_VALUE_ORIGINAL Or e.Column.FieldName = COL_VALUE_FINAL Then
|
||||
If oDataRow.Item(COL_KEY) = "Datum_Auftrag-Bestellung" Then
|
||||
e.RepositoryItem = DatePicker
|
||||
ElseIf e.CellValue.ToString.Length > 100 Then
|
||||
e.RepositoryItem = MultilineEditor
|
||||
ElseIf oDataRow.Item(COL_KEY) = "Fakt_Kontonummer" Or oDataRow.Item(COL_KEY) = "Lief_Kontonummer" Then
|
||||
e.RepositoryItem = AccountPicker
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
@ -35,6 +35,9 @@ Namespace Documents
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function Equals(obj As Object) As Boolean
|
||||
Return FullName = DirectCast(obj, Document).FullName
|
||||
End Function
|
||||
|
||||
' Public Type As DocumentType
|
||||
' Public Data As Object
|
||||
|
||||
@ -31,6 +31,7 @@ Namespace Documents
|
||||
End If
|
||||
|
||||
Logger.Info("Loading files from directory [{0}]", pInputDirectory)
|
||||
Files.Clear()
|
||||
|
||||
Try
|
||||
Dim oDirectory As New DirectoryInfo(pInputDirectory)
|
||||
@ -38,21 +39,31 @@ Namespace Documents
|
||||
|
||||
Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
|
||||
|
||||
Files = oFiles.
|
||||
Select(AddressOf WrapFileInfo).
|
||||
Select(AddressOf LoadDocumentData2).
|
||||
Select(Function(d) MatchDataFromWinLine(d, Winline.Mandators)).
|
||||
ToList()
|
||||
For Each oFile In oFiles
|
||||
Dim oDocument = LoadFile(oFile)
|
||||
Files.Add(oDocument)
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw New IO.IOException($"Could not load files from directory {pInputDirectory}", ex)
|
||||
Throw New IOException($"Could not load files from directory {pInputDirectory}", ex)
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function LoadFile(pFileInfo As FileInfo) As Document
|
||||
Dim oFileList As New List(Of FileInfo) From {pFileInfo}
|
||||
Logger.Info("Loading file [{0}]", pFileInfo.Name)
|
||||
|
||||
Return oFileList.
|
||||
Select(AddressOf WrapFileInfo).
|
||||
Select(AddressOf LoadDocumentData2).
|
||||
Select(Function(d) MatchDataFromWinLine(d, Winline.Mandators)).
|
||||
SingleOrDefault()
|
||||
End Function
|
||||
|
||||
Private Function LoadDocumentData2(pDocument As Document) As Document
|
||||
Dim oText As String = IO.File.ReadAllText(pDocument.FullName)
|
||||
Dim oDoc = XDocument.Parse(oText)
|
||||
@ -138,54 +149,22 @@ Namespace Documents
|
||||
|
||||
Dim oHead As DocumentRow = pDocument.Rows.
|
||||
Where(Function(r) r.Name.ToUpper.EndsWith("T025")).
|
||||
SetValue(Sub(r As DocumentRow)
|
||||
Dim oAccountNumberItem = IIf(r.Fields.ContainsKey("Fakt_Kontonummer"), r.Fields.Item("Fakt_Kontonummer"), Nothing)
|
||||
|
||||
Dim oAccountNameItem = Nothing
|
||||
If r.Fields.ContainsKey("Fakt_Name") Then
|
||||
oAccountNameItem = r.Fields.Item("Fakt_Name")
|
||||
End If
|
||||
|
||||
Dim oAccount = Winline.TryGetAccount(oAccountNumberItem.Original, pMandator)
|
||||
If oAccount IsNot Nothing Then
|
||||
oAccountNumberItem.External = oAccount.Id
|
||||
|
||||
If r.Fields.ContainsKey("Fakt_Name") Then
|
||||
oAccountNameItem.External = oAccount.Name
|
||||
End If
|
||||
End If
|
||||
End Sub).
|
||||
SetValue(Sub(r As DocumentRow)
|
||||
Dim oAccountNumberItem = Nothing
|
||||
If r.Fields.ContainsKey("Lief_Kontonummer") Then
|
||||
oAccountNumberItem = r.Fields.Item("Lief_Kontonummer")
|
||||
Else
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oAccountNameItem = Nothing
|
||||
If r.Fields.ContainsKey("Lief_Name") Then
|
||||
oAccountNameItem = r.Fields.Item("Lief_Name")
|
||||
End If
|
||||
|
||||
Dim oAccount = Winline.TryGetAccount(oAccountNumberItem.Original, pMandator)
|
||||
If oAccount IsNot Nothing Then
|
||||
oAccountNumberItem.External = oAccount.Id
|
||||
|
||||
If r.Fields.ContainsKey("Lief_Name") Then
|
||||
oAccountNameItem.External = oAccount.Name
|
||||
End If
|
||||
End If
|
||||
End Sub).
|
||||
SetValue(Sub(r As DocumentRow) SetAccountByGLN(r, pMandator, "Fakt_Kontonummer", "Fakt_Name")).
|
||||
SetValue(Sub(r As DocumentRow) SetAccountByGLN(r, pMandator, "Lief_Kontonummer", "Lief_Name")).
|
||||
FirstOrDefault()
|
||||
|
||||
Dim oPositions As List(Of DocumentRow) = pDocument.Rows.
|
||||
Where(Function(r) r.Name.ToUpper.EndsWith("T026")).
|
||||
SetValue(Sub(p As DocumentRow)
|
||||
Dim oArticleNumberItem = p.Fields.Item("Artikelnummer")
|
||||
Dim oArticleNumber = Winline.TryGetArticleNumber(oArticleNumberItem.Original, pMandator)
|
||||
SetValue(Sub(oRow As DocumentRow)
|
||||
Dim oNumberItem As DocumentRow.FieldValue = oRow.Fields.GetOrDefault("Artikelnummer")
|
||||
If oNumberItem Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oArticleNumber = Winline.TryGetArticleNumber(oNumberItem.Original, pMandator)
|
||||
If oArticleNumber IsNot Nothing Then
|
||||
oArticleNumberItem.External = oArticleNumber
|
||||
oNumberItem.External = oArticleNumber
|
||||
oNumberItem.Final = oArticleNumber
|
||||
End If
|
||||
End Sub).
|
||||
ToList()
|
||||
@ -196,78 +175,47 @@ Namespace Documents
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Private Function WrapFileInfo(pFileInfo As FileInfo) As Document
|
||||
Return New Document With {.File = pFileInfo}
|
||||
Private Sub SetAccountByGLN(oRow As DocumentRow, pMandator As Winline.Mandator, pNumberField As String, pNameField As String)
|
||||
' Try to read the Account number (which is a GLN really) and account Name
|
||||
Dim oNumberItem As DocumentRow.FieldValue = oRow.Fields.GetOrDefault(pNumberField)
|
||||
Dim oNameItem As DocumentRow.FieldValue = oRow.Fields.GetOrDefault(pNameField)
|
||||
Dim oContainsAccountName As Boolean = Not IsNothing(oNameItem)
|
||||
|
||||
If oNumberItem Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
' Try to find an account that matches the GLN
|
||||
Dim oAccount = Winline.TryGetAccount(oNumberItem.Original, pMandator)
|
||||
|
||||
' If an account was found, set it for External and Final value
|
||||
If oAccount IsNot Nothing Then
|
||||
oNumberItem.External = oAccount.Id
|
||||
oNumberItem.Final = oAccount.Id
|
||||
|
||||
If oContainsAccountName Then
|
||||
oNameItem.External = oAccount.Name
|
||||
oNameItem.Final = oAccount.Name
|
||||
Else
|
||||
oRow.Fields.Add(pNameField, New DocumentRow.FieldValue() With {
|
||||
.External = oAccount.Name,
|
||||
.Final = oAccount.Name
|
||||
})
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function TryGetDictionaryItem(Of T)(pDictionary As IDictionary(Of String, T), pKey As String) As T
|
||||
If pDictionary.ContainsKey(pKey) Then
|
||||
Return pDictionary.Item(pKey)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
End Function
|
||||
|
||||
'Private Function LoadDocumentData(pDocument As Document) As Document
|
||||
' Using oFileStream As New FileStream(pDocument.FullName, FileMode.Open, FileAccess.Read, FileShare.Read)
|
||||
' Try
|
||||
' Dim oXmlDocument = New XPathDocument(oFileStream)
|
||||
' Dim oDocument = oXmlDocument.CreateNavigator()
|
||||
' Dim oTemplateName = GetTemplateName(oDocument)
|
||||
' Dim oDocumentType = DocumentMatch.GetDocumentTypeFromTemplateName(oTemplateName)
|
||||
' Dim oSchemaType As Type = DocumentMatch.GetDocumentSchemaFromDocumentType(oDocumentType)
|
||||
|
||||
' ' Read data the first time, working copy
|
||||
' 'Using oReader = oNavigator.ReadSubtree()
|
||||
' ' Dim oSerializer = Serializer.GetSerializer(oSchemaType)
|
||||
' ' pDocument.Data = oSerializer.Deserialize(oReader)
|
||||
|
||||
' 'End Using
|
||||
|
||||
' ' Read data the second time, archive copy
|
||||
' 'Using oReader = oNavigator.ReadSubtree()
|
||||
' ' Dim oSerializer = Serializer.GetSerializer(oSchemaType)
|
||||
' ' pDocument.DataOriginal = oSerializer.Deserialize(oReader)
|
||||
|
||||
' 'End Using
|
||||
|
||||
' 'Dim oInstance As Object = Activator.CreateInstance(oSchemaType)
|
||||
' 'Dim oProps = oSchemaType.GetProperties()
|
||||
|
||||
' 'Dim oHead = oProps.
|
||||
' ' Where(Function(p) p.Name = "Head").
|
||||
' ' SingleOrDefault()
|
||||
' 'Dim oDescriptionHead As CustomAttributeData = oHead.CustomAttributes.
|
||||
' ' Where(Function(d) d.AttributeType.Equals(GetType(DescriptionAttribute))).
|
||||
' ' SingleOrDefault()
|
||||
' 'Dim oDescriptionHeadValue = oDescriptionHead.ConstructorArguments.First().Value
|
||||
' 'Dim oHeadXml = oDocument.Select($"//MESOWebService/{oDescriptionHeadValue}")
|
||||
|
||||
' 'Dim oPositions As PropertyInfo = oProps.
|
||||
' ' Where(Function(p) p.Name = "Positions").
|
||||
' ' SingleOrDefault()
|
||||
' 'Dim oDescriptionPos As CustomAttributeData = oPositions.CustomAttributes.
|
||||
' ' Where(Function(d) d.AttributeType.Equals(GetType(DescriptionAttribute))).
|
||||
' ' SingleOrDefault()
|
||||
' 'Dim oDescriptionPosValue = oDescriptionPos.ConstructorArguments.First().Value
|
||||
' 'Dim oPosXml = oDocument.Select($"//MESOWebService/{oDescriptionPosValue}")
|
||||
|
||||
|
||||
|
||||
|
||||
' pDocument.Type = oDocumentType
|
||||
' Return pDocument
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
|
||||
' Dim oException As Exception = ex
|
||||
' If ex.InnerException IsNot Nothing Then
|
||||
' oException = ex.InnerException
|
||||
' End If
|
||||
|
||||
' Throw oException
|
||||
' End Try
|
||||
' End Using
|
||||
'End Function
|
||||
|
||||
Private Function GetTemplateName(pDocument As XPathNavigator) As String
|
||||
Dim oTemplateName = pDocument.
|
||||
SelectSingleNode("//MESOWebService").
|
||||
GetAttribute("Template", "")
|
||||
|
||||
Return oTemplateName
|
||||
Private Function WrapFileInfo(pFileInfo As FileInfo) As Document
|
||||
Return New Document With {.File = pFileInfo}
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
17
ImporterShared/IDictionaryEx.vb
Normal file
17
ImporterShared/IDictionaryEx.vb
Normal file
@ -0,0 +1,17 @@
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
Module IDictionaryEx
|
||||
<Extension()>
|
||||
Function GetOrDefault(Of TKey, TValue)(pDictionary As Dictionary(Of TKey, TValue), pKey As TKey, Optional pOnMissing As TValue = Nothing) As TValue
|
||||
Dim oValue As TValue
|
||||
Return IIf(pDictionary.TryGetValue(pKey, oValue), oValue, pOnMissing)
|
||||
End Function
|
||||
|
||||
<Extension()>
|
||||
Function GetOrInsertNew(Of T, U As New)(dic As Dictionary(Of T, U), key As T) As U
|
||||
If dic.ContainsKey(key) Then Return dic(key)
|
||||
Dim newObj As U = New U()
|
||||
dic(key) = newObj
|
||||
Return newObj
|
||||
End Function
|
||||
End Module
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
Module IEnumerableEx
|
||||
<Extension()>
|
||||
Function SetValue(Of T)(ByVal items As IEnumerable(Of T), ByVal updateMethod As Action(Of T)) As IEnumerable(Of T)
|
||||
Function SetValue(Of T)(items As IEnumerable(Of T), updateMethod As Action(Of T)) As IEnumerable(Of T)
|
||||
For Each item As T In items
|
||||
updateMethod(item)
|
||||
Next
|
||||
|
||||
@ -100,6 +100,7 @@
|
||||
<Compile Include="Documents\DocumentRow.vb" />
|
||||
<Compile Include="Documents\DocumentType.vb" />
|
||||
<Compile Include="Documents\DocumentLoader.vb" />
|
||||
<Compile Include="IDictionaryEx.vb" />
|
||||
<Compile Include="IEnumerableEx.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
|
||||
@ -28,6 +28,9 @@ Namespace Winline
|
||||
|
||||
Public Const V50_ACCOUNTNUMBER = "c002"
|
||||
Public Const V50_ACCOUNTNAME = "c003"
|
||||
Public Const V50_STREETNAME = "c050"
|
||||
Public Const V50_ZIPCODE = "c051"
|
||||
Public Const V50_CITYNAME = "c052"
|
||||
|
||||
Public Const T45_KEY = "c000"
|
||||
Public Const T45_NAME = "c001"
|
||||
@ -66,9 +69,12 @@ Namespace Winline
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
SELECT DISTINCT
|
||||
[c002],
|
||||
[c003]
|
||||
FROM [{pMandator.Server}].[{pMandator.Database}].[dbo].[v005]
|
||||
[c002], -- Kundennummer
|
||||
[c003], -- Kundenname
|
||||
[c050], -- Straße
|
||||
[c052], -- Ort
|
||||
[c051] -- PLZ
|
||||
FROM [{pMandator.Server}].[{pMandator.Database}].[dbo].[v050]
|
||||
WHERE
|
||||
c139 IS NULL
|
||||
AND mesocomp = '{pMandator.Id}'
|
||||
@ -77,9 +83,18 @@ Namespace Winline
|
||||
Dim oAccounts As New List(Of Account)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oAccountNumber As String = Utils.NotNull(oRow.Item(V50_ACCOUNTNUMBER), String.Empty)
|
||||
Dim oAccountName As String = Utils.NotNull(oRow.Item(V50_ACCOUNTNAME), String.Empty)
|
||||
Dim oStreetName As String = Utils.NotNull(oRow.Item(V50_STREETNAME), String.Empty)
|
||||
Dim oZipCode As String = Utils.NotNull(oRow.Item(V50_ZIPCODE), String.Empty)
|
||||
Dim oCityName As String = Utils.NotNull(oRow.Item(V50_CITYNAME), String.Empty)
|
||||
|
||||
oAccounts.Add(New Account With {
|
||||
.Id = oRow.Item(V05_ACCOUNTID),
|
||||
.Name = oRow.Item(V05_ACCOUNTNAME),
|
||||
.Id = oAccountNumber,
|
||||
.Name = oAccountName,
|
||||
.StreetName = oStreetName,
|
||||
.ZipCode = oZipCode,
|
||||
.CityName = oCityName,
|
||||
.Mandator = pMandator.Id
|
||||
})
|
||||
Next
|
||||
@ -188,7 +203,10 @@ Namespace Winline
|
||||
Dim oSQL = $"
|
||||
SELECT
|
||||
[c002], -- Kundennummer
|
||||
[c003] -- Kundenname
|
||||
[c003], -- Kundenname
|
||||
[c050], -- Straße
|
||||
[c052], -- Ort
|
||||
[c051] -- PLZ
|
||||
FROM [{pMandator.Database}].[dbo].[v050]
|
||||
WHERE [c004] = 2 -- KontoTyp
|
||||
AND [c260] = '{pGLN}'
|
||||
@ -212,10 +230,16 @@ Namespace Winline
|
||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
||||
Dim oAccountNumber As String = Utils.NotNull(oRow.Item(V50_ACCOUNTNUMBER), String.Empty)
|
||||
Dim oAccountName As String = Utils.NotNull(oRow.Item(V50_ACCOUNTNAME), String.Empty)
|
||||
Dim oStreetName As String = Utils.NotNull(oRow.Item(V50_STREETNAME), String.Empty)
|
||||
Dim oZipCode As String = Utils.NotNull(oRow.Item(V50_ZIPCODE), String.Empty)
|
||||
Dim oCityName As String = Utils.NotNull(oRow.Item(V50_CITYNAME), String.Empty)
|
||||
|
||||
Return New Account With {
|
||||
.Id = oAccountNumber,
|
||||
.Name = oAccountName,
|
||||
.StreetName = oStreetName,
|
||||
.CityName = oCityName,
|
||||
.ZipCode = oZipCode,
|
||||
.Mandator = pMandator.Id
|
||||
}
|
||||
Catch ex As Exception
|
||||
|
||||
@ -2,6 +2,11 @@
|
||||
Public Class Account
|
||||
Public Property Id As String
|
||||
Public Property Name As String
|
||||
|
||||
Public Property StreetName As String
|
||||
Public Property CityName As String
|
||||
Public Property ZipCode As String
|
||||
|
||||
Public Property Mandator As String
|
||||
|
||||
Public Overrides Function GetHashCode() As Integer
|
||||
|
||||
@ -25,82 +25,75 @@ Namespace Winline
|
||||
'Mapper = MapperFactory.GetMapper()
|
||||
End Sub
|
||||
|
||||
'Public Async Function TransferDocumentToWinLine(pDocument As Document) As Task(Of Boolean)
|
||||
' If TypeOf pDocument.Data Is Schemas.Orders.Input.MESOWebService Then
|
||||
' Return Await TransferOrderToWinline(pDocument)
|
||||
' Else
|
||||
' Return False
|
||||
' End If
|
||||
'End Function
|
||||
Public Async Function TransferDocumentToWinline(pDocument As Document) As Task(Of Boolean)
|
||||
Dim oBytes As Byte() = GetBytesFromDocument(pDocument)
|
||||
Dim oWS As Config.WebServiceConfig = Config.Webservice
|
||||
|
||||
'Private Async Function TransferOrderToWinline(pDocument As Document) As Task(Of Boolean)
|
||||
' Dim oOrderOutput = TransformOrderToOutput(pDocument.Data)
|
||||
' Dim oWS As Config.WebServiceConfig = Config.Webservice
|
||||
' --- Get and create path for request/response files
|
||||
|
||||
' ' --- Get and create path for request/response files
|
||||
Dim oPath As String = GetBaseWebServicePath()
|
||||
If IO.Directory.Exists(oPath) = False Then
|
||||
IO.Directory.CreateDirectory(oPath)
|
||||
End If
|
||||
|
||||
' Dim oPath As String = GetBaseWebServicePath()
|
||||
' If IO.Directory.Exists(oPath) = False Then
|
||||
' IO.Directory.CreateDirectory(oPath)
|
||||
' End If
|
||||
' --- Build all teh filenamez and pathz
|
||||
|
||||
' ' --- Build all teh filenamez and pathz
|
||||
Dim oBaseFileName As String = GetBaseFilenameForRequest()
|
||||
Dim oFileName = GetXmlFilenameWithSuffix(oBaseFileName, "Request", "xml")
|
||||
|
||||
' Dim oBaseFileName As String = GetBaseFilenameForRequest()
|
||||
' Dim oFileName = GetXmlFilenameWithSuffix(oBaseFileName, "Request", "xml")
|
||||
' Relative Path for Webservice Call
|
||||
Dim oImportRelativeFilePath = IO.Path.Combine(GetDateSubDirectoryPath(Config.Webservice.ImportRelativePath), oFileName)
|
||||
|
||||
' ' Relative Path for Webservice Call
|
||||
' Dim oImportRelativeFilePath = IO.Path.Combine(GetDateSubDirectoryPath(Config.Webservice.ImportRelativePath), oFileName)
|
||||
' Absolute Path to copy Request file
|
||||
Dim oImportAbsolutePath = IO.Path.Combine(Config.Webservice.ImportBasePath, Config.Webservice.ImportRelativePath)
|
||||
Dim oImportAbsoluteFilePath = IO.Path.Combine(GetDateSubDirectoryPath(oImportAbsolutePath), oFileName)
|
||||
|
||||
' ' Absolute Path to copy Request file
|
||||
' Dim oImportAbsolutePath = IO.Path.Combine(Config.Webservice.ImportBasePath, Config.Webservice.ImportRelativePath)
|
||||
' Dim oImportAbsoluteFilePath = IO.Path.Combine(GetDateSubDirectoryPath(oImportAbsolutePath), oFileName)
|
||||
' --- Serialize Data into XML string
|
||||
|
||||
' ' --- Serialize Data into XML string
|
||||
Dim oOutputFilePath = IO.Path.Combine(GetBaseWebServicePath(), oFileName)
|
||||
IO.File.WriteAllBytes(oOutputFilePath, oBytes)
|
||||
|
||||
' Dim oOutputFilePath = SerializeOrder(oOrderOutput, oFileName)
|
||||
' --- Copy file to Winline Import Directory
|
||||
|
||||
' ' --- Copy file to Winline Import Directory
|
||||
Try
|
||||
IO.File.Copy(oOutputFilePath, oImportAbsoluteFilePath, True)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
|
||||
' Try
|
||||
' IO.File.Copy(oOutputFilePath, oImportAbsoluteFilePath, True)
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Throw ex
|
||||
' End Try
|
||||
' --- Prepare URL and HTTP Client
|
||||
Dim oTemplateType = pDocument.TemplateType
|
||||
Dim oTemplateName = pDocument.TemplateName
|
||||
|
||||
' ' --- Prepare URL and HTTP Client
|
||||
' Dim oTemplateType = 30
|
||||
' Dim oTemplateName = "EXIM-VRG_orders"
|
||||
' ActionCode: Should this be a test or not?
|
||||
' 0 = Testcall
|
||||
' 1 = Real call
|
||||
Dim oActionCode = 1
|
||||
|
||||
' ' ActionCode: Should this be a test or not?
|
||||
' ' 0 = Testcall
|
||||
' ' 1 = Real call
|
||||
' Dim oActionCode = 1
|
||||
' Byref: Should data be supplied as file or as string?
|
||||
' 0 = As String
|
||||
' 1 = As File (relative to Winline Server directory)
|
||||
Dim oByref = 1
|
||||
|
||||
' ' Byref: Should data be supplied as file or as string?
|
||||
' ' 0 = As String
|
||||
' ' 1 = As File (relative to Winline Server directory)
|
||||
' Dim oByref = 1
|
||||
Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/import?User={oWS.Username}&Password={oWS.Password}&Company={pDocument.Mandator}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Byref={oByref}&Data={oImportRelativeFilePath}"
|
||||
Dim oClient As New HttpClient()
|
||||
|
||||
' Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/import?User={oWS.Username}&Password={oWS.Password}&Company={pDocument.Mandator}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Byref={oByref}&Data={oImportRelativeFilePath}"
|
||||
' Dim oClient As New HttpClient()
|
||||
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
|
||||
' Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
' --- Bring the action!
|
||||
Try
|
||||
Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
|
||||
Await HandleResponse(oResponse, oPath, oBaseFileName)
|
||||
|
||||
' ' --- Bring the action!
|
||||
' Try
|
||||
' Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
|
||||
' Await HandleResponse(oResponse, oPath, oBaseFileName)
|
||||
|
||||
' Return True
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Throw ex
|
||||
' Finally
|
||||
' oClient.Dispose()
|
||||
' End Try
|
||||
'End Function
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Finally
|
||||
oClient.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Async Function HandleResponse(pResponse As HttpResponseMessage, pPath As String, pBaseFileNAme As String) As Task
|
||||
pResponse.EnsureSuccessStatusCode()
|
||||
@ -115,6 +108,7 @@ Namespace Winline
|
||||
Dim oBytes As Byte() = Encoding.UTF8.GetBytes(oResponseBody)
|
||||
Using oStream As New IO.MemoryStream(oBytes)
|
||||
Dim oResponseObject As Schemas.MESOWebServiceResult = oSerializer.Deserialize(oStream)
|
||||
Dim oErrorStrings As New List(Of String)
|
||||
|
||||
For Each oDetails As Schemas.MESOWebServiceResultResultDetails In oResponseObject.ResultDetails
|
||||
|
||||
@ -124,11 +118,14 @@ Namespace Winline
|
||||
Else
|
||||
Logger.Warn("ErrorCode: [{0}]", oDetails.ErrorCode)
|
||||
Logger.Warn("ErrorText: [{0}]", oDetails.ErrorText)
|
||||
oErrorStrings.Add($"[{oDetails.ErrorCode}] {oDetails.ErrorText}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If oResponseObject.OverallSuccess = False Then
|
||||
Throw New ApplicationException("Request to Webservice was unsuccessful. Please check the logs.")
|
||||
Dim oMessage = $"Request to Webservice was unsuccessful:{vbNewLine}{vbNewLine}{String.Join(vbNewLine, oErrorStrings.ToArray)}"
|
||||
|
||||
Throw New ApplicationException(oMessage)
|
||||
End If
|
||||
End Using
|
||||
|
||||
@ -155,6 +152,49 @@ Namespace Winline
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function GetBytesFromDocument(pDocument As Document) As Byte()
|
||||
Dim oFilteredFields As New List(Of String) From {
|
||||
"Fakt_Name",
|
||||
"Lief_Name"
|
||||
}
|
||||
|
||||
Using oStream As New IO.MemoryStream()
|
||||
Dim w = XmlWriter.Create(oStream)
|
||||
|
||||
w.WriteStartDocument()
|
||||
w.WriteStartElement("MESOWebService")
|
||||
w.WriteAttributeString("Template", pDocument.TemplateName)
|
||||
w.WriteAttributeString("TemplateType", pDocument.TemplateType)
|
||||
w.WriteAttributeString("option", pDocument.Option)
|
||||
w.WriteAttributeString("printVoucher", pDocument.PrintVoucher)
|
||||
|
||||
For Each oRow In pDocument.Rows
|
||||
w.WriteStartElement(oRow.Name)
|
||||
|
||||
For Each oField As KeyValuePair(Of String, DocumentRow.FieldValue) In oRow.Fields
|
||||
If oField.Value.Final = String.Empty Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If oFilteredFields.Contains(oField.Key) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
w.WriteStartElement(oField.Key)
|
||||
w.WriteValue(oField.Value.Final)
|
||||
w.WriteEndElement() ' Field
|
||||
Next
|
||||
|
||||
w.WriteEndElement() ' Row
|
||||
Next
|
||||
w.WriteEndElement() ' MESOWebService
|
||||
w.WriteEndDocument() ' Document
|
||||
w.Close()
|
||||
|
||||
Return oStream.ToArray()
|
||||
End Using
|
||||
End Function
|
||||
|
||||
'Private Function TransformOrderToOutput(pData As Schemas.Orders.Input.MESOWebService) As Schemas.Orders.Output.MESOWebService
|
||||
' Dim oData As Schemas.Orders.Input.MESOWebService = pData
|
||||
' Dim oResult As Schemas.Orders.Output.MESOWebService = Mapper.Map(Of Schemas.Orders.Output.MESOWebService)(oData)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user