WIP
This commit is contained in:
parent
b7602d896a
commit
5c58e05204
156
EDIDocumentImport/CREATE_DATABASE.sql
Normal file
156
EDIDocumentImport/CREATE_DATABASE.sql
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
USE [DD_ECM]
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
GO
|
||||||
|
|
||||||
|
/* TBEDI_XML_TEMPLATES */
|
||||||
|
|
||||||
|
DROP TABLE [dbo].[TBEDI_XML_TEMPLATES]
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[TBEDI_XML_TEMPLATES](
|
||||||
|
[GUID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[NAME] [nvarchar](20) NOT NULL,
|
||||||
|
[DESCRIPTION] [nvarchar](max) NULL
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_TEMPLATES] (NAME, DESCRIPTION) VALUES ('EXIM-VRG_orders', 'Schaum EDI Aufträge')
|
||||||
|
|
||||||
|
/* TBEDI_XML_TYPES */
|
||||||
|
|
||||||
|
DROP TABLE [dbo].[TBEDI_XML_TYPES]
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[TBEDI_XML_TYPES](
|
||||||
|
[GUID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[NAME] [nvarchar](20) NOT NULL
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('STRING')
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_TYPES] (NAME) VALUES ('INTEGER')
|
||||||
|
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')
|
||||||
|
|
||||||
|
/* TBEDI_XML_NODES */
|
||||||
|
|
||||||
|
DROP TABLE [dbo].[TBEDI_XML_FUNCTIONS]
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[TBEDI_XML_FUNCTIONS](
|
||||||
|
[GUID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[NAME] [nvarchar](max) NOT NULL,
|
||||||
|
[DESCRIPTION] [nvarchar](max) NOT NULL,
|
||||||
|
[PARAMETERS] [nvarchar](max) NULL,
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_FUNCTIONS] (NAME, DESCRIPTION) VALUES ('GLN', 'Finds an WinLine Account Number by GLN')
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_FUNCTIONS] (NAME, DESCRIPTION) VALUES ('EAN', 'Finds an WinLine Article Number by EAN')
|
||||||
|
|
||||||
|
/* TBEDI_XML_NODES */
|
||||||
|
|
||||||
|
DROP TABLE [dbo].[TBEDI_XML_NODES]
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[TBEDI_XML_NODES](
|
||||||
|
[GUID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[NAME] [nvarchar](max) NOT NULL,
|
||||||
|
[TEMPLATE_ID] [int] NOT NULL,
|
||||||
|
[IS_HEAD] [bit] NOT NULL
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[TBEDI_XML_NODES]
|
||||||
|
ADD CONSTRAINT DF_TBEDI_XML_NODES_IS_HEAD
|
||||||
|
DEFAULT 0 FOR IS_HEAD
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_NODES] (NAME, IS_HEAD, TEMPLATE_ID) VALUES ('EXIM-VRG_ordersT025', 1, 1)
|
||||||
|
INSERT INTO [dbo].[TBEDI_XML_NODES] (NAME, IS_HEAD, TEMPLATE_ID) VALUES ('EXIM-VRG_ordersT026', 0, 1)
|
||||||
|
|
||||||
|
/* TBEDI_XML_ITEMS */
|
||||||
|
|
||||||
|
DROP TABLE [dbo].[TBEDI_XML_ITEMS]
|
||||||
|
|
||||||
|
CREATE TABLE [dbo].[TBEDI_XML_ITEMS](
|
||||||
|
[GUID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
|
||||||
|
[XML_NAME] [nvarchar](50) NOT NULL,
|
||||||
|
[XML_NODE_ID] [int] NOT NULL,
|
||||||
|
[XML_TYPE_ID] [int] NOT NULL,
|
||||||
|
[READ_ONLY] [bit] NOT NULL,
|
||||||
|
[FUNCTION_ID] [int] NULL
|
||||||
|
) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[TBEDI_XML_ITEMS]
|
||||||
|
ADD CONSTRAINT FK_TBEDI_XML_TYPES FOREIGN KEY (XML_TYPE_ID)
|
||||||
|
REFERENCES [dbo].[TBEDI_XML_ITEMS] (GUID)
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[TBEDI_XML_ITEMS]
|
||||||
|
ADD CONSTRAINT FK_TBEDI_XML_NODES FOREIGN KEY (XML_NODE_ID)
|
||||||
|
REFERENCES [dbo].[TBEDI_XML_ITEMS] (GUID)
|
||||||
|
|
||||||
|
ALTER TABLE [dbo].[TBEDI_XML_ITEMS]
|
||||||
|
ADD CONSTRAINT DF_TBEDI_XML_ITEMS_READ_ONLY
|
||||||
|
DEFAULT 0 FOR READ_ONLY
|
||||||
|
|
||||||
|
|
||||||
|
DROP VIEW [dbo].[VWEDI_XML_ITEMS]
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE VIEW [dbo].[VWEDI_XML_ITEMS]
|
||||||
|
AS
|
||||||
|
SELECT DISTINCT
|
||||||
|
[TBITEMS].[XML_NAME]
|
||||||
|
,[TBNODES].[NAME] [XML_ROOT]
|
||||||
|
,[TBTEMPLATES].[NAME] [TEMPLATE_NAME]
|
||||||
|
,[TBTYPES].[NAME] [DATA_TYPE]
|
||||||
|
,[TBNODES].[IS_HEAD] [IS_HEAD]
|
||||||
|
,[TBFUNCTIONS].[GUID] [FUNCTION_ID]
|
||||||
|
,[TBFUNCTIONS].[NAME] [FUNCTION_NAME]
|
||||||
|
,[TBFUNCTIONS].[PARAMETERS] [FUNCTION_PARAMETERS]
|
||||||
|
,[TBITEMS].[READ_ONLY]
|
||||||
|
FROM
|
||||||
|
[dbo].[TBEDI_XML_ITEMS] [TBITEMS]
|
||||||
|
INNER JOIN [dbo].[TBEDI_XML_NODES] [TBNODES] ON [TBITEMS].[XML_NODE_ID] = [TBNODES].[GUID]
|
||||||
|
INNER JOIN [dbo].[TBEDI_XML_TYPES] [TBTYPES] ON [TBITEMS].[XML_TYPE_ID] = [TBTYPES].[GUID]
|
||||||
|
INNER JOIN [dbo].[TBEDI_XML_TEMPLATES] [TBTEMPLATES] ON [TBNODES].[TEMPLATE_ID] = [TBTEMPLATES].[GUID]
|
||||||
|
LEFT OUTER JOIN [dbo].[TBEDI_XML_FUNCTIONS] [TBFUNCTIONS] ON [TBITEMS].[FUNCTION_ID] = [TBFUNCTIONS].[GUID]
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
/* Kopfdaten */
|
||||||
|
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('BELEGKEY', 1, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Fakt_Kontonummer', 1, 1, 1, 1)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Laufnummer', 1, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Bestellt_von', 1, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Lief_Kontonummer', 1, 1, 1, 1)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Belegart', 1, 2, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Datum_Auftrag-Bestellung', 1, 3, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Auftrags-Bestellnummer', 1, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Leistungsdatum', 1, 3, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Infotext', 1, 1, 1, NULL)
|
||||||
|
|
||||||
|
/* Positionsdaten */
|
||||||
|
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('BELEGKEY', 2, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Zeilennummer', 2, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Datentyp', 2, 2, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Artikelnummer', 2, 1, 1, 2)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Bezeichnung', 2, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Lieferantenartikelnummer', 2, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Menge_bestellt', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Menge_geliefert', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Colli', 2, 1, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Einzelpreis', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Zeilenrabatt1', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Zeilenrabatt2', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Zeilenrabatt3', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Zeilenrabatt4', 2, 5, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('Umsatzsteuerprozent_Zeile', 2, 2, 1, NULL)
|
||||||
|
INSERT [dbo].[TBEDI_XML_ITEMS] (XML_NAME, XML_NODE_ID, XML_TYPE_ID, READ_ONLY, FUNCTION_ID) VALUES ('EDI_Infotext', 2, 1, 1, NULL)
|
||||||
|
|
||||||
@ -259,7 +259,11 @@
|
|||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Content Include="CREATE_DATABASE.sql" />
|
||||||
<Content Include="README.txt" />
|
<Content Include="README.txt" />
|
||||||
|
<None Include="Resources\resetview.svg" />
|
||||||
|
<None Include="Resources\actions_arrow4down.svg" />
|
||||||
|
<None Include="Resources\save.svg" />
|
||||||
<None Include="Resources\open21.svg" />
|
<None Include="Resources\open21.svg" />
|
||||||
<None Include="Resources\paymentrefund.svg" />
|
<None Include="Resources\paymentrefund.svg" />
|
||||||
<None Include="Resources\open2.svg" />
|
<None Include="Resources\open2.svg" />
|
||||||
|
|||||||
30
EDIDocumentImport/My Project/Resources.Designer.vb
generated
30
EDIDocumentImport/My Project/Resources.Designer.vb
generated
@ -60,6 +60,16 @@ Namespace My.Resources
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property actions_arrow4down() As DevExpress.Utils.Svg.SvgImage
|
||||||
|
Get
|
||||||
|
Dim obj As Object = ResourceManager.GetObject("actions_arrow4down", resourceCulture)
|
||||||
|
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@ -160,6 +170,26 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property resetview() As DevExpress.Utils.Svg.SvgImage
|
||||||
|
Get
|
||||||
|
Dim obj As Object = ResourceManager.GetObject("resetview", resourceCulture)
|
||||||
|
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property save() As DevExpress.Utils.Svg.SvgImage
|
||||||
|
Get
|
||||||
|
Dim obj As Object = ResourceManager.GetObject("save", resourceCulture)
|
||||||
|
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
|
|||||||
@ -133,6 +133,9 @@
|
|||||||
<data name="import" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\import.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</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>
|
||||||
<data name="tableproperties" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="tableproperties" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\tableproperties.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
<value>..\Resources\tableproperties.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</data>
|
||||||
@ -148,6 +151,12 @@
|
|||||||
<data name="wraptext" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\wraptext.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</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="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">
|
<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>
|
<value>..\Resources\open2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</data>
|
||||||
@ -160,7 +169,7 @@
|
|||||||
<data name="showallfieldcodes" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<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>
|
<value>..\Resources\showallfieldcodes.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="open21" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="resetview" 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>
|
<value>..\Resources\resetview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
15
EDIDocumentImport/Resources/actions_arrow4down.svg
Normal file
15
EDIDocumentImport/Resources/actions_arrow4down.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="Arrow4Down">
|
||||||
|
<polygon points="18,20.3 18,4 14,4 14,20.3 6,12.3 6,18 16,28 26,18 26,12.3 " class="Green" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
17
EDIDocumentImport/Resources/resetview.svg
Normal file
17
EDIDocumentImport/Resources/resetview.svg
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?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">
|
||||||
|
.Red{fill:#D11C1C;}
|
||||||
|
.Black{fill:#727272;}
|
||||||
|
.Blue{fill:#1177D7;}
|
||||||
|
.Green{fill:#039C23;}
|
||||||
|
.Yellow{fill:#FFB115;}
|
||||||
|
.White{fill:#FFFFFF;}
|
||||||
|
.st0{opacity:0.5;}
|
||||||
|
.st1{opacity:0.75;}
|
||||||
|
.st2{opacity:0.25;}
|
||||||
|
</style>
|
||||||
|
<g id="ResetView">
|
||||||
|
<path d="M20,10h-0.7c-2.6,0-5.1,1-7.1,2.9L6,19.2V10l-4,4v12h12l4-4H8.8l6.2-6.2c1.2-1.2,2.7-1.8,4.2-1.8v0H20 c3.3,0,6,2.7,6,6v2h4v-2C30,14.5,25.5,10,20,10z" class="Blue" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
7
EDIDocumentImport/Resources/save.svg
Normal file
7
EDIDocumentImport/Resources/save.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?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="Save" style="enable-background:new 0 0 32 32">
|
||||||
|
<style type="text/css">
|
||||||
|
.Black{fill:#727272;}
|
||||||
|
</style>
|
||||||
|
<path d="M27,4h-3v10H8V4H5C4.4,4,4,4.4,4,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V5C28,4.4,27.6,4,27,4z M24,24H8v-6 h16V24z M10,4v8h10V4H10z M14,10h-2V6h2V10z" class="Black" />
|
||||||
|
</svg>
|
||||||
22
EDIDocumentImport/frmImportMain.Designer.vb
generated
22
EDIDocumentImport/frmImportMain.Designer.vb
generated
@ -20,7 +20,8 @@ Partial Class frmImportMain
|
|||||||
<System.Diagnostics.DebuggerStepThrough()>
|
<System.Diagnostics.DebuggerStepThrough()>
|
||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Me.components = New System.ComponentModel.Container()
|
Me.components = New System.ComponentModel.Container()
|
||||||
Dim UnboundSourceProperty1 As DevExpress.Data.UnboundSourceProperty = New DevExpress.Data.UnboundSourceProperty()
|
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.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||||
Me.txtVersion = New DevExpress.XtraBars.BarStaticItem()
|
Me.txtVersion = New DevExpress.XtraBars.BarStaticItem()
|
||||||
Me.txtFilesLoaded = New DevExpress.XtraBars.BarStaticItem()
|
Me.txtFilesLoaded = New DevExpress.XtraBars.BarStaticItem()
|
||||||
@ -145,7 +146,7 @@ Partial Class frmImportMain
|
|||||||
'
|
'
|
||||||
'GridViewFiles
|
'GridViewFiles
|
||||||
'
|
'
|
||||||
Me.GridViewFiles.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn1, Me.GridColumn2, Me.GridColumn3})
|
Me.GridViewFiles.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.GridColumn3, Me.GridColumn1, Me.GridColumn2})
|
||||||
Me.GridViewFiles.GridControl = Me.GridControlFiles
|
Me.GridViewFiles.GridControl = Me.GridControlFiles
|
||||||
Me.GridViewFiles.Name = "GridViewFiles"
|
Me.GridViewFiles.Name = "GridViewFiles"
|
||||||
'
|
'
|
||||||
@ -155,7 +156,7 @@ Partial Class frmImportMain
|
|||||||
Me.GridColumn1.FieldName = "Name"
|
Me.GridColumn1.FieldName = "Name"
|
||||||
Me.GridColumn1.Name = "GridColumn1"
|
Me.GridColumn1.Name = "GridColumn1"
|
||||||
Me.GridColumn1.Visible = True
|
Me.GridColumn1.Visible = True
|
||||||
Me.GridColumn1.VisibleIndex = 0
|
Me.GridColumn1.VisibleIndex = 1
|
||||||
'
|
'
|
||||||
'GridColumn2
|
'GridColumn2
|
||||||
'
|
'
|
||||||
@ -163,15 +164,18 @@ Partial Class frmImportMain
|
|||||||
Me.GridColumn2.FieldName = "FullName"
|
Me.GridColumn2.FieldName = "FullName"
|
||||||
Me.GridColumn2.Name = "GridColumn2"
|
Me.GridColumn2.Name = "GridColumn2"
|
||||||
Me.GridColumn2.Visible = True
|
Me.GridColumn2.Visible = True
|
||||||
Me.GridColumn2.VisibleIndex = 1
|
Me.GridColumn2.VisibleIndex = 2
|
||||||
'
|
'
|
||||||
'GridColumn3
|
'GridColumn3
|
||||||
'
|
'
|
||||||
Me.GridColumn3.Caption = "GridColumn3"
|
|
||||||
Me.GridColumn3.FieldName = "Selected"
|
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.Name = "GridColumn3"
|
||||||
|
Me.GridColumn3.UnboundType = DevExpress.Data.UnboundColumnType.[Boolean]
|
||||||
Me.GridColumn3.Visible = True
|
Me.GridColumn3.Visible = True
|
||||||
Me.GridColumn3.VisibleIndex = 2
|
Me.GridColumn3.VisibleIndex = 0
|
||||||
|
Me.GridColumn3.Width = 30
|
||||||
'
|
'
|
||||||
'SplitContainerControl2
|
'SplitContainerControl2
|
||||||
'
|
'
|
||||||
@ -213,9 +217,9 @@ Partial Class frmImportMain
|
|||||||
'
|
'
|
||||||
'UnboundSource1
|
'UnboundSource1
|
||||||
'
|
'
|
||||||
UnboundSourceProperty1.DisplayName = Nothing
|
UnboundSourceProperty4.DisplayName = Nothing
|
||||||
UnboundSourceProperty1.Name = "Property0"
|
UnboundSourceProperty4.Name = "Property0"
|
||||||
Me.UnboundSource1.Properties.Add(UnboundSourceProperty1)
|
Me.UnboundSource1.Properties.Add(UnboundSourceProperty4)
|
||||||
'
|
'
|
||||||
'frmImportMain
|
'frmImportMain
|
||||||
'
|
'
|
||||||
|
|||||||
@ -117,6 +117,25 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</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">
|
||||||
|
<value>
|
||||||
|
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
|
||||||
|
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||||
|
dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAHICAAAC77u/
|
||||||
|
PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
|
||||||
|
IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
|
||||||
|
MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
|
||||||
|
Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
|
||||||
|
MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLkJsdWV7ZmlsbDojMTE3N0Q3O30KCS5Z
|
||||||
|
ZWxsb3d7ZmlsbDojRkZCMTE1O30KCS5CbGFja3tmaWxsOiM3MjcyNzI7fQoJLkdyZWVue2ZpbGw6IzAz
|
||||||
|
OUMyMzt9CgkuUmVke2ZpbGw6I0QxMUMxQzt9Cgkuc3Qwe29wYWNpdHk6MC43NTt9Cgkuc3Qxe29wYWNp
|
||||||
|
dHk6MC41O30KPC9zdHlsZT4NCiAgPGcgaWQ9IkNoZWNrQ2lyY2xlZCI+DQogICAgPHBhdGggZD0iTTE2
|
||||||
|
LDRDOS40LDQsNCw5LjQsNCwxNmMwLDYuNiw1LjQsMTIsMTIsMTJzMTItNS40LDEyLTEyQzI4LDkuNCwy
|
||||||
|
Mi42LDQsMTYsNHogTTE0LDIybC02LTZsMi0ybDQsNGw4LThsMiwyICAgTDE0LDIyeiIgY2xhc3M9Ikdy
|
||||||
|
ZWVuIiAvPg0KICA8L2c+DQo8L3N2Zz4L
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
<metadata name="UnboundSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="UnboundSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|||||||
@ -27,6 +27,7 @@ Public Class frmImportMain
|
|||||||
Private Grids As List(Of GridControl)
|
Private Grids As List(Of GridControl)
|
||||||
|
|
||||||
Private CurrentSchema As String
|
Private CurrentSchema As String
|
||||||
|
Private CurrentDocument As Document
|
||||||
|
|
||||||
Private Sub frmImportMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmImportMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
txtVersion.Caption = String.Format(txtVersion.Caption, Application.ProductVersion)
|
txtVersion.Caption = String.Format(txtVersion.Caption, Application.ProductVersion)
|
||||||
@ -65,6 +66,7 @@ Public Class frmImportMain
|
|||||||
Winline.LoadMandators()
|
Winline.LoadMandators()
|
||||||
Winline.LoadEconomicYears()
|
Winline.LoadEconomicYears()
|
||||||
Winline.LoadDocumentKinds(Winline.Mandators)
|
Winline.LoadDocumentKinds(Winline.Mandators)
|
||||||
|
Winline.LoadTemplateConfiguration()
|
||||||
For Each oMandator In Winline.Mandators
|
For Each oMandator In Winline.Mandators
|
||||||
Winline.LoadAccounts(oMandator)
|
Winline.LoadAccounts(oMandator)
|
||||||
Next
|
Next
|
||||||
@ -135,8 +137,11 @@ Public Class frmImportMain
|
|||||||
Dim oView As GridView = DirectCast(oGrid.FocusedView, GridView)
|
Dim oView As GridView = DirectCast(oGrid.FocusedView, GridView)
|
||||||
Dim oRow As DataRow = oView.GetDataRow(oView.FocusedRowHandle)
|
Dim oRow As DataRow = oView.GetDataRow(oView.FocusedRowHandle)
|
||||||
Dim oColumns = oView.Columns.Select(Function(c) c.FieldName).ToList()
|
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(oRow, oColumns)
|
Dim oForm As New frmRowEditor(oColumns, oDocumentRow)
|
||||||
oForm.Showdialog()
|
oForm.Showdialog()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -151,17 +156,22 @@ Public Class frmImportMain
|
|||||||
Dim oDocument As Document = GridViewFiles.GetRow(e.FocusedRowHandle)
|
Dim oDocument As Document = GridViewFiles.GetRow(e.FocusedRowHandle)
|
||||||
Dim oDatasources As New Dictionary(Of String, DataTable)
|
Dim oDatasources As New Dictionary(Of String, DataTable)
|
||||||
|
|
||||||
|
' List of Root Elements in XML
|
||||||
For Each oRow In oDocument.Rows
|
For Each oRow In oDocument.Rows
|
||||||
Dim oGrid As GridControl = Grids.
|
Dim oGrid As GridControl = Grids.
|
||||||
Where(Function(g) g.Name = oRow.Name).
|
Where(Function(g) g.Name = oRow.Name).
|
||||||
SingleOrDefault()
|
SingleOrDefault()
|
||||||
|
|
||||||
|
' Create initial Datatable if none exists for this Root Element
|
||||||
If Not oDatasources.ContainsKey(oRow.Name) Then
|
If Not oDatasources.ContainsKey(oRow.Name) Then
|
||||||
Dim oTable As New DataTable()
|
Dim oTable As New DataTable()
|
||||||
|
|
||||||
For Each ofield In oRow.Fields
|
oTable.Columns.Add(New DataColumn("GUID"))
|
||||||
oTable.Columns.Add(New DataColumn(ofield.Key))
|
|
||||||
|
For Each oField In oRow.Fields
|
||||||
|
oTable.Columns.Add(New DataColumn(oField.Key))
|
||||||
Next
|
Next
|
||||||
|
|
||||||
oDatasources.Add(oRow.Name, oTable)
|
oDatasources.Add(oRow.Name, oTable)
|
||||||
|
|
||||||
oGrid.DataSource = oTable
|
oGrid.DataSource = oTable
|
||||||
@ -170,6 +180,8 @@ Public Class frmImportMain
|
|||||||
Dim oDataTable = oDatasources.Item(oRow.Name)
|
Dim oDataTable = oDatasources.Item(oRow.Name)
|
||||||
Dim oDataRow = oDataTable.NewRow()
|
Dim oDataRow = oDataTable.NewRow()
|
||||||
|
|
||||||
|
oDataRow.Item("GUID") = oRow.Id.ToString
|
||||||
|
|
||||||
For Each oField In oRow.Fields
|
For Each oField In oRow.Fields
|
||||||
oDataRow.Item(oField.Key) = oField.Value
|
oDataRow.Item(oField.Key) = oField.Value
|
||||||
Next
|
Next
|
||||||
@ -177,6 +189,8 @@ Public Class frmImportMain
|
|||||||
oDataTable.Rows.Add(oDataRow)
|
oDataTable.Rows.Add(oDataRow)
|
||||||
oDataTable.AcceptChanges()
|
oDataTable.AcceptChanges()
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
CurrentDocument = oDocument
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||||
@ -196,9 +210,9 @@ Public Class frmImportMain
|
|||||||
For Each oRow In oDocument.Rows
|
For Each oRow In oDocument.Rows
|
||||||
w.WriteStartElement(oRow.Name)
|
w.WriteStartElement(oRow.Name)
|
||||||
|
|
||||||
For Each oField As KeyValuePair(Of String, String) In oRow.Fields
|
For Each oField As KeyValuePair(Of String, DocumentRow.FieldValue) In oRow.Fields
|
||||||
w.WriteStartElement(oField.Key)
|
w.WriteStartElement(oField.Key)
|
||||||
w.WriteValue(oField.Value)
|
w.WriteValue(oField.Value.Final)
|
||||||
w.WriteEndElement() ' Field
|
w.WriteEndElement() ' Field
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|||||||
108
EDIDocumentImport/frmRowEditor.Designer.vb
generated
108
EDIDocumentImport/frmRowEditor.Designer.vb
generated
@ -21,14 +21,19 @@ Partial Class frmRowEditor
|
|||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||||
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
|
||||||
|
Me.BarButtonItem2 = New DevExpress.XtraBars.BarButtonItem()
|
||||||
|
Me.BarButtonItem3 = New DevExpress.XtraBars.BarButtonItem()
|
||||||
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
||||||
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||||
|
Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
|
||||||
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
|
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
|
||||||
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
|
||||||
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
|
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
|
||||||
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||||
Me.KEY = New DevExpress.XtraGrid.Columns.GridColumn()
|
Me.Key = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||||
Me.VALUE = New DevExpress.XtraGrid.Columns.GridColumn()
|
Me.ValueOriginal = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||||
|
Me.ValueExternal = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||||
|
Me.ValueFinal = New DevExpress.XtraGrid.Columns.GridColumn()
|
||||||
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.GridView1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
@ -38,9 +43,9 @@ Partial Class frmRowEditor
|
|||||||
'
|
'
|
||||||
Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified
|
Me.RibbonControl1.CommandLayout = DevExpress.XtraBars.Ribbon.CommandLayout.Simplified
|
||||||
Me.RibbonControl1.ExpandCollapseItem.Id = 0
|
Me.RibbonControl1.ExpandCollapseItem.Id = 0
|
||||||
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem1})
|
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem1, Me.BarButtonItem2, Me.BarButtonItem3})
|
||||||
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
|
Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.RibbonControl1.MaxItemId = 2
|
Me.RibbonControl1.MaxItemId = 4
|
||||||
Me.RibbonControl1.Name = "RibbonControl1"
|
Me.RibbonControl1.Name = "RibbonControl1"
|
||||||
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
|
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
|
||||||
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
|
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
|
||||||
@ -52,11 +57,26 @@ Partial Class frmRowEditor
|
|||||||
'
|
'
|
||||||
Me.BarButtonItem1.Caption = "Save"
|
Me.BarButtonItem1.Caption = "Save"
|
||||||
Me.BarButtonItem1.Id = 1
|
Me.BarButtonItem1.Id = 1
|
||||||
|
Me.BarButtonItem1.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.save
|
||||||
Me.BarButtonItem1.Name = "BarButtonItem1"
|
Me.BarButtonItem1.Name = "BarButtonItem1"
|
||||||
'
|
'
|
||||||
|
'BarButtonItem2
|
||||||
|
'
|
||||||
|
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"
|
||||||
|
'
|
||||||
|
'BarButtonItem3
|
||||||
|
'
|
||||||
|
Me.BarButtonItem3.Caption = "Zurücksetzen"
|
||||||
|
Me.BarButtonItem3.Id = 3
|
||||||
|
Me.BarButtonItem3.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.resetview
|
||||||
|
Me.BarButtonItem3.Name = "BarButtonItem3"
|
||||||
|
'
|
||||||
'RibbonPage1
|
'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.Name = "RibbonPage1"
|
||||||
Me.RibbonPage1.Text = "RibbonPage1"
|
Me.RibbonPage1.Text = "RibbonPage1"
|
||||||
'
|
'
|
||||||
@ -66,6 +86,13 @@ Partial Class frmRowEditor
|
|||||||
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
|
Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
|
||||||
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
|
Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
|
||||||
'
|
'
|
||||||
|
'RibbonPageGroup2
|
||||||
|
'
|
||||||
|
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem2)
|
||||||
|
Me.RibbonPageGroup2.ItemLinks.Add(Me.BarButtonItem3)
|
||||||
|
Me.RibbonPageGroup2.Name = "RibbonPageGroup2"
|
||||||
|
Me.RibbonPageGroup2.Text = "RibbonPageGroup2"
|
||||||
|
'
|
||||||
'RibbonStatusBar1
|
'RibbonStatusBar1
|
||||||
'
|
'
|
||||||
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 589)
|
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 589)
|
||||||
@ -91,31 +118,55 @@ Partial Class frmRowEditor
|
|||||||
'
|
'
|
||||||
'GridView1
|
'GridView1
|
||||||
'
|
'
|
||||||
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.KEY, Me.VALUE})
|
Me.GridView1.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.Key, Me.ValueOriginal, Me.ValueExternal, Me.ValueFinal})
|
||||||
Me.GridView1.GridControl = Me.GridControl1
|
Me.GridView1.GridControl = Me.GridControl1
|
||||||
Me.GridView1.Name = "GridView1"
|
Me.GridView1.Name = "GridView1"
|
||||||
'
|
'
|
||||||
'KEY
|
'Key
|
||||||
'
|
'
|
||||||
Me.KEY.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
Me.Key.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer))
|
||||||
Me.KEY.AppearanceCell.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
Me.Key.AppearanceCell.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
Me.KEY.AppearanceCell.Options.UseBackColor = True
|
Me.Key.AppearanceCell.Options.UseBackColor = True
|
||||||
Me.KEY.AppearanceCell.Options.UseFont = True
|
Me.Key.AppearanceCell.Options.UseFont = True
|
||||||
Me.KEY.Caption = "KEY"
|
Me.Key.Caption = "Schlüssel"
|
||||||
Me.KEY.FieldName = "KEY"
|
Me.Key.FieldName = "KEY"
|
||||||
Me.KEY.Name = "KEY"
|
Me.Key.Name = "Key"
|
||||||
Me.KEY.OptionsColumn.AllowEdit = False
|
Me.Key.OptionsColumn.AllowEdit = False
|
||||||
Me.KEY.OptionsColumn.ReadOnly = True
|
Me.Key.OptionsColumn.ReadOnly = True
|
||||||
Me.KEY.Visible = True
|
Me.Key.Visible = True
|
||||||
Me.KEY.VisibleIndex = 0
|
Me.Key.VisibleIndex = 0
|
||||||
'
|
'
|
||||||
'VALUE
|
'ValueOriginal
|
||||||
'
|
'
|
||||||
Me.VALUE.Caption = "VALUE"
|
Me.ValueOriginal.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||||
Me.VALUE.FieldName = "VALUE"
|
Me.ValueOriginal.AppearanceCell.Options.UseBackColor = True
|
||||||
Me.VALUE.Name = "VALUE"
|
Me.ValueOriginal.Caption = "Original Wert"
|
||||||
Me.VALUE.Visible = True
|
Me.ValueOriginal.FieldName = "VALUE_ORIGINAL"
|
||||||
Me.VALUE.VisibleIndex = 1
|
Me.ValueOriginal.Name = "ValueOriginal"
|
||||||
|
Me.ValueOriginal.OptionsColumn.AllowEdit = False
|
||||||
|
Me.ValueOriginal.OptionsColumn.ReadOnly = True
|
||||||
|
Me.ValueOriginal.Visible = True
|
||||||
|
Me.ValueOriginal.VisibleIndex = 1
|
||||||
|
'
|
||||||
|
'ValueExternal
|
||||||
|
'
|
||||||
|
Me.ValueExternal.AppearanceCell.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(192, Byte), Integer))
|
||||||
|
Me.ValueExternal.AppearanceCell.Options.UseBackColor = True
|
||||||
|
Me.ValueExternal.Caption = "Winline Wert"
|
||||||
|
Me.ValueExternal.FieldName = "VALUE_EXTERNAL"
|
||||||
|
Me.ValueExternal.Name = "ValueExternal"
|
||||||
|
Me.ValueExternal.OptionsColumn.AllowEdit = False
|
||||||
|
Me.ValueExternal.OptionsColumn.ReadOnly = True
|
||||||
|
Me.ValueExternal.Visible = True
|
||||||
|
Me.ValueExternal.VisibleIndex = 2
|
||||||
|
'
|
||||||
|
'ValueFinal
|
||||||
|
'
|
||||||
|
Me.ValueFinal.Caption = "Finaler Wert"
|
||||||
|
Me.ValueFinal.FieldName = "VALUE_FINAL"
|
||||||
|
Me.ValueFinal.Name = "ValueFinal"
|
||||||
|
Me.ValueFinal.Visible = True
|
||||||
|
Me.ValueFinal.VisibleIndex = 3
|
||||||
'
|
'
|
||||||
'frmRowEditor
|
'frmRowEditor
|
||||||
'
|
'
|
||||||
@ -145,6 +196,11 @@ Partial Class frmRowEditor
|
|||||||
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
|
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
|
||||||
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
|
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
|
||||||
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
|
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
|
||||||
Friend WithEvents KEY As DevExpress.XtraGrid.Columns.GridColumn
|
Friend WithEvents Key As DevExpress.XtraGrid.Columns.GridColumn
|
||||||
Friend WithEvents VALUE 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 RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -5,41 +5,42 @@ Imports ImporterShared.Documents
|
|||||||
|
|
||||||
Public Class frmRowEditor
|
Public Class frmRowEditor
|
||||||
Private Row As DataRow
|
Private Row As DataRow
|
||||||
|
Private DocumentRow As ImporterShared.DocumentRow
|
||||||
Private Columns As List(Of String)
|
Private Columns As List(Of String)
|
||||||
|
|
||||||
Public Sub New(pRow As DataRow, pColumns As List(Of String))
|
Public Sub New(pColumns As List(Of String), pDocumentRow As ImporterShared.DocumentRow)
|
||||||
' Dieser Aufruf ist für den Designer erforderlich.
|
' Dieser Aufruf ist für den Designer erforderlich.
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
|
|
||||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||||
Row = pRow
|
|
||||||
Columns = pColumns
|
Columns = pColumns
|
||||||
|
DocumentRow = pDocumentRow
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Private Sub frmRowEditor_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
If Row Is Nothing Then
|
|
||||||
Exit Sub
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim oDataTable As New DataTable()
|
Dim oDataTable As New DataTable()
|
||||||
Dim oDict = New Dictionary(Of String, String)
|
Dim oDict = New Dictionary(Of String, ImporterShared.DocumentRow.FieldValue)
|
||||||
|
|
||||||
For Each oColumn As String In Columns
|
For Each oColumn As String In Columns
|
||||||
Dim oValue
|
Dim oField = DocumentRow.Fields.
|
||||||
Try
|
Where(Function(f) f.Key = oColumn).
|
||||||
oValue = Row.Item(oColumn)
|
SingleOrDefault()
|
||||||
Catch ex As Exception
|
|
||||||
oValue = String.Empty
|
If oField.Value Is Nothing Then
|
||||||
End Try
|
oDict.Add(oColumn, New ImporterShared.DocumentRow.FieldValue())
|
||||||
|
Else
|
||||||
|
oDict.Add(oColumn, oField.Value)
|
||||||
|
End If
|
||||||
|
|
||||||
oDict.Add(oColumn, oValue)
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
oDataTable.Columns.Add("KEY")
|
oDataTable.Columns.Add("KEY")
|
||||||
oDataTable.Columns.Add("VALUE")
|
oDataTable.Columns.Add("VALUE_ORIGINAL")
|
||||||
|
oDataTable.Columns.Add("VALUE_EXTERNAL")
|
||||||
|
oDataTable.Columns.Add("VALUE_FINAL")
|
||||||
|
|
||||||
For Each oKV In oDict
|
For Each oKV In oDict
|
||||||
oDataTable.Rows.Add(oKV.Key, oKV.Value)
|
oDataTable.Rows.Add(oKV.Key, oKV.Value.Original, oKV.Value.External, oKV.Value.Final)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
GridControl1.DataSource = oDataTable
|
GridControl1.DataSource = oDataTable
|
||||||
|
|||||||
6
ImporterShared/Constants.vb
Normal file
6
ImporterShared/Constants.vb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Public Class Constants
|
||||||
|
Public Enum XmlFunction
|
||||||
|
GLN = 1
|
||||||
|
EAN = 2
|
||||||
|
End Enum
|
||||||
|
End Class
|
||||||
@ -7,11 +7,22 @@ Namespace Documents
|
|||||||
Public Type As DocumentType
|
Public Type As DocumentType
|
||||||
Public Selected As Boolean = False
|
Public Selected As Boolean = False
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' TODO: Set before submitting to web services
|
||||||
|
''' </summary>
|
||||||
|
Public CreatedAt As Date
|
||||||
|
|
||||||
|
|
||||||
Public TemplateName As String
|
Public TemplateName As String
|
||||||
Public TemplateType As Integer
|
Public TemplateType As Integer
|
||||||
Public [Option] As Integer
|
Public [Option] As Integer
|
||||||
Public PrintVoucher As Integer
|
Public PrintVoucher As Integer
|
||||||
|
|
||||||
|
''' <summary>
|
||||||
|
''' Original Values, read-only
|
||||||
|
''' </summary>
|
||||||
|
Public Property Rows As New List(Of DocumentRow)
|
||||||
|
|
||||||
Public ReadOnly Property FullName As String
|
Public ReadOnly Property FullName As String
|
||||||
Get
|
Get
|
||||||
Return File?.FullName
|
Return File?.FullName
|
||||||
@ -24,7 +35,6 @@ Namespace Documents
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Public Rows As New List(Of DocumentRow)
|
|
||||||
|
|
||||||
' Public Type As DocumentType
|
' Public Type As DocumentType
|
||||||
' Public Data As Object
|
' Public Data As Object
|
||||||
|
|||||||
@ -18,6 +18,7 @@ Namespace Documents
|
|||||||
|
|
||||||
Public Files As New List(Of Document)
|
Public Files As New List(Of Document)
|
||||||
|
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig, pWinline As Winline.Data)
|
Public Sub New(pLogConfig As LogConfig, pWinline As Winline.Data)
|
||||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||||
Winline = pWinline
|
Winline = pWinline
|
||||||
@ -40,6 +41,7 @@ Namespace Documents
|
|||||||
Files = oFiles.
|
Files = oFiles.
|
||||||
Select(AddressOf WrapFileInfo).
|
Select(AddressOf WrapFileInfo).
|
||||||
Select(AddressOf LoadDocumentData2).
|
Select(AddressOf LoadDocumentData2).
|
||||||
|
Select(Function(d) MatchDataFromWinLine(d, Winline.Mandators)).
|
||||||
ToList()
|
ToList()
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
@ -67,12 +69,15 @@ Namespace Documents
|
|||||||
Dim oRows As New List(Of DocumentRow)
|
Dim oRows As New List(Of DocumentRow)
|
||||||
|
|
||||||
For Each oElement As XElement In oRowElements
|
For Each oElement As XElement In oRowElements
|
||||||
Dim oFields As New Dictionary(Of String, String)
|
Dim oFields As New Dictionary(Of String, DocumentRow.FieldValue)
|
||||||
|
|
||||||
Dim oSubElements = oElement.Descendants().ToList()
|
Dim oSubElements = oElement.Descendants().ToList()
|
||||||
|
|
||||||
For Each oSubElement As XElement In oSubElements
|
For Each oSubElement As XElement In oSubElements
|
||||||
oFields.Add(oSubElement.Name.ToString, oSubElement.Value)
|
oFields.Add(oSubElement.Name.ToString, New DocumentRow.FieldValue With {
|
||||||
|
.Original = oSubElement.Value,
|
||||||
|
.Final = oSubElement.Value
|
||||||
|
})
|
||||||
Next
|
Next
|
||||||
|
|
||||||
Dim oRow = New DocumentRow With {
|
Dim oRow = New DocumentRow With {
|
||||||
@ -91,68 +96,104 @@ Namespace Documents
|
|||||||
|
|
||||||
Return pDocument
|
Return pDocument
|
||||||
End Function
|
End Function
|
||||||
'Private Function MatchDataFromWinLine(pDocument As Document, pMandators As List(Of Winline.Mandator)) As Document
|
|
||||||
' Dim oMandators As List(Of Winline.Mandator) = pMandators.
|
|
||||||
' Where(Function(m) m.IsWhitelisted = True).
|
|
||||||
' OrderBy(Function(m) m.Order).
|
|
||||||
' ToList()
|
|
||||||
|
|
||||||
' If TypeOf pDocument.Data Is Schemas.Orders.Input.MESOWebService Then
|
|
||||||
' Dim oMandator = Winline.FindMatchingMandatorFromOrder(pDocument.Data)
|
|
||||||
' Dim oData As Schemas.Orders.Input.MESOWebService = MatchOrderData(pDocument.Data, oMandator)
|
|
||||||
|
|
||||||
' If oMandator Is Nothing Then
|
Private Function MatchDataFromWinLine(pDocument As Document, pMandators As List(Of Winline.Mandator)) As Document
|
||||||
' Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
|
Dim oMandators As List(Of Winline.Mandator) = pMandators.
|
||||||
' End If
|
Where(Function(m) m.IsWhitelisted = True).
|
||||||
|
OrderBy(Function(m) m.Order).
|
||||||
|
ToList()
|
||||||
|
|
||||||
' pDocument.Mandator = oMandator.Id
|
Dim oMandator = Winline.FindMatchingMandatorFromOrder(pDocument)
|
||||||
' pDocument.Data = oData
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' Return pDocument
|
If oMandator Is Nothing Then
|
||||||
'End Function
|
Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
|
||||||
|
End If
|
||||||
|
|
||||||
Private Function MatchOrderData(pData As Input.MESOWebService, pMandator As Winline.Mandator) As Input.MESOWebService
|
pDocument = MatchOrderData(pDocument, oMandator)
|
||||||
|
pDocument.Mandator = oMandator.Id
|
||||||
|
|
||||||
|
|
||||||
|
'If TypeOf pDocument.Data Is Schemas.Orders.Input.MESOWebService Then
|
||||||
|
' Dim oMandator = Winline.FindMatchingMandatorFromOrder(pDocument.Data)
|
||||||
|
' Dim oData As Schemas.Orders.Input.MESOWebService = MatchOrderData(pDocument.Data, oMandator)
|
||||||
|
|
||||||
|
' If oMandator Is Nothing Then
|
||||||
|
' Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' pDocument.Mandator = oMandator.Id
|
||||||
|
' pDocument.Data = oData
|
||||||
|
'End If
|
||||||
|
|
||||||
|
Return pDocument
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function MatchOrderData(pDocument As Document, pMandator As Winline.Mandator) As Document
|
||||||
Dim oYear = Winline.GetWinLineYear()
|
Dim oYear = Winline.GetWinLineYear()
|
||||||
|
|
||||||
If pMandator Is Nothing Then
|
If pMandator Is Nothing Then
|
||||||
Return pData
|
Return pDocument
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oHead As Input.MESOWebServiceEXIMVRG_ordersT025 = pData.Items.
|
Dim oHead As DocumentRow = pDocument.Rows.
|
||||||
Where(Function(h) TypeOf h Is Input.MESOWebServiceEXIMVRG_ordersT025).
|
Where(Function(r) r.Name.ToUpper.EndsWith("T025")).
|
||||||
SetValue(Sub(h As Input.MESOWebServiceEXIMVRG_ordersT025)
|
SetValue(Sub(r As DocumentRow)
|
||||||
Dim oAccount = Winline.TryGetAccount(h.Fakt_Kontonummer, pMandator)
|
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
|
If oAccount IsNot Nothing Then
|
||||||
h.Fakt_Kontonummer = oAccount.Id
|
oAccountNumberItem.External = oAccount.Id
|
||||||
h.Fakt_Name = oAccount.Name
|
|
||||||
|
If r.Fields.ContainsKey("Fakt_Name") Then
|
||||||
|
oAccountNameItem.External = oAccount.Name
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub).
|
End Sub).
|
||||||
SetValue(Sub(h As Input.MESOWebServiceEXIMVRG_ordersT025)
|
SetValue(Sub(r As DocumentRow)
|
||||||
Dim oAccount = Winline.TryGetAccount(h.Lief_Kontonummer, pMandator)
|
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
|
If oAccount IsNot Nothing Then
|
||||||
h.Lief_Kontonummer = oAccount.Id
|
oAccountNumberItem.External = oAccount.Id
|
||||||
h.Lief_Name = oAccount.Name
|
|
||||||
|
If r.Fields.ContainsKey("Lief_Name") Then
|
||||||
|
oAccountNameItem.External = oAccount.Name
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub).
|
End Sub).
|
||||||
FirstOrDefault()
|
FirstOrDefault()
|
||||||
|
|
||||||
Dim oPositions As List(Of Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items.
|
Dim oPositions As List(Of DocumentRow) = pDocument.Rows.
|
||||||
Where(Function(p) TypeOf p Is Input.MESOWebServiceEXIMVRG_ordersT026).
|
Where(Function(r) r.Name.ToUpper.EndsWith("T026")).
|
||||||
SetValue(Sub(p)
|
SetValue(Sub(p As DocumentRow)
|
||||||
Dim oArticleNumber = Winline.TryGetArticleNumber(p.Artikelnummer, pMandator)
|
Dim oArticleNumberItem = p.Fields.Item("Artikelnummer")
|
||||||
|
Dim oArticleNumber = Winline.TryGetArticleNumber(oArticleNumberItem.Original, pMandator)
|
||||||
If oArticleNumber IsNot Nothing Then
|
If oArticleNumber IsNot Nothing Then
|
||||||
p.Artikelnummer = oArticleNumber
|
oArticleNumberItem.External = oArticleNumber
|
||||||
End If
|
End If
|
||||||
End Sub).
|
End Sub).
|
||||||
Select(Of Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i).
|
|
||||||
ToList()
|
ToList()
|
||||||
|
|
||||||
pData.Items = New List(Of Object) From {oHead}.
|
Dim oList As New List(Of DocumentRow) From {oHead}
|
||||||
Concat(oPositions).
|
pDocument.Rows = oList.Concat(oPositions).ToList()
|
||||||
ToArray()
|
|
||||||
|
|
||||||
Return pData
|
Return pDocument
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function WrapFileInfo(pFileInfo As FileInfo) As Document
|
Private Function WrapFileInfo(pFileInfo As FileInfo) As Document
|
||||||
|
|||||||
@ -1,4 +1,23 @@
|
|||||||
Public Class DocumentRow
|
Public Class DocumentRow
|
||||||
|
''' <summary>
|
||||||
|
''' Tabellen/Elementname aus XML
|
||||||
|
''' </summary>
|
||||||
Public Name As String
|
Public Name As String
|
||||||
Public Fields As Dictionary(Of String, String)
|
Public Id As New Guid
|
||||||
|
|
||||||
|
Public Fields As Dictionary(Of String, FieldValue)
|
||||||
|
|
||||||
|
Public Sub New()
|
||||||
|
Id = Guid.NewGuid()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Class FieldValue
|
||||||
|
Public Original As String = ""
|
||||||
|
Public External As String = ""
|
||||||
|
Public Final As String = ""
|
||||||
|
|
||||||
|
Public Overrides Function ToString() As String
|
||||||
|
Return Final
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -94,6 +94,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="BaseClass.vb" />
|
<Compile Include="BaseClass.vb" />
|
||||||
<Compile Include="Config.vb" />
|
<Compile Include="Config.vb" />
|
||||||
|
<Compile Include="Constants.vb" />
|
||||||
<Compile Include="Documents\Document.vb" />
|
<Compile Include="Documents\Document.vb" />
|
||||||
<Compile Include="Documents\DocumentMatch.vb" />
|
<Compile Include="Documents\DocumentMatch.vb" />
|
||||||
<Compile Include="Documents\DocumentRow.vb" />
|
<Compile Include="Documents\DocumentRow.vb" />
|
||||||
@ -130,7 +131,7 @@
|
|||||||
<Compile Include="Winline\Entities\Contact.vb" />
|
<Compile Include="Winline\Entities\Contact.vb" />
|
||||||
<Compile Include="Winline\Entities\DocumentKind.vb" />
|
<Compile Include="Winline\Entities\DocumentKind.vb" />
|
||||||
<Compile Include="Winline\Entities\Mandator.vb" />
|
<Compile Include="Winline\Entities\Mandator.vb" />
|
||||||
<Compile Include="Winline\Entities\XmlItem.vb" />
|
<Compile Include="Winline\Entities\TemplateColumn.vb" />
|
||||||
<Compile Include="Winline\WebService.vb" />
|
<Compile Include="Winline\WebService.vb" />
|
||||||
<Compile Include="XmlData.vb" />
|
<Compile Include="XmlData.vb" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@ -16,8 +16,10 @@ Namespace Winline
|
|||||||
Public Mandators As New List(Of Mandator)
|
Public Mandators As New List(Of Mandator)
|
||||||
Public DocumentKinds As New List(Of DocumentKind)
|
Public DocumentKinds As New List(Of DocumentKind)
|
||||||
Public Years As List(Of Integer)
|
Public Years As List(Of Integer)
|
||||||
Public XmlConfigHead As List(Of XmlItem)
|
Public TemplateConfiguration As New List(Of TemplateColumn)
|
||||||
Public XmlConfigPositions As List(Of XmlItem)
|
|
||||||
|
'Public XmlConfigHead As List(Of TemplateColumn)
|
||||||
|
'Public XmlConfigPositions As List(Of TemplateColumn)
|
||||||
|
|
||||||
Public Const ALL_MESOCOMP = "mesocomp"
|
Public Const ALL_MESOCOMP = "mesocomp"
|
||||||
|
|
||||||
@ -340,39 +342,47 @@ Namespace Winline
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function FindMatchingMandatorFromOrder(pData As Schemas.Orders.Input.MESOWebService) As Mandator
|
Public Function FindMatchingMandatorFromOrder(pData As Documents.Document) As Mandator
|
||||||
Dim oPositions As List(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items.
|
Dim oPositions = pData.Rows.
|
||||||
Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026).
|
Where(Function(r) r.Name.ToUpper.EndsWith("T026")).
|
||||||
Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i).
|
|
||||||
ToList()
|
ToList()
|
||||||
|
Dim oEANNumbers = oPositions.
|
||||||
|
Select(Function(p) p.Fields.Item("Artikelnummer").Original).
|
||||||
|
Distinct().
|
||||||
|
ToList()
|
||||||
|
|
||||||
|
'Dim oPositions As List(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items.
|
||||||
|
' Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026).
|
||||||
|
' Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i).
|
||||||
|
' ToList()
|
||||||
Dim oYear = GetWinLineYear()
|
Dim oYear = GetWinLineYear()
|
||||||
Dim oMandatorId As String = String.Empty
|
Dim oMandatorId As String = String.Empty
|
||||||
Dim oWhitelistedMandators = Mandators.
|
Dim oWhitelistedMandators = Mandators.
|
||||||
Where(Function(m) m.IsWhitelisted = True).
|
Where(Function(m) m.IsWhitelisted = True).
|
||||||
ToList()
|
ToList()
|
||||||
|
|
||||||
For Each oPos In oPositions
|
For Each oEANNumber In oEANNumbers
|
||||||
For Each oMandator In oWhitelistedMandators
|
For Each oMandator In oWhitelistedMandators
|
||||||
Dim oSQL As String = $"
|
Dim oSQL As String = $"
|
||||||
SELECT
|
SELECT
|
||||||
[c011], -- Artikelnummer
|
[c011], -- Artikelnummer
|
||||||
[c003], -- Artikelbezeichnung
|
[c003], -- Artikelbezeichnung
|
||||||
[c075], -- EAN-Nummer
|
[c075], -- EAN-Nummer
|
||||||
[c123] -- Ersatzartikelnummer
|
[c123] -- Ersatzartikelnummer
|
||||||
FROM [{oMandator.Database}].[dbo].[v021]
|
FROM [{oMandator.Database}].[dbo].[v021]
|
||||||
WHERE [c075] = '{oPos.Artikelnummer}'
|
WHERE [c075] = '{oEANNumber}'
|
||||||
AND [mesocomp] = '{oMandator.Id}' AND [mesoyear] = {oYear}"
|
AND [mesocomp] = '{oMandator.Id}' AND [mesoyear] = {oYear}"
|
||||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||||
|
|
||||||
' EAN not found in this Mandator, continue to next one
|
' EAN not found in this Mandator, continue to next one
|
||||||
If oTable.Rows.Count = 0 Then
|
If oTable.Rows.Count = 0 Then
|
||||||
Logger.Debug("EAN [{0}] was not found in Mandator: [{1}]", oPos.Artikelnummer, oMandator.Id)
|
Logger.Debug("EAN [{0}] was not found in Mandator: [{1}]", oEANNumber, oMandator.Id)
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Duplicate EAN, exit and do nothing about this manda
|
' Duplicate EAN, exit and do nothing about this manda
|
||||||
If oTable.Rows.Count > 1 Then
|
If oTable.Rows.Count > 1 Then
|
||||||
Logger.Warn("EAN [{0}] was found more than once. Skipping Mandator [{1}]", oPos.Artikelnummer, oMandator.Id)
|
Logger.Warn("EAN [{0}] was found more than once. Skipping Mandator [{1}]", oEANNumber, oMandator.Id)
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -413,23 +423,107 @@ Namespace Winline
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Sub GetXmlConfiguration()
|
'Public Function FindMatchingMandatorFromOrder(pData As Schemas.Orders.Input.MESOWebService) As Mandator
|
||||||
|
' Dim oPositions As List(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026) = pData.Items.
|
||||||
|
' Where(Function(i) TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026).
|
||||||
|
' Select(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(Function(i) i).
|
||||||
|
' ToList()
|
||||||
|
' Dim oYear = GetWinLineYear()
|
||||||
|
' Dim oMandatorId As String = String.Empty
|
||||||
|
' Dim oWhitelistedMandators = Mandators.
|
||||||
|
' Where(Function(m) m.IsWhitelisted = True).
|
||||||
|
' ToList()
|
||||||
|
|
||||||
|
' For Each oPos In oPositions
|
||||||
|
' For Each oMandator In oWhitelistedMandators
|
||||||
|
' Dim oSQL As String = $"
|
||||||
|
' SELECT
|
||||||
|
' [c011], -- Artikelnummer
|
||||||
|
' [c003], -- Artikelbezeichnung
|
||||||
|
' [c075], -- EAN-Nummer
|
||||||
|
' [c123] -- Ersatzartikelnummer
|
||||||
|
' FROM [{oMandator.Database}].[dbo].[v021]
|
||||||
|
' WHERE [c075] = '{oPos.Artikelnummer}'
|
||||||
|
' AND [mesocomp] = '{oMandator.Id}' AND [mesoyear] = {oYear}"
|
||||||
|
' Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||||
|
|
||||||
|
' ' EAN not found in this Mandator, continue to next one
|
||||||
|
' If oTable.Rows.Count = 0 Then
|
||||||
|
' Logger.Debug("EAN [{0}] was not found in Mandator: [{1}]", oPos.Artikelnummer, oMandator.Id)
|
||||||
|
' Continue For
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' ' Duplicate EAN, exit and do nothing about this manda
|
||||||
|
' If oTable.Rows.Count > 1 Then
|
||||||
|
' Logger.Warn("EAN [{0}] was found more than once. Skipping Mandator [{1}]", oPos.Artikelnummer, oMandator.Id)
|
||||||
|
' Exit For
|
||||||
|
' End If
|
||||||
|
|
||||||
|
' Dim oRow As DataRow = oTable.Rows.Item(0)
|
||||||
|
' Dim oArticleNumber As String = Utils.NotNull(oRow.Item(V21_ARTICLENUMBER), String.Empty)
|
||||||
|
|
||||||
|
' ' EAN was found, now we need to check it against the Regex of the current Mandantor, if one exists
|
||||||
|
' If oMandator.Regex <> String.Empty Then
|
||||||
|
' Try
|
||||||
|
' Dim oRegex As New Regex(oMandator.Regex)
|
||||||
|
' Dim oMatch = oRegex.Match(oArticleNumber)
|
||||||
|
|
||||||
|
' ' If ArticleNumber matches the regex, we assign it and exit
|
||||||
|
' If oMatch.Success Then
|
||||||
|
' oMandatorId = oMandator.Id
|
||||||
|
' Exit For
|
||||||
|
' Else
|
||||||
|
' ' If it does not match, continue to the next mandator
|
||||||
|
' End If
|
||||||
|
' Catch ex As Exception
|
||||||
|
' Logger.Error(ex)
|
||||||
|
' Logger.Warn("Regex [{0}] could not be parsed. Skipping.", oMandator.Regex)
|
||||||
|
' End Try
|
||||||
|
' Else
|
||||||
|
' ' If no regex was found, we assume the number matches
|
||||||
|
' oMandatorId = oMandator.Id
|
||||||
|
' End If
|
||||||
|
' Next
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' If oMandatorId = String.Empty Then
|
||||||
|
' Return Nothing
|
||||||
|
' Else
|
||||||
|
' Return oWhitelistedMandators.
|
||||||
|
' Where(Function(m) m.Id = oMandatorId).
|
||||||
|
' Take(1).
|
||||||
|
' SingleOrDefault()
|
||||||
|
' End If
|
||||||
|
'End Function
|
||||||
|
|
||||||
|
Public Function LoadTemplateConfiguration() As Boolean
|
||||||
Try
|
Try
|
||||||
Dim oSql = $"SELECT XML_NAME, XML_ROOT, DATA_TYPE, IS_HEAD FROM [DD_ECM].[dbo].[VWEDI_XML_ITEMS]"
|
Dim oSql = $"SELECT XML_NAME, XML_ROOT, TEMPLATE_NAME, DATA_TYPE, IS_HEAD, FUNCTION_ID, READ_ONLY FROM [DD_ECM].[dbo].[VWEDI_XML_ITEMS]"
|
||||||
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
Dim oTable As DataTable = Database.GetDatatable(oSql)
|
||||||
|
Dim oItems As New List(Of TemplateColumn)
|
||||||
|
|
||||||
For Each oRow As DataRow In oTable.Rows
|
For Each oRow As DataRow In oTable.Rows
|
||||||
Dim oXmlItem As New XmlItem With {
|
Dim oColumn As New TemplateColumn With {
|
||||||
.Name = oRow.Item("XML_NAME"),
|
.Name = oRow.Item("XML_NAME"),
|
||||||
.Root = oRow.Item("XML_ROOT"),
|
.Root = oRow.Item("XML_ROOT"),
|
||||||
.Type = oRow.Item("XML_TYPE")
|
.Type = oRow.Item("XML_TYPE"),
|
||||||
|
.Template = oRow.Item("TEMPLATE_NAME"),
|
||||||
|
.[Function] = oRow.Item("FUNCTION_ID"),
|
||||||
|
.[ReadOnly] = oRow.Item("READ_ONLY")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oItems.Add(oColumn)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
TemplateConfiguration = oItems
|
||||||
|
Return True
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Return False
|
||||||
|
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Turns a database info like "SQLCWLDATEN on SERVER\INSTANCE" into a Tuple of two strings
|
''' Turns a database info like "SQLCWLDATEN on SERVER\INSTANCE" into a Tuple of two strings
|
||||||
|
|||||||
12
ImporterShared/Winline/Entities/TemplateColumn.vb
Normal file
12
ImporterShared/Winline/Entities/TemplateColumn.vb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Namespace Winline
|
||||||
|
Public Class TemplateColumn
|
||||||
|
Public Name As String
|
||||||
|
Public Root As String
|
||||||
|
Public Type As String
|
||||||
|
Public IsHead As Boolean
|
||||||
|
Public Template As String
|
||||||
|
Public [ReadOnly] As Boolean
|
||||||
|
Public [Function] As Constants.XmlFunction
|
||||||
|
End Class
|
||||||
|
|
||||||
|
End Namespace
|
||||||
@ -1,9 +0,0 @@
|
|||||||
Namespace Winline
|
|
||||||
Public Class XmlItem
|
|
||||||
Public Name As String
|
|
||||||
Public Root As String
|
|
||||||
Public Type As String
|
|
||||||
Public IsHead As Boolean
|
|
||||||
End Class
|
|
||||||
|
|
||||||
End Namespace
|
|
||||||
Loading…
x
Reference in New Issue
Block a user