Compare commits
208 Commits
8dfc659ef8
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e3b08038a | ||
|
|
7c683cf13e | ||
|
|
6eedcc687f | ||
|
|
62708c02ef | ||
|
|
4a6a8ded7c | ||
|
|
25e9713c2c | ||
|
|
a0e5b4aa0b | ||
|
|
dc4955db17 | ||
|
|
34c8ecbee5 | ||
|
|
c1fa500f36 | ||
|
|
f67368c1d9 | ||
|
|
a5ae2118b3 | ||
|
|
0fe344eefb | ||
|
|
a68697a9e2 | ||
|
|
7cd4aa80cd | ||
|
|
47e7de3c69 | ||
|
|
77e760f9b4 | ||
|
|
7b3a36336a | ||
|
|
68e4c59e63 | ||
|
|
7846e660b9 | ||
|
|
dddb1dc53a | ||
|
|
47407ac79a | ||
|
|
22bb9b14a1 | ||
|
|
90029ab0f2 | ||
|
|
0eb8eaad2d | ||
|
|
9094f8abe8 | ||
|
|
7c0ccb7184 | ||
|
|
2da202a2a7 | ||
|
|
16ace2c242 | ||
|
|
8a1bb6911f | ||
|
|
a63bf73ca6 | ||
|
|
6325fd7e68 | ||
|
|
371305fb41 | ||
|
|
608b077671 | ||
|
|
34bc0004d2 | ||
|
|
7363a8036e | ||
|
|
73bc1517f3 | ||
|
|
dc14c80d59 | ||
|
|
916e12cae7 | ||
|
|
05dab8d045 | ||
|
|
f0a340f742 | ||
|
|
a0217d0582 | ||
|
|
fe4038f1c8 | ||
|
|
10565fb1da | ||
|
|
42b1ca72a6 | ||
|
|
616e35f885 | ||
|
|
adad5501f3 | ||
|
|
b3140c48c5 | ||
|
|
a8ca303f5e | ||
|
|
5f335b4fee | ||
|
|
beb0ee8ae5 | ||
|
|
143823aae2 | ||
|
|
b460618548 | ||
|
|
0258560221 | ||
|
|
dc657c32a5 | ||
|
|
e168c65ca9 | ||
|
|
bc8289e1b7 | ||
|
|
cd1cdfe19a | ||
|
|
ddaacfe75c | ||
|
|
a5c2b93bfe | ||
|
|
5dc851be7d | ||
|
|
e4345f3b76 | ||
|
|
46d3dfbd47 | ||
|
|
f540c1dc17 | ||
|
|
63527561ea | ||
|
|
2894d398d0 | ||
|
|
8743f0c4b1 | ||
|
|
8e02ed7159 | ||
|
|
5accfbe002 | ||
|
|
5fe4079028 | ||
|
|
623e1717d6 | ||
|
|
fa4ac39074 | ||
|
|
371c8e27cc | ||
|
|
c33770dd9e | ||
|
|
3e41502766 | ||
|
|
13af72dee5 | ||
|
|
69f4c640a8 | ||
|
|
5ee739dae8 | ||
|
|
866e31f37a | ||
|
|
88f844d516 | ||
|
|
edcdf770b7 | ||
|
|
14ac6875c5 | ||
|
|
c74b91713d | ||
|
|
8dba67d3e1 | ||
|
|
ad671443b9 | ||
|
|
3623138fd1 | ||
|
|
85318a3e81 | ||
|
|
31e0835914 | ||
|
|
095838490f | ||
|
|
1c3d5dd543 | ||
|
|
17d5f5ca1b | ||
|
|
f87b1018de | ||
|
|
1bef72d65c | ||
|
|
9be55f3709 | ||
|
|
51912b36c2 | ||
|
|
623f75d0e5 | ||
|
|
aedfa5f0d8 | ||
|
|
aff92e2b34 | ||
|
|
648666ef8c | ||
|
|
8180c65ccd | ||
|
|
b6801ab486 | ||
|
|
8b6821adde | ||
|
|
54ba722ecb | ||
|
|
122aec02dd | ||
|
|
15cb38d709 | ||
|
|
37cfa4a568 | ||
|
|
1d6d2d2f2c | ||
|
|
374eb57268 | ||
|
|
9df22e098a | ||
|
|
5b057eeb66 | ||
|
|
6d7c314381 | ||
|
|
147f72b8a3 | ||
|
|
f289a1d34c | ||
|
|
ce78dea8cb | ||
|
|
efd2aeb775 | ||
|
|
b941416de4 | ||
|
|
6526eb29b1 | ||
|
|
7ae712208b | ||
|
|
3ab39d7486 | ||
|
|
7eaddab5f1 | ||
|
|
4db6f5f28b | ||
|
|
20a339f50a | ||
|
|
0f244262f0 | ||
|
|
13b66bc6b9 | ||
|
|
5dc8d9f50b | ||
|
|
5c30528a83 | ||
|
|
4c1a3a9220 | ||
|
|
e3c2e100bb | ||
|
|
74a039862f | ||
|
|
f60c299f3c | ||
|
|
80e40fbc23 | ||
|
|
18cc418fba | ||
|
|
c1cce9101b | ||
|
|
c11cba9cf3 | ||
|
|
7f817ffce1 | ||
|
|
f80ea96f8a | ||
|
|
213bcef732 | ||
|
|
2e7b0bef8a | ||
|
|
1aec033282 | ||
|
|
96c90c570e | ||
|
|
8ee955f6f2 | ||
|
|
2e03e1b1f3 | ||
|
|
9b3436686f | ||
|
|
f224c73a2e | ||
|
|
5a8440ff05 | ||
|
|
6d6dd725d9 | ||
|
|
ad8ea75db4 | ||
|
|
85fab072bb | ||
|
|
82bd76d669 | ||
|
|
706edf8026 | ||
|
|
c315640d7d | ||
|
|
ff7c8c63ea | ||
|
|
4859406fe3 | ||
|
|
79cfec3173 | ||
|
|
9a3761acc0 | ||
|
|
3b0474e713 | ||
|
|
51c053769e | ||
|
|
52ac886c1f | ||
|
|
8ab2842594 | ||
|
|
436293cbb7 | ||
|
|
ad7e6a9c84 | ||
|
|
97f9b8ca59 | ||
|
|
2a1a119ff2 | ||
|
|
cdff23b646 | ||
|
|
ac50cf661b | ||
|
|
dec45ef493 | ||
|
|
cc81a77f05 | ||
|
|
ee23cdd7e8 | ||
|
|
673a507d04 | ||
|
|
c1b6e2ed4d | ||
|
|
0356699473 | ||
|
|
15b553efc3 | ||
|
|
3760453d82 | ||
|
|
3b07002c28 | ||
|
|
6693ac770e | ||
|
|
1366343cdf | ||
|
|
47c22e9361 | ||
|
|
964f2ee60c | ||
|
|
510a08c1ed | ||
|
|
e764c310ea | ||
|
|
29960916a0 | ||
|
|
cc49d821f3 | ||
|
|
6bed0b3024 | ||
|
|
8dcd06154d | ||
|
|
e732ce7099 | ||
|
|
1d74f2909f | ||
|
|
85c8b07b68 | ||
|
|
19e2b2f62b | ||
|
|
437569919f | ||
|
|
c6622ccbbc | ||
|
|
8692dc595e | ||
|
|
63d61c0e22 | ||
|
|
a0bf297dfd | ||
|
|
98c858e79d | ||
|
|
00165025f6 | ||
|
|
f71b53b5c3 | ||
|
|
0562d9c37d | ||
|
|
b157fc0c2b | ||
|
|
c3adecf210 | ||
|
|
4461d03b8d | ||
|
|
61286f16ef | ||
|
|
880a345e06 | ||
|
|
1035a0fb1f | ||
|
|
f00e332737 | ||
|
|
0d9f84cc24 | ||
|
|
0b83ddcc4d | ||
|
|
3fac097f46 | ||
|
|
a519b93f47 |
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -1,159 +0,0 @@
|
||||
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')
|
||||
|
||||
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]
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
Public Class Exceptions
|
||||
Public MustInherit Class DocumentShowException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class WebServiceException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class NoMandatorException
|
||||
Inherits DocumentShowException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class MultipleAccountsException
|
||||
Inherits DocumentShowException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class NoAccountException
|
||||
Inherits DocumentShowException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
End Class
|
||||
@@ -1,83 +0,0 @@
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports ImporterShared
|
||||
|
||||
Public Class GridLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
End Sub
|
||||
|
||||
Public Function GetGridFromElement(pTable As Schemas.Schema.Table) As GridControl
|
||||
Dim oGrid As New GridControl With {
|
||||
.Dock = DockStyle.Fill,
|
||||
.Name = pTable.Name
|
||||
}
|
||||
|
||||
Dim oInvisibleColumns As New List(Of String) From {
|
||||
"Zeilennummer",
|
||||
"BELEGKEY",
|
||||
"Infotext"
|
||||
}
|
||||
|
||||
oGrid.ForceInitialize()
|
||||
oGrid.MainView.PopulateColumns()
|
||||
|
||||
Dim oView As GridView = oGrid.DefaultView
|
||||
oView.OptionsBehavior.ReadOnly = True
|
||||
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 = oVisibleIndex
|
||||
}
|
||||
|
||||
oView.Columns.Add(oColumn)
|
||||
|
||||
Next
|
||||
|
||||
oView.BestFitColumns()
|
||||
|
||||
Dim oGridBuilder As New GridBuilder(oView)
|
||||
oGridBuilder.
|
||||
WithDefaults().
|
||||
WithReadOnlyOptions().
|
||||
WithClipboardHandler()
|
||||
|
||||
Return oGrid
|
||||
End Function
|
||||
|
||||
Private Function GetColumnType(pColumn As Schemas.Schema.Column)
|
||||
Select Case pColumn.DataType
|
||||
Case Schemas.Schema.ColumnType.Boolean
|
||||
Return DevExpress.Data.UnboundColumnType.Boolean
|
||||
|
||||
Case Schemas.Schema.ColumnType.Date
|
||||
Return DevExpress.Data.UnboundColumnType.DateTime
|
||||
|
||||
Case Schemas.Schema.ColumnType.Integer
|
||||
Return DevExpress.Data.UnboundColumnType.Integer
|
||||
|
||||
Case Schemas.Schema.ColumnType.Decimal
|
||||
Return DevExpress.Data.UnboundColumnType.Decimal
|
||||
|
||||
Case Else
|
||||
Return DevExpress.Data.UnboundColumnType.String
|
||||
End Select
|
||||
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,299 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7AAEC958-955D-4F77-964C-38658684E424}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<StartupObject>ImporterForm.My.MyApplication</StartupObject>
|
||||
<RootNamespace>ImporterForm</RootNamespace>
|
||||
<AssemblyName>ImporterForm</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>ImporterForm.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>ImporterForm.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper, Version=10.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Charts.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.DataAccess.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Images.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Office.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Pdf.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.PivotGrid.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Printing.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.RichEdit.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.RichEdit.v19.2.Export, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Sparkline.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Utils.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.Utils.v19.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Utils.v19.2.UI, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.Xpo.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraBars.v19.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraCharts.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraEditors.v19.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraGauges.v19.2.Core, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraGrid.v19.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>D:\ProgramFiles\DevExpress 19.2\Components\Bin\Framework\DevExpress.XtraLayout.v19.2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.XtraPrinting.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraReports.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.XtraTreeList.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.XtraVerticalGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Controls.SQLConfig">
|
||||
<HintPath>..\..\DDMonorepo\SQLConfig\bin\Debug\DigitalData.Controls.SQLConfig.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.GUIs.Common">
|
||||
<HintPath>..\..\DDMonorepo\GUIs.Common\bin\Debug\DigitalData.GUIs.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Config">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Database">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Filesystem, Version=1.0.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Language, Version=1.3.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Release\DigitalData.Modules.Language.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Logging">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Release\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Exceptions.vb" />
|
||||
<Compile Include="frmImportMain.Designer.vb">
|
||||
<DependentUpon>frmImportMain.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmImportMain.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmImportMain_old.Designer.vb">
|
||||
<DependentUpon>frmImportMain_old.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmImportMain_old.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.Designer.vb">
|
||||
<DependentUpon>frmMain.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMain.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmMandatorSelection.Designer.vb">
|
||||
<DependentUpon>frmMandatorSelection.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmMandatorSelection.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmRowEditor.Designer.vb">
|
||||
<DependentUpon>frmRowEditor.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmRowEditor.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GridLoader.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Positions\Position.vb" />
|
||||
<Compile Include="Positions\PositionColumns.vb" />
|
||||
<Compile Include="Positions\PositionData.vb" />
|
||||
<Compile Include="Positions\PositionGrid.vb" />
|
||||
<Compile Include="Reports\OrderReport.Designer.vb">
|
||||
<DependentUpon>OrderReport.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Reports\OrderReport.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmWaitForm.Designer.vb">
|
||||
<DependentUpon>frmWaitForm.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmWaitForm.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="frmImportMain.resx">
|
||||
<DependentUpon>frmImportMain.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmImportMain_old.resx">
|
||||
<DependentUpon>frmImportMain_old.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMain.resx">
|
||||
<DependentUpon>frmMain.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmMandatorSelection.resx">
|
||||
<DependentUpon>frmMandatorSelection.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmRowEditor.resx">
|
||||
<DependentUpon>frmRowEditor.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\licenses.licx" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Reports\OrderReport.resx">
|
||||
<DependentUpon>OrderReport.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmWaitForm.resx">
|
||||
<DependentUpon>frmWaitForm.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<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" />
|
||||
<None Include="Resources\open21.svg" />
|
||||
<None Include="Resources\paymentrefund.svg" />
|
||||
<None Include="Resources\open2.svg" />
|
||||
<None Include="Resources\open.svg" />
|
||||
<None Include="Resources\pagesetup.svg" />
|
||||
<None Include="Resources\showallfieldcodes.svg" />
|
||||
<None Include="Resources\bo_validation.svg" />
|
||||
<None Include="Resources\itemtypechecked.svg" />
|
||||
<None Include="Resources\deletetablerows.svg" />
|
||||
<None Include="Resources\tableproperties.svg" />
|
||||
<None Include="Resources\tilelabels.svg" />
|
||||
<None Include="Resources\wraptext.svg" />
|
||||
<None Include="Resources\singlepageview.svg" />
|
||||
<None Include="Resources\preview.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\import.svg" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ImporterShared\ImporterShared.vbproj">
|
||||
<Project>{dd1ac3b9-7595-4d3c-b9bb-97c46a480fa0}</Project>
|
||||
<Name>ImporterShared</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
303
EDIDocumentImport/My Project/Resources.Designer.vb
generated
303
EDIDocumentImport/My Project/Resources.Designer.vb
generated
@@ -1,303 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ImporterForm.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
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>
|
||||
''' 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>
|
||||
Friend ReadOnly Property bo_validation() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("bo_validation", 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 deletetablerows() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("deletetablerows", 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 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>
|
||||
Friend ReadOnly Property import() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("import", 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 itemtypechecked() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("itemtypechecked", 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 open() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("open", 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 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>
|
||||
Friend ReadOnly Property open2() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("open2", 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 open21() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("open21", 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 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>
|
||||
Friend ReadOnly Property pagesetup() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("pagesetup", 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 paymentrefund() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("paymentrefund", 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 preview() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("preview", 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 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 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>
|
||||
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>
|
||||
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property showallfieldcodes() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("showallfieldcodes", 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 singlepageview() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("singlepageview", 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 tableproperties() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("tableproperties", 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 tilelabels() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("tilelabels", 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 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>
|
||||
Friend ReadOnly Property wraptext() As DevExpress.Utils.Svg.SvgImage
|
||||
Get
|
||||
Dim obj As Object = ResourceManager.GetObject("wraptext", resourceCulture)
|
||||
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,16 +0,0 @@
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignDockManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v20.1, Version=20.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraRichEdit.RichEditControl, DevExpress.XtraRichEdit.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UI.XtraReport, DevExpress.XtraReports.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraReports.UserDesigner.XRDesignBarManager, DevExpress.XtraReports.v19.2.Extensions, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||
@@ -1,16 +0,0 @@
|
||||
Namespace Positions
|
||||
Public Class Position
|
||||
Public Property RowNumber As Integer
|
||||
Public Property EuropeanArticleNumber As String
|
||||
Public Property ArticleNumber As String
|
||||
Public Property ArticleNumberVendor As String
|
||||
Public Property ArticleDescription As String
|
||||
Public Property EDIPrice As Double
|
||||
Public Property WinLinePrice As Double
|
||||
Public Property Price As Double
|
||||
Public Property Amount As Double
|
||||
Public Property ReplacementArticleNumber As String
|
||||
Public Property UseReplacementNumber As Boolean = False
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,76 +0,0 @@
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
|
||||
Namespace Positions
|
||||
Public Class PositionColumns
|
||||
Public Shared Property ColumnRowNumber As New GridColumn With {
|
||||
.FieldName = "RowNumber",
|
||||
.Caption = "Nr.",
|
||||
.VisibleIndex = 0,
|
||||
.MaxWidth = 30
|
||||
}
|
||||
Public Shared Property ColumnArticleNumber As New GridColumn With {
|
||||
.FieldName = "ArticleNumber",
|
||||
.Caption = "Artikelnummer",
|
||||
.VisibleIndex = 1
|
||||
}
|
||||
Public Shared Property ColumnEuropeanArticleNumber As New GridColumn With {
|
||||
.FieldName = "EuropeanArticleNumber",
|
||||
.Caption = "EAN",
|
||||
.VisibleIndex = 2
|
||||
}
|
||||
Public Shared Property ColumnReplacementArticleNumber As New GridColumn With {
|
||||
.FieldName = "ReplacementArticleNumber",
|
||||
.Caption = "Ersatzartikel",
|
||||
.VisibleIndex = 3
|
||||
}
|
||||
Public Shared Property ColumnArticleNumberVendor As New GridColumn With {
|
||||
.FieldName = "ArticleNumberVendor",
|
||||
.Caption = "Artikel Lieferant",
|
||||
.VisibleIndex = 4
|
||||
}
|
||||
Public Shared Property ColumnArticleDescription As New GridColumn With {
|
||||
.FieldName = "ArticleDescription",
|
||||
.Caption = "Artikel Beschreibung",
|
||||
.VisibleIndex = 5
|
||||
}
|
||||
Public Shared Property ColumnAmount As New GridColumn With {
|
||||
.FieldName = "Amount",
|
||||
.Caption = "Menge",
|
||||
.VisibleIndex = 6
|
||||
}
|
||||
Public Shared Property ColumnEDIPrice As New GridColumn With {
|
||||
.FieldName = "EDIPrice",
|
||||
.Caption = "Einzelpreis EDI",
|
||||
.VisibleIndex = 7
|
||||
}
|
||||
Public Shared Property ColumnWinLinePrice As New GridColumn With {
|
||||
.FieldName = "WinLinePrice",
|
||||
.Caption = "Einzelpreis WinLine",
|
||||
.VisibleIndex = 8
|
||||
}
|
||||
Public Shared Property ColumnPrice As New GridColumn With {
|
||||
.FieldName = "Price",
|
||||
.Caption = "Einzelpreis",
|
||||
.VisibleIndex = 9
|
||||
}
|
||||
|
||||
''' <summary>
|
||||
''' Columns that can be changed in the positions grid
|
||||
''' </summary>
|
||||
Public Shared Property WritableColumns As New List(Of GridColumn) From {
|
||||
ColumnPrice
|
||||
}
|
||||
|
||||
Public Shared Property AllColumns As New List(Of GridColumn) From {
|
||||
ColumnRowNumber,
|
||||
ColumnArticleNumber,
|
||||
ColumnReplacementArticleNumber,
|
||||
ColumnArticleNumberVendor,
|
||||
ColumnEuropeanArticleNumber,
|
||||
ColumnArticleDescription,
|
||||
ColumnEDIPrice,
|
||||
ColumnWinLinePrice,
|
||||
ColumnPrice
|
||||
}
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,49 +0,0 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports ImporterForm.Positions
|
||||
Imports ImporterShared.Winline
|
||||
Imports ImporterShared.Schemas
|
||||
|
||||
Public Class PositionData
|
||||
Inherits ImporterShared.BaseClass
|
||||
|
||||
Private Winline As Data
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pWinline As Data)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
Winline = pWinline
|
||||
End Sub
|
||||
|
||||
'Public Function Load(pMandator As Mandator, pData As Orders.Input.MESOWebService, pDataOriginal As Orders.Input.MESOWebService) As List(Of Position)
|
||||
' Dim oPositions = Orders.Helpers.GetOrderPositions(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(pData)
|
||||
' Dim oPositionsOriginal = Orders.Helpers.GetOrderPositions(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026)(pDataOriginal)
|
||||
' Dim oPositionList As New List(Of Position)
|
||||
|
||||
' For Each oPosition In oPositions
|
||||
' Dim oPositionOriginal = oPositionsOriginal.
|
||||
' Where(Function(p) p.Zeilennummer = oPosition.Zeilennummer).
|
||||
' SingleOrDefault()
|
||||
|
||||
' Dim oReplacementNumber As String = Winline.GetReplacementArticleNumber(oPosition.Artikelnummer, pMandator)
|
||||
|
||||
' ' If ArticleNumber is the same as the replacement Number, this Article does not have a replacement Number
|
||||
' If oReplacementNumber = oPosition.Artikelnummer Then
|
||||
' oReplacementNumber = Nothing
|
||||
' End If
|
||||
|
||||
' oPositionList.Add(New Position With {
|
||||
' .ArticleNumber = oPosition.Artikelnummer,
|
||||
' .RowNumber = oPosition.Zeilennummer,
|
||||
' .ArticleDescription = oPosition.Bezeichnung,
|
||||
' .ArticleNumberVendor = oPosition.Lieferantenartikelnummer,
|
||||
' .EDIPrice = oPosition.Einzelpreis,
|
||||
' .WinLinePrice = 0,
|
||||
' .Price = 0,
|
||||
' .Amount = oPosition.Menge_bestellt,
|
||||
' .EuropeanArticleNumber = oPositionOriginal.Artikelnummer,
|
||||
' .ReplacementArticleNumber = oReplacementNumber
|
||||
' })
|
||||
' Next
|
||||
|
||||
' Return oPositionList
|
||||
'End Function
|
||||
End Class
|
||||
@@ -1,44 +0,0 @@
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports ImporterShared.Documents
|
||||
Imports ImporterForm.Positions
|
||||
|
||||
Namespace Positions
|
||||
Public Class PositionGrid
|
||||
Public Shared Sub LoadPositionViewAndColumns(pView As GridView, pDocumentType As DocumentType)
|
||||
Dim oColumns As List(Of GridColumn)
|
||||
|
||||
' Create columns list depending on DocumentType
|
||||
Select Case pDocumentType
|
||||
Case DocumentType.Order
|
||||
oColumns = PositionColumns.AllColumns
|
||||
|
||||
Case Else
|
||||
oColumns = New List(Of GridColumn)
|
||||
End Select
|
||||
|
||||
' Reset the grid
|
||||
pView.GridControl.DataSource = Nothing
|
||||
pView.GridControl.ForceInitialize()
|
||||
|
||||
' Add and adjust columns
|
||||
pView.Columns.AddRange(oColumns.ToArray())
|
||||
pView.BestFitColumns()
|
||||
|
||||
' Set columns readonly that need it
|
||||
Dim oReadOnlyColumns = oColumns.
|
||||
Except(PositionColumns.WritableColumns).
|
||||
ToList()
|
||||
|
||||
For Each oColumn As GridColumn In pView.Columns
|
||||
If oReadOnlyColumns.Contains(oColumn) Then
|
||||
oColumn.OptionsColumn.ReadOnly = True
|
||||
oColumn.OptionsColumn.AllowEdit = False
|
||||
Else
|
||||
oColumn.Caption &= " *"
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
# README
|
||||
|
||||
## Generieren von Classentypen aus einem Schema
|
||||
|
||||
```
|
||||
.\xsd.exe /c /l:VB OrdersSchema.xsd
|
||||
```
|
||||
587
EDIDocumentImport/Reports/OrderReport.Designer.vb
generated
587
EDIDocumentImport/Reports/OrderReport.Designer.vb
generated
@@ -1,587 +0,0 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Public Class OrderReport
|
||||
Inherits DevExpress.XtraReports.UI.XtraReport
|
||||
|
||||
'XtraReport overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Designer
|
||||
'It can be modified using the Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.Title = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.GroupCaption1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.GroupData1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailCaption1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailData1 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailCaption2 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailData2 = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.DetailData3_Odd = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.PageInfo = New DevExpress.XtraReports.UI.XRControlStyle()
|
||||
Me.TopMargin = New DevExpress.XtraReports.UI.TopMarginBand()
|
||||
Me.BottomMargin = New DevExpress.XtraReports.UI.BottomMarginBand()
|
||||
Me.pageInfo1 = New DevExpress.XtraReports.UI.XRPageInfo()
|
||||
Me.pageInfo2 = New DevExpress.XtraReports.UI.XRPageInfo()
|
||||
Me.ReportHeader = New DevExpress.XtraReports.UI.ReportHeaderBand()
|
||||
Me.Detail = New DevExpress.XtraReports.UI.DetailBand()
|
||||
Me.table3 = New DevExpress.XtraReports.UI.XRTable()
|
||||
Me.tableRow4 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||
Me.tableCell44 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell46 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell47 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell49 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell50 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell52 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell53 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell54 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.table4 = New DevExpress.XtraReports.UI.XRTable()
|
||||
Me.tableRow5 = New DevExpress.XtraReports.UI.XRTableRow()
|
||||
Me.tableCell65 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell67 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell68 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell70 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell71 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell73 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell74 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.tableCell75 = New DevExpress.XtraReports.UI.XRTableCell()
|
||||
Me.XrLabel1 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.Detail1 = New DevExpress.XtraReports.UI.DetailBand()
|
||||
Me.DetailReport = New DevExpress.XtraReports.UI.DetailReportBand()
|
||||
Me.XrLabel2 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel3 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel4 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel5 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel6 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel7 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel8 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel9 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel10 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.XrLabel11 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
Me.ObjectDataSource1 = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource(Me.components)
|
||||
Me.XrLabel12 = New DevExpress.XtraReports.UI.XRLabel()
|
||||
CType(Me.table3, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.table4, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.ObjectDataSource1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
'
|
||||
'Title
|
||||
'
|
||||
Me.Title.BackColor = System.Drawing.Color.Transparent
|
||||
Me.Title.BorderColor = System.Drawing.Color.Black
|
||||
Me.Title.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||
Me.Title.BorderWidth = 1.0!
|
||||
Me.Title.Font = New System.Drawing.Font("Arial", 14.25!)
|
||||
Me.Title.ForeColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(70, Byte), Integer), CType(CType(80, Byte), Integer))
|
||||
Me.Title.Name = "Title"
|
||||
'
|
||||
'GroupCaption1
|
||||
'
|
||||
Me.GroupCaption1.BackColor = System.Drawing.Color.FromArgb(CType(CType(23, Byte), Integer), CType(CType(104, Byte), Integer), CType(CType(196, Byte), Integer))
|
||||
Me.GroupCaption1.BorderColor = System.Drawing.Color.White
|
||||
Me.GroupCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||
Me.GroupCaption1.BorderWidth = 2.0!
|
||||
Me.GroupCaption1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||
Me.GroupCaption1.ForeColor = System.Drawing.Color.FromArgb(CType(CType(228, Byte), Integer), CType(CType(228, Byte), Integer), CType(CType(228, Byte), Integer))
|
||||
Me.GroupCaption1.Name = "GroupCaption1"
|
||||
Me.GroupCaption1.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100.0!)
|
||||
Me.GroupCaption1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'GroupData1
|
||||
'
|
||||
Me.GroupData1.BackColor = System.Drawing.Color.FromArgb(CType(CType(23, Byte), Integer), CType(CType(104, Byte), Integer), CType(CType(196, Byte), Integer))
|
||||
Me.GroupData1.BorderColor = System.Drawing.Color.White
|
||||
Me.GroupData1.Borders = DevExpress.XtraPrinting.BorderSide.Bottom
|
||||
Me.GroupData1.BorderWidth = 2.0!
|
||||
Me.GroupData1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||
Me.GroupData1.ForeColor = System.Drawing.Color.White
|
||||
Me.GroupData1.Name = "GroupData1"
|
||||
Me.GroupData1.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 2, 0, 0, 100.0!)
|
||||
Me.GroupData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'DetailCaption1
|
||||
'
|
||||
Me.DetailCaption1.BackColor = System.Drawing.Color.FromArgb(CType(CType(23, Byte), Integer), CType(CType(104, Byte), Integer), CType(CType(196, Byte), Integer))
|
||||
Me.DetailCaption1.BorderColor = System.Drawing.Color.White
|
||||
Me.DetailCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||
Me.DetailCaption1.BorderWidth = 2.0!
|
||||
Me.DetailCaption1.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||
Me.DetailCaption1.ForeColor = System.Drawing.Color.White
|
||||
Me.DetailCaption1.Name = "DetailCaption1"
|
||||
Me.DetailCaption1.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100.0!)
|
||||
Me.DetailCaption1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'DetailData1
|
||||
'
|
||||
Me.DetailData1.BorderColor = System.Drawing.Color.Transparent
|
||||
Me.DetailData1.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||
Me.DetailData1.BorderWidth = 2.0!
|
||||
Me.DetailData1.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||
Me.DetailData1.ForeColor = System.Drawing.Color.Black
|
||||
Me.DetailData1.Name = "DetailData1"
|
||||
Me.DetailData1.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100.0!)
|
||||
Me.DetailData1.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'DetailCaption2
|
||||
'
|
||||
Me.DetailCaption2.BackColor = System.Drawing.Color.FromArgb(CType(CType(37, Byte), Integer), CType(CType(129, Byte), Integer), CType(CType(216, Byte), Integer))
|
||||
Me.DetailCaption2.BorderColor = System.Drawing.Color.White
|
||||
Me.DetailCaption2.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||
Me.DetailCaption2.BorderWidth = 2.0!
|
||||
Me.DetailCaption2.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||
Me.DetailCaption2.ForeColor = System.Drawing.Color.White
|
||||
Me.DetailCaption2.Name = "DetailCaption2"
|
||||
Me.DetailCaption2.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100.0!)
|
||||
Me.DetailCaption2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'DetailData2
|
||||
'
|
||||
Me.DetailData2.BorderColor = System.Drawing.Color.Transparent
|
||||
Me.DetailData2.Borders = DevExpress.XtraPrinting.BorderSide.Left
|
||||
Me.DetailData2.BorderWidth = 2.0!
|
||||
Me.DetailData2.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||
Me.DetailData2.ForeColor = System.Drawing.Color.Black
|
||||
Me.DetailData2.Name = "DetailData2"
|
||||
Me.DetailData2.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100.0!)
|
||||
Me.DetailData2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'DetailData3_Odd
|
||||
'
|
||||
Me.DetailData3_Odd.BackColor = System.Drawing.Color.FromArgb(CType(CType(243, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(248, Byte), Integer))
|
||||
Me.DetailData3_Odd.BorderColor = System.Drawing.Color.Transparent
|
||||
Me.DetailData3_Odd.Borders = DevExpress.XtraPrinting.BorderSide.None
|
||||
Me.DetailData3_Odd.BorderWidth = 1.0!
|
||||
Me.DetailData3_Odd.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||
Me.DetailData3_Odd.ForeColor = System.Drawing.Color.Black
|
||||
Me.DetailData3_Odd.Name = "DetailData3_Odd"
|
||||
Me.DetailData3_Odd.Padding = New DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100.0!)
|
||||
Me.DetailData3_Odd.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft
|
||||
'
|
||||
'PageInfo
|
||||
'
|
||||
Me.PageInfo.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold)
|
||||
Me.PageInfo.ForeColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(70, Byte), Integer), CType(CType(80, Byte), Integer))
|
||||
Me.PageInfo.Name = "PageInfo"
|
||||
Me.PageInfo.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
'
|
||||
'TopMargin
|
||||
'
|
||||
Me.TopMargin.HeightF = 25.0!
|
||||
Me.TopMargin.Name = "TopMargin"
|
||||
'
|
||||
'BottomMargin
|
||||
'
|
||||
Me.BottomMargin.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.pageInfo1, Me.pageInfo2})
|
||||
Me.BottomMargin.HeightF = 29.0!
|
||||
Me.BottomMargin.Name = "BottomMargin"
|
||||
'
|
||||
'pageInfo1
|
||||
'
|
||||
Me.pageInfo1.LocationFloat = New DevExpress.Utils.PointFloat(6.0!, 6.0!)
|
||||
Me.pageInfo1.Name = "pageInfo1"
|
||||
Me.pageInfo1.PageInfo = DevExpress.XtraPrinting.PageInfo.DateTime
|
||||
Me.pageInfo1.SizeF = New System.Drawing.SizeF(513.0!, 23.0!)
|
||||
Me.pageInfo1.StyleName = "PageInfo"
|
||||
'
|
||||
'pageInfo2
|
||||
'
|
||||
Me.pageInfo2.LocationFloat = New DevExpress.Utils.PointFloat(531.0!, 6.0!)
|
||||
Me.pageInfo2.Name = "pageInfo2"
|
||||
Me.pageInfo2.SizeF = New System.Drawing.SizeF(513.0!, 23.0!)
|
||||
Me.pageInfo2.StyleName = "PageInfo"
|
||||
Me.pageInfo2.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
|
||||
Me.pageInfo2.TextFormatString = "Seite {0} von {1}"
|
||||
'
|
||||
'ReportHeader
|
||||
'
|
||||
Me.ReportHeader.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel12, Me.XrLabel11, Me.XrLabel9, Me.XrLabel10, Me.XrLabel8, Me.XrLabel6, Me.XrLabel7, Me.XrLabel5, Me.XrLabel4, Me.XrLabel3, Me.XrLabel2})
|
||||
Me.ReportHeader.HeightF = 234.2917!
|
||||
Me.ReportHeader.Name = "ReportHeader"
|
||||
'
|
||||
'Detail
|
||||
'
|
||||
Me.Detail.HeightF = 0!
|
||||
Me.Detail.KeepTogether = True
|
||||
Me.Detail.Name = "Detail"
|
||||
'
|
||||
'table3
|
||||
'
|
||||
Me.table3.LocationFloat = New DevExpress.Utils.PointFloat(0.00003973643!, 0!)
|
||||
Me.table3.Name = "table3"
|
||||
Me.table3.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.tableRow4})
|
||||
Me.table3.SizeF = New System.Drawing.SizeF(1050.0!, 28.0!)
|
||||
'
|
||||
'tableRow4
|
||||
'
|
||||
Me.tableRow4.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.tableCell44, Me.tableCell46, Me.tableCell47, Me.tableCell49, Me.tableCell50, Me.tableCell52, Me.tableCell53, Me.tableCell54})
|
||||
Me.tableRow4.Name = "tableRow4"
|
||||
Me.tableRow4.Weight = 1.0R
|
||||
'
|
||||
'tableCell44
|
||||
'
|
||||
Me.tableCell44.Name = "tableCell44"
|
||||
Me.tableCell44.StyleName = "DetailCaption2"
|
||||
Me.tableCell44.Text = "Zeilennummer"
|
||||
Me.tableCell44.Weight = 0.04382187252952939R
|
||||
'
|
||||
'tableCell46
|
||||
'
|
||||
Me.tableCell46.Name = "tableCell46"
|
||||
Me.tableCell46.StyleName = "DetailCaption2"
|
||||
Me.tableCell46.Text = "Artikelnummer"
|
||||
Me.tableCell46.Weight = 0.0450318363734654R
|
||||
'
|
||||
'tableCell47
|
||||
'
|
||||
Me.tableCell47.Name = "tableCell47"
|
||||
Me.tableCell47.StyleName = "DetailCaption2"
|
||||
Me.tableCell47.Text = "Bezeichnung"
|
||||
Me.tableCell47.Weight = 0.10979868348239258R
|
||||
'
|
||||
'tableCell49
|
||||
'
|
||||
Me.tableCell49.Name = "tableCell49"
|
||||
Me.tableCell49.StyleName = "DetailCaption2"
|
||||
Me.tableCell49.Text = "Lieferantenartikelnummer"
|
||||
Me.tableCell49.Weight = 0.044113117808847475R
|
||||
'
|
||||
'tableCell50
|
||||
'
|
||||
Me.tableCell50.Name = "tableCell50"
|
||||
Me.tableCell50.StyleName = "DetailCaption2"
|
||||
Me.tableCell50.Text = "Bestellt"
|
||||
Me.tableCell50.Weight = 0.026839454366174756R
|
||||
'
|
||||
'tableCell52
|
||||
'
|
||||
Me.tableCell52.Name = "tableCell52"
|
||||
Me.tableCell52.StyleName = "DetailCaption2"
|
||||
Me.tableCell52.Text = "Geliefert"
|
||||
Me.tableCell52.Weight = 0.024127269849467645R
|
||||
'
|
||||
'tableCell53
|
||||
'
|
||||
Me.tableCell53.Name = "tableCell53"
|
||||
Me.tableCell53.StyleName = "DetailCaption2"
|
||||
Me.tableCell53.Text = "Colli"
|
||||
Me.tableCell53.Weight = 0.030175568915830075R
|
||||
'
|
||||
'tableCell54
|
||||
'
|
||||
Me.tableCell54.Name = "tableCell54"
|
||||
Me.tableCell54.StyleName = "DetailCaption2"
|
||||
Me.tableCell54.Text = "Preis"
|
||||
Me.tableCell54.Weight = 0.023647549748139415R
|
||||
'
|
||||
'table4
|
||||
'
|
||||
Me.table4.LocationFloat = New DevExpress.Utils.PointFloat(0!, 28.00001!)
|
||||
Me.table4.Name = "table4"
|
||||
Me.table4.OddStyleName = "DetailData3_Odd"
|
||||
Me.table4.Rows.AddRange(New DevExpress.XtraReports.UI.XRTableRow() {Me.tableRow5})
|
||||
Me.table4.SizeF = New System.Drawing.SizeF(1050.0!, 25.0!)
|
||||
'
|
||||
'tableRow5
|
||||
'
|
||||
Me.tableRow5.Cells.AddRange(New DevExpress.XtraReports.UI.XRTableCell() {Me.tableCell65, Me.tableCell67, Me.tableCell68, Me.tableCell70, Me.tableCell71, Me.tableCell73, Me.tableCell74, Me.tableCell75})
|
||||
Me.tableRow5.Name = "tableRow5"
|
||||
Me.tableRow5.Weight = 11.5R
|
||||
'
|
||||
'tableCell65
|
||||
'
|
||||
Me.tableCell65.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Zeilennummer]")})
|
||||
Me.tableCell65.Name = "tableCell65"
|
||||
Me.tableCell65.StyleName = "DetailData2"
|
||||
Me.tableCell65.Weight = 0.04382187252952939R
|
||||
'
|
||||
'tableCell67
|
||||
'
|
||||
Me.tableCell67.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Artikelnummer]")})
|
||||
Me.tableCell67.Name = "tableCell67"
|
||||
Me.tableCell67.StyleName = "DetailData2"
|
||||
Me.tableCell67.Weight = 0.0450318363734654R
|
||||
'
|
||||
'tableCell68
|
||||
'
|
||||
Me.tableCell68.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Bezeichnung]")})
|
||||
Me.tableCell68.Name = "tableCell68"
|
||||
Me.tableCell68.StyleName = "DetailData2"
|
||||
Me.tableCell68.Weight = 0.10979876020551542R
|
||||
'
|
||||
'tableCell70
|
||||
'
|
||||
Me.tableCell70.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Lieferantenartikelnummer]")})
|
||||
Me.tableCell70.Name = "tableCell70"
|
||||
Me.tableCell70.StyleName = "DetailData2"
|
||||
Me.tableCell70.Weight = 0.044113126146570605R
|
||||
'
|
||||
'tableCell71
|
||||
'
|
||||
Me.tableCell71.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Menge_bestellt]")})
|
||||
Me.tableCell71.Name = "tableCell71"
|
||||
Me.tableCell71.StyleName = "DetailData2"
|
||||
Me.tableCell71.Weight = 0.026839462904304431R
|
||||
'
|
||||
'tableCell73
|
||||
'
|
||||
Me.tableCell73.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Menge_geliefert]")})
|
||||
Me.tableCell73.Name = "tableCell73"
|
||||
Me.tableCell73.StyleName = "DetailData2"
|
||||
Me.tableCell73.Weight = 0.024127176250492R
|
||||
'
|
||||
'tableCell74
|
||||
'
|
||||
Me.tableCell74.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Colli]")})
|
||||
Me.tableCell74.Name = "tableCell74"
|
||||
Me.tableCell74.StyleName = "DetailData2"
|
||||
Me.tableCell74.Weight = 0.030175672656399144R
|
||||
'
|
||||
'tableCell75
|
||||
'
|
||||
Me.tableCell75.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Einzelpreis]")})
|
||||
Me.tableCell75.Name = "tableCell75"
|
||||
Me.tableCell75.StyleName = "DetailData2"
|
||||
Me.tableCell75.Weight = 0.02364744600757035R
|
||||
'
|
||||
'XrLabel1
|
||||
'
|
||||
Me.XrLabel1.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Notizblock]")})
|
||||
Me.XrLabel1.Font = New System.Drawing.Font("Arial", 8.25!)
|
||||
Me.XrLabel1.LocationFloat = New DevExpress.Utils.PointFloat(0!, 53.0!)
|
||||
Me.XrLabel1.Multiline = True
|
||||
Me.XrLabel1.Name = "XrLabel1"
|
||||
Me.XrLabel1.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel1.SizeF = New System.Drawing.SizeF(1050.0!, 23.0!)
|
||||
Me.XrLabel1.StylePriority.UseFont = False
|
||||
Me.XrLabel1.Text = "XrLabel1"
|
||||
'
|
||||
'Detail1
|
||||
'
|
||||
Me.Detail1.Controls.AddRange(New DevExpress.XtraReports.UI.XRControl() {Me.XrLabel1, Me.table4, Me.table3})
|
||||
Me.Detail1.HeightF = 135.2917!
|
||||
Me.Detail1.Name = "Detail1"
|
||||
'
|
||||
'DetailReport
|
||||
'
|
||||
Me.DetailReport.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.Detail1})
|
||||
Me.DetailReport.DataMember = "Positions"
|
||||
Me.DetailReport.DataSource = Me.ObjectDataSource1
|
||||
Me.DetailReport.Level = 0
|
||||
Me.DetailReport.Name = "DetailReport"
|
||||
'
|
||||
'XrLabel2
|
||||
'
|
||||
Me.XrLabel2.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel2.LocationFloat = New DevExpress.Utils.PointFloat(9.999998!, 10.00001!)
|
||||
Me.XrLabel2.Multiline = True
|
||||
Me.XrLabel2.Name = "XrLabel2"
|
||||
Me.XrLabel2.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel2.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel2.StylePriority.UseFont = False
|
||||
Me.XrLabel2.Text = "Kunde"
|
||||
'
|
||||
'XrLabel3
|
||||
'
|
||||
Me.XrLabel3.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Fakt_Kontonummer]")})
|
||||
Me.XrLabel3.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel3.LocationFloat = New DevExpress.Utils.PointFloat(118.3903!, 10.00001!)
|
||||
Me.XrLabel3.Multiline = True
|
||||
Me.XrLabel3.Name = "XrLabel3"
|
||||
Me.XrLabel3.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel3.SizeF = New System.Drawing.SizeF(265.092!, 23.0!)
|
||||
Me.XrLabel3.StylePriority.UseFont = False
|
||||
Me.XrLabel3.Text = "XrLabel2"
|
||||
'
|
||||
'XrLabel4
|
||||
'
|
||||
Me.XrLabel4.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Fakt_Name]")})
|
||||
Me.XrLabel4.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel4.LocationFloat = New DevExpress.Utils.PointFloat(118.3904!, 33.00001!)
|
||||
Me.XrLabel4.Multiline = True
|
||||
Me.XrLabel4.Name = "XrLabel4"
|
||||
Me.XrLabel4.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel4.SizeF = New System.Drawing.SizeF(265.092!, 23.0!)
|
||||
Me.XrLabel4.StylePriority.UseFont = False
|
||||
Me.XrLabel4.Text = "XrLabel2"
|
||||
'
|
||||
'XrLabel5
|
||||
'
|
||||
Me.XrLabel5.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel5.LocationFloat = New DevExpress.Utils.PointFloat(383.4824!, 10.00001!)
|
||||
Me.XrLabel5.Multiline = True
|
||||
Me.XrLabel5.Name = "XrLabel5"
|
||||
Me.XrLabel5.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel5.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel5.StylePriority.UseFont = False
|
||||
Me.XrLabel5.Text = "Datum"
|
||||
'
|
||||
'XrLabel6
|
||||
'
|
||||
Me.XrLabel6.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Datum_AuftragBestellung]")})
|
||||
Me.XrLabel6.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel6.LocationFloat = New DevExpress.Utils.PointFloat(491.8157!, 10.00001!)
|
||||
Me.XrLabel6.Multiline = True
|
||||
Me.XrLabel6.Name = "XrLabel6"
|
||||
Me.XrLabel6.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel6.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel6.StylePriority.UseFont = False
|
||||
Me.XrLabel6.Text = "XrLabel2"
|
||||
Me.XrLabel6.TextFormatString = "{0:dd.MM.yyyy}"
|
||||
'
|
||||
'XrLabel7
|
||||
'
|
||||
Me.XrLabel7.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Leistungsdatum]")})
|
||||
Me.XrLabel7.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel7.LocationFloat = New DevExpress.Utils.PointFloat(491.8157!, 33.00001!)
|
||||
Me.XrLabel7.Multiline = True
|
||||
Me.XrLabel7.Name = "XrLabel7"
|
||||
Me.XrLabel7.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel7.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel7.StylePriority.UseFont = False
|
||||
Me.XrLabel7.Text = "XrLabel2"
|
||||
Me.XrLabel7.TextFormatString = "{0:dd.MM.yyyy}"
|
||||
'
|
||||
'XrLabel8
|
||||
'
|
||||
Me.XrLabel8.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel8.LocationFloat = New DevExpress.Utils.PointFloat(9.999998!, 64.16667!)
|
||||
Me.XrLabel8.Multiline = True
|
||||
Me.XrLabel8.Name = "XrLabel8"
|
||||
Me.XrLabel8.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel8.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel8.StylePriority.UseFont = False
|
||||
Me.XrLabel8.Text = "Bestellnummer"
|
||||
'
|
||||
'XrLabel9
|
||||
'
|
||||
Me.XrLabel9.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[AuftragsBestellnummer]")})
|
||||
Me.XrLabel9.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel9.LocationFloat = New DevExpress.Utils.PointFloat(118.3333!, 64.16667!)
|
||||
Me.XrLabel9.Multiline = True
|
||||
Me.XrLabel9.Name = "XrLabel9"
|
||||
Me.XrLabel9.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel9.SizeF = New System.Drawing.SizeF(265.149!, 23.0!)
|
||||
Me.XrLabel9.StylePriority.UseFont = False
|
||||
Me.XrLabel9.Text = "XrLabel2"
|
||||
'
|
||||
'XrLabel10
|
||||
'
|
||||
Me.XrLabel10.ExpressionBindings.AddRange(New DevExpress.XtraReports.UI.ExpressionBinding() {New DevExpress.XtraReports.UI.ExpressionBinding("BeforePrint", "Text", "[Head].[Auftragsreferenz]")})
|
||||
Me.XrLabel10.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel10.LocationFloat = New DevExpress.Utils.PointFloat(9.999998!, 110.1667!)
|
||||
Me.XrLabel10.Multiline = True
|
||||
Me.XrLabel10.Name = "XrLabel10"
|
||||
Me.XrLabel10.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel10.SizeF = New System.Drawing.SizeF(373.4824!, 120.9167!)
|
||||
Me.XrLabel10.StylePriority.UseFont = False
|
||||
Me.XrLabel10.Text = "XrLabel2"
|
||||
'
|
||||
'XrLabel11
|
||||
'
|
||||
Me.XrLabel11.Font = New System.Drawing.Font("Arial", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel11.LocationFloat = New DevExpress.Utils.PointFloat(814.504!, 10.00001!)
|
||||
Me.XrLabel11.Multiline = True
|
||||
Me.XrLabel11.Name = "XrLabel11"
|
||||
Me.XrLabel11.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel11.SizeF = New System.Drawing.SizeF(225.496!, 77.16665!)
|
||||
Me.XrLabel11.StylePriority.UseFont = False
|
||||
Me.XrLabel11.StylePriority.UseTextAlignment = False
|
||||
Me.XrLabel11.Text = "ORDERS" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "Offene EDI Sätze"
|
||||
Me.XrLabel11.TextAlignment = DevExpress.XtraPrinting.TextAlignment.TopRight
|
||||
'
|
||||
'ObjectDataSource1
|
||||
'
|
||||
Me.ObjectDataSource1.DataSource = GetType(ImporterShared.Schemas.Orders.ReportSource)
|
||||
Me.ObjectDataSource1.Name = "ObjectDataSource1"
|
||||
'
|
||||
'XrLabel12
|
||||
'
|
||||
Me.XrLabel12.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.XrLabel12.LocationFloat = New DevExpress.Utils.PointFloat(9.999998!, 87.16666!)
|
||||
Me.XrLabel12.Multiline = True
|
||||
Me.XrLabel12.Name = "XrLabel12"
|
||||
Me.XrLabel12.Padding = New DevExpress.XtraPrinting.PaddingInfo(2, 2, 0, 0, 100.0!)
|
||||
Me.XrLabel12.SizeF = New System.Drawing.SizeF(108.3333!, 23.0!)
|
||||
Me.XrLabel12.StylePriority.UseFont = False
|
||||
Me.XrLabel12.Text = "Auftragsreferenz"
|
||||
'
|
||||
'OrderReport
|
||||
'
|
||||
Me.Bands.AddRange(New DevExpress.XtraReports.UI.Band() {Me.TopMargin, Me.BottomMargin, Me.ReportHeader, Me.Detail, Me.DetailReport})
|
||||
Me.ComponentStorage.AddRange(New System.ComponentModel.IComponent() {Me.ObjectDataSource1})
|
||||
Me.DataSource = Me.ObjectDataSource1
|
||||
Me.Font = New System.Drawing.Font("Arial", 9.75!)
|
||||
Me.Landscape = True
|
||||
Me.Margins = New System.Drawing.Printing.Margins(25, 25, 25, 29)
|
||||
Me.PageHeight = 850
|
||||
Me.PageWidth = 1100
|
||||
Me.StyleSheet.AddRange(New DevExpress.XtraReports.UI.XRControlStyle() {Me.Title, Me.GroupCaption1, Me.GroupData1, Me.DetailCaption1, Me.DetailData1, Me.DetailCaption2, Me.DetailData2, Me.DetailData3_Odd, Me.PageInfo})
|
||||
Me.Version = "19.2"
|
||||
CType(Me.table3, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.table4, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.ObjectDataSource1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents ObjectDataSource1 As DevExpress.DataAccess.ObjectBinding.ObjectDataSource
|
||||
Friend WithEvents Title As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents GroupCaption1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents GroupData1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents DetailCaption1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents DetailData1 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents DetailCaption2 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents DetailData2 As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents DetailData3_Odd As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents PageInfo As DevExpress.XtraReports.UI.XRControlStyle
|
||||
Friend WithEvents TopMargin As DevExpress.XtraReports.UI.TopMarginBand
|
||||
Friend WithEvents BottomMargin As DevExpress.XtraReports.UI.BottomMarginBand
|
||||
Friend WithEvents pageInfo1 As DevExpress.XtraReports.UI.XRPageInfo
|
||||
Friend WithEvents pageInfo2 As DevExpress.XtraReports.UI.XRPageInfo
|
||||
Friend WithEvents ReportHeader As DevExpress.XtraReports.UI.ReportHeaderBand
|
||||
Friend WithEvents Detail As DevExpress.XtraReports.UI.DetailBand
|
||||
Friend WithEvents table3 As DevExpress.XtraReports.UI.XRTable
|
||||
Friend WithEvents tableRow4 As DevExpress.XtraReports.UI.XRTableRow
|
||||
Friend WithEvents tableCell44 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell46 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell47 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell49 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell50 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell52 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell53 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell54 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents table4 As DevExpress.XtraReports.UI.XRTable
|
||||
Friend WithEvents tableRow5 As DevExpress.XtraReports.UI.XRTableRow
|
||||
Friend WithEvents tableCell65 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell67 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell68 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell70 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell71 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell73 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell74 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents tableCell75 As DevExpress.XtraReports.UI.XRTableCell
|
||||
Friend WithEvents XrLabel1 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents Detail1 As DevExpress.XtraReports.UI.DetailBand
|
||||
Friend WithEvents DetailReport As DevExpress.XtraReports.UI.DetailReportBand
|
||||
Friend WithEvents XrLabel6 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel7 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel5 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel4 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel3 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel2 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel9 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel10 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel8 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel11 As DevExpress.XtraReports.UI.XRLabel
|
||||
Friend WithEvents XrLabel12 As DevExpress.XtraReports.UI.XRLabel
|
||||
End Class
|
||||
315
EDIDocumentImport/frmImportMain.Designer.vb
generated
315
EDIDocumentImport/frmImportMain.Designer.vb
generated
@@ -1,315 +0,0 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
|
||||
Partial Class frmImportMain
|
||||
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()>
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()>
|
||||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmImportMain))
|
||||
Me.RibbonControl = New DevExpress.XtraBars.Ribbon.RibbonControl()
|
||||
Me.txtVersion = New DevExpress.XtraBars.BarStaticItem()
|
||||
Me.txtFilesLoaded = New DevExpress.XtraBars.BarStaticItem()
|
||||
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.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.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.btnLoadFiles, Me.btnTransferFile, Me.btnOpenInputDirectory, Me.btnOpenOutputDirectory, Me.btnOpenSchemaDirectory, Me.btnReloadFile})
|
||||
Me.RibbonControl.Location = New System.Drawing.Point(0, 0)
|
||||
Me.RibbonControl.MaxItemId = 12
|
||||
Me.RibbonControl.Name = "RibbonControl"
|
||||
Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
|
||||
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
|
||||
'
|
||||
Me.txtVersion.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right
|
||||
Me.txtVersion.Caption = "BarStaticItem1"
|
||||
Me.txtVersion.Id = 1
|
||||
Me.txtVersion.Name = "txtVersion"
|
||||
'
|
||||
'txtFilesLoaded
|
||||
'
|
||||
Me.txtFilesLoaded.Caption = "BarStaticItem2"
|
||||
Me.txtFilesLoaded.Id = 2
|
||||
Me.txtFilesLoaded.Name = "txtFilesLoaded"
|
||||
'
|
||||
'btnLoadFiles
|
||||
'
|
||||
Me.btnLoadFiles.Caption = "Dateien einlesen"
|
||||
Me.btnLoadFiles.Id = 3
|
||||
Me.btnLoadFiles.ImageOptions.SvgImage = Global.ImporterForm.My.Resources.Resources.export
|
||||
Me.btnLoadFiles.Name = "btnLoadFiles"
|
||||
'
|
||||
'btnTransferFile
|
||||
'
|
||||
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"
|
||||
'
|
||||
'btnOpenInputDirectory
|
||||
'
|
||||
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.RibbonPageGroup2})
|
||||
Me.RibbonPage1.Name = "RibbonPage1"
|
||||
Me.RibbonPage1.Text = "RibbonPage1"
|
||||
'
|
||||
'RibbonPageGroup1
|
||||
'
|
||||
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 = "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
|
||||
'
|
||||
Me.RibbonStatusBar.ItemLinks.Add(Me.txtVersion)
|
||||
Me.RibbonStatusBar.ItemLinks.Add(Me.txtFilesLoaded)
|
||||
Me.RibbonStatusBar.Location = New System.Drawing.Point(0, 722)
|
||||
Me.RibbonStatusBar.Name = "RibbonStatusBar"
|
||||
Me.RibbonStatusBar.Ribbon = Me.RibbonControl
|
||||
Me.RibbonStatusBar.Size = New System.Drawing.Size(1215, 24)
|
||||
'
|
||||
'SplitContainerControl1
|
||||
'
|
||||
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
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.SplitContainerMain)
|
||||
Me.SplitContainerControl1.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerControl1.Size = New System.Drawing.Size(1215, 590)
|
||||
Me.SplitContainerControl1.SplitterPosition = 325
|
||||
Me.SplitContainerControl1.TabIndex = 2
|
||||
'
|
||||
'GridControlFiles
|
||||
'
|
||||
Me.GridControlFiles.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.GridControlFiles.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GridControlFiles.MainView = Me.GridViewFiles
|
||||
Me.GridControlFiles.MenuManager = Me.RibbonControl
|
||||
Me.GridControlFiles.Name = "GridControlFiles"
|
||||
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.colSelected, Me.colFilename})
|
||||
Me.GridViewFiles.GridControl = Me.GridControlFiles
|
||||
Me.GridViewFiles.Name = "GridViewFiles"
|
||||
'
|
||||
'colSelected
|
||||
'
|
||||
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
|
||||
'
|
||||
'colFilename
|
||||
'
|
||||
Me.colFilename.Caption = "Dateiname"
|
||||
Me.colFilename.FieldName = "Name"
|
||||
Me.colFilename.Name = "colFilename"
|
||||
Me.colFilename.Visible = True
|
||||
Me.colFilename.VisibleIndex = 1
|
||||
'
|
||||
'SplitContainerMain
|
||||
'
|
||||
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
|
||||
'
|
||||
'SplitContainerGrids
|
||||
'
|
||||
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
|
||||
'
|
||||
'SplitContainerGrids1
|
||||
'
|
||||
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
|
||||
'
|
||||
'SplitContainerGrids2
|
||||
'
|
||||
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
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(1215, 746)
|
||||
Me.Controls.Add(Me.SplitContainerControl1)
|
||||
Me.Controls.Add(Me.RibbonStatusBar)
|
||||
Me.Controls.Add(Me.RibbonControl)
|
||||
Me.Name = "frmImportMain"
|
||||
Me.Ribbon = Me.RibbonControl
|
||||
Me.StatusBar = Me.RibbonStatusBar
|
||||
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.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()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents RibbonControl As DevExpress.XtraBars.Ribbon.RibbonControl
|
||||
Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
|
||||
Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
|
||||
Friend WithEvents RibbonStatusBar As DevExpress.XtraBars.Ribbon.RibbonStatusBar
|
||||
Friend WithEvents SplitContainerControl1 As DevExpress.XtraEditors.SplitContainerControl
|
||||
Friend WithEvents GridControlFiles As DevExpress.XtraGrid.GridControl
|
||||
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 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
|
||||
@@ -1,295 +0,0 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
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
|
||||
Imports ImporterShared
|
||||
Imports ImporterShared.Documents
|
||||
Imports ImporterShared.Schemas
|
||||
Imports ImporterShared.Winline
|
||||
|
||||
Public Class frmImportMain
|
||||
Private LogConfig As LogConfig
|
||||
Private Logger As Logger
|
||||
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 Grids As List(Of GridControl)
|
||||
Private GridLoader As GridLoader
|
||||
Private GridBuilder As GridBuilder
|
||||
|
||||
Private CurrentSchema As String
|
||||
Private CurrentDocument As Document
|
||||
|
||||
Private Sub frmImportMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
txtVersion.Caption = String.Format(txtVersion.Caption, Application.ProductVersion)
|
||||
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "EDI Document Importer")
|
||||
Logger = LogConfig.GetLogger()
|
||||
Logger.Info("EDI Document Importer, Version [{0}]", Application.ProductVersion)
|
||||
|
||||
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 {
|
||||
.FormTitle = "EDI Document Importer"
|
||||
}
|
||||
Dim oResult = oForm.ShowDialog()
|
||||
|
||||
If oResult = DialogResult.OK Then
|
||||
ConfigManager.Config.ConnectionString = oForm.ConnectionString
|
||||
ConfigManager.Save()
|
||||
End If
|
||||
End If
|
||||
|
||||
' Initialize Database
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
|
||||
Database = New MSSQLServer(LogConfig, oConnectionString)
|
||||
Winline = New Data(LogConfig, Database, ConfigManager.Config)
|
||||
WebService = New WebService(LogConfig, ConfigManager.Config)
|
||||
PositionData = New PositionData(LogConfig, Winline)
|
||||
|
||||
' Load WinLine Data
|
||||
Winline.Mandators.Clear()
|
||||
Winline.LoadMandators()
|
||||
Winline.LoadEconomicYears()
|
||||
Winline.LoadDocumentKinds(Winline.Mandators)
|
||||
Winline.LoadTemplateConfiguration()
|
||||
For Each oMandator In Winline.Mandators
|
||||
Winline.LoadAccounts(oMandator)
|
||||
Next
|
||||
|
||||
DocumentLoader = New DocumentLoader(LogConfig, Winline)
|
||||
SchemaLoader = New SchemaLoader(LogConfig)
|
||||
GridLoader = New GridLoader(LogConfig)
|
||||
|
||||
SchemaLoader.LoadFiles(ConfigManager.Config.SchemaDirectory)
|
||||
CurrentSchema = SchemaLoader.SchemaList.First().FullName
|
||||
|
||||
Dim oSchema = SchemaLoader.GetSchemaFromFile(CurrentSchema)
|
||||
Grids = CreateGridsAndColumns(oSchema)
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function CreateGridsAndColumns(pSchema As Schemas.Schema) As List(Of GridControl)
|
||||
Dim oGrids As New List(Of GridControl)
|
||||
Dim oTableCounter = 0
|
||||
|
||||
For Each oTable In pSchema.Tables
|
||||
If oTableCounter = 0 Then
|
||||
Dim oGrid = GridLoader.GetGridFromElement(oTable)
|
||||
AddHandler oGrid.DoubleClick, AddressOf Grid_DoubleClick
|
||||
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
|
||||
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
|
||||
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
|
||||
SplitContainerGrids2.Panel2.Controls.Add(oGrid)
|
||||
oGrids.Add(oGrid)
|
||||
End If
|
||||
|
||||
If oTableCounter > 3 Then
|
||||
MsgBox("Only 4 Tables are allowed currently!", MsgBoxStyle.Exclamation, Text)
|
||||
End If
|
||||
|
||||
oTableCounter += 1
|
||||
Next
|
||||
|
||||
If oTableCounter < 3 Then
|
||||
SplitContainerGrids.PanelVisibility = DevExpress.XtraEditors.SplitPanelVisibility.Panel1
|
||||
End If
|
||||
|
||||
Return oGrids
|
||||
End Function
|
||||
|
||||
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 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 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
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewFiles_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridViewFiles.FocusedRowChanged
|
||||
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(e.FocusedRowHandle)
|
||||
If LoadDocument(oDocument) Then
|
||||
CurrentDocument = oDocument
|
||||
Else
|
||||
MsgBox("Das Laden des Dokuments ist fehlgeschlagen!", MsgBoxStyle.Critical, Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function LoadDocument(pDocument As Document)
|
||||
Try
|
||||
Dim oDatasources As New Dictionary(Of String, 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()
|
||||
|
||||
' 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
|
||||
oDataRow.Item(oField.Key) = oField.Value
|
||||
Next
|
||||
|
||||
oDataTable.Rows.Add(oDataRow)
|
||||
oDataTable.AcceptChanges()
|
||||
Next
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
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 btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.InputDirectory)
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
Private Sub btnOpenSchemaDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenSchemaDirectory.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.SchemaDirectory)
|
||||
End Sub
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
1091
EDIDocumentImport/frmImportMain_old.Designer.vb
generated
1091
EDIDocumentImport/frmImportMain_old.Designer.vb
generated
File diff suppressed because it is too large
Load Diff
@@ -1,509 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraRichEdit
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DevExpress.XtraReports.UI
|
||||
Imports DevExpress.DataAccess.ObjectBinding
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports ImporterShared.Documents
|
||||
Imports ImporterShared.Winline
|
||||
Imports ImporterShared.Schemas
|
||||
Imports ImporterForm.Positions
|
||||
Imports DevExpress.XtraLayout
|
||||
|
||||
Public Class frmImportMain_old
|
||||
Public LogConfig As LogConfig
|
||||
Public Logger As Logger
|
||||
Public ConfigManager As ConfigManager(Of ImporterShared.Config)
|
||||
Public Database As MSSQLServer
|
||||
Public DocumentLoader As DocumentLoader
|
||||
Public GridBuilder As GridBuilder
|
||||
Public PositionData As PositionData
|
||||
|
||||
Public Winline As Data
|
||||
Public WebService As WebService
|
||||
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Try
|
||||
txtVersion.Caption = String.Format(txtVersion.Caption, Application.ProductVersion)
|
||||
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "EDI Document Importer")
|
||||
Logger = LogConfig.GetLogger()
|
||||
Logger.Info("EDI Document Importer, Version [{0}]", Application.ProductVersion)
|
||||
|
||||
ConfigManager = New ConfigManager(Of ImporterShared.Config)(LogConfig,
|
||||
Application.UserAppDataPath,
|
||||
Application.CommonAppDataPath,
|
||||
Application.StartupPath)
|
||||
|
||||
' If ConnectionString does not exist, show SQL Config Form
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
Dim oForm As New frmSQLConfig(LogConfig) With {
|
||||
.FormTitle = "EDI Document Importer"
|
||||
}
|
||||
Dim oResult = oForm.ShowDialog()
|
||||
|
||||
If oResult = DialogResult.OK Then
|
||||
ConfigManager.Config.ConnectionString = oForm.ConnectionString
|
||||
ConfigManager.Save()
|
||||
End If
|
||||
End If
|
||||
|
||||
' Initialize Database
|
||||
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
|
||||
Database = New MSSQLServer(LogConfig, oConnectionString)
|
||||
Winline = New Data(LogConfig, Database, ConfigManager.Config)
|
||||
WebService = New WebService(LogConfig, ConfigManager.Config)
|
||||
PositionData = New PositionData(LogConfig, Winline)
|
||||
|
||||
' Load WinLine Data
|
||||
Winline.Mandators.Clear()
|
||||
Winline.LoadMandators()
|
||||
Winline.LoadEconomicYears()
|
||||
Winline.LoadDocumentKinds(Winline.Mandators)
|
||||
For Each oMandator In Winline.Mandators
|
||||
Winline.LoadAccounts(oMandator)
|
||||
Next
|
||||
|
||||
' Load data for UI Fields
|
||||
cmbMandator.Properties.DataSource = Winline.Mandators
|
||||
|
||||
|
||||
cmbYear.Properties.Items.AddRange(Winline.Years)
|
||||
cmbYear.SelectedItem = ConfigManager.Config.GetYear()
|
||||
|
||||
' Initialize Grids
|
||||
GridBuilder = New GridBuilder(New List(Of GridView) From {GridViewFiles, GridViewPositions})
|
||||
GridBuilder.WithDefaults()
|
||||
PositionGrid.LoadPositionViewAndColumns(GridViewPositions, DocumentType.Order)
|
||||
|
||||
' Construct classes related to the xml data
|
||||
DocumentLoader = New DocumentLoader(LogConfig, Winline)
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden der Anwendung")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#Region "Helpers"
|
||||
Private Function GetValidationMessage(FieldName As String) As String
|
||||
Return $"Das Feld '{FieldName}' muss ausgefüllt werden!"
|
||||
End Function
|
||||
|
||||
Private Function GetErrorMessage(pException As Exception, pErrorText As String)
|
||||
Return $"{pErrorText}:{vbNewLine}{vbNewLine}{pException.Message}"
|
||||
End Function
|
||||
|
||||
Private Function GetFocusedDocument() As Document
|
||||
Dim oRowHandles = GridViewFiles.GetSelectedRows().ToList()
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(oRowHandles.First())
|
||||
Return oDocument
|
||||
End Function
|
||||
|
||||
Private Function GetFocusedPosition() As Position
|
||||
Dim oRowHandles = GridViewPositions.GetSelectedRows().ToList()
|
||||
Dim oPosition As Position = GridViewPositions.GetRow(oRowHandles.First())
|
||||
Return oPosition
|
||||
End Function
|
||||
|
||||
Private Sub TryOpenDirectory(pPath As String, pDisplayName As String)
|
||||
If Directory.Exists(pPath) Then
|
||||
Process.Start(pPath)
|
||||
Else
|
||||
MsgBox($"{pDisplayName} nicht konfiguriert oder nicht gefunden!", MsgBoxStyle.Exclamation, Text)
|
||||
End If
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
Private Sub btnLoadDocuments_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnLoadDocuments.ItemClick
|
||||
Try
|
||||
If DocumentLoader.LoadFiles(ConfigManager.Config.InputDirectory) = True Then
|
||||
|
||||
RibbonGroupDataTransmission.Enabled = True
|
||||
RibbonGroupDocument.Enabled = True
|
||||
RibbonGroupPositions.Enabled = True
|
||||
|
||||
LayoutControlHead.Enabled = True
|
||||
GridControlPositions.Enabled = True
|
||||
|
||||
btnReloadDocument.Enabled = True
|
||||
|
||||
GridControlFiles.DataSource = DocumentLoader.Files
|
||||
txtFilesLoaded.Caption = $"{DocumentLoader.Files.Count} Dokumente geladen"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Dim oMessage = ex.Message
|
||||
|
||||
If ex.InnerException IsNot Nothing Then
|
||||
oMessage &= vbNewLine & vbNewLine & ex.InnerException.Message
|
||||
End If
|
||||
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewFiles_FocusedRowChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs) Handles GridViewFiles.FocusedRowChanged
|
||||
Dim oDocument As Document = GridViewFiles.GetRow(e.FocusedRowHandle)
|
||||
|
||||
If oDocument Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ShowDocument(oDocument)
|
||||
End Sub
|
||||
|
||||
Private Sub ShowDocument(pDocument As Document)
|
||||
' Load XML File in the sidebar
|
||||
RichEditXml.LoadDocument(pDocument.FullName, DocumentFormat.PlainText)
|
||||
|
||||
If pDocument.Mandator Is Nothing Then
|
||||
Dim oForm As New frmMandatorSelection() With {
|
||||
.Mandators = Winline.Mandators,
|
||||
.SelectedMandator = Nothing
|
||||
}
|
||||
Dim oResult = oForm.ShowDialog()
|
||||
|
||||
If oResult <> DialogResult.OK Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
pDocument.Mandator = oForm.SelectedMandator.Id
|
||||
End If
|
||||
|
||||
Try
|
||||
Select Case pDocument.Type
|
||||
Case DocumentType.Order
|
||||
MsgBox("TODO")
|
||||
'ShowOrderDocument(pDocument)
|
||||
|
||||
End Select
|
||||
|
||||
Catch ex As Xml.XmlException
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exceptions.NoMandatorException
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exception
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Private Sub ShowOrderDocument(pDocument As Document)
|
||||
' If pDocument.Mandator Is Nothing Then
|
||||
' Throw New Exceptions.NoMandatorException("Es konnte kein Mandant gefunden werden")
|
||||
' End If
|
||||
|
||||
' Dim oData As Orders.Input.MESOWebService = DirectCast(pDocument.Data, Orders.Input.MESOWebService)
|
||||
' Dim oDataOriginal As Orders.Input.MESOWebService = DirectCast(pDocument.DataOriginal, Orders.Input.MESOWebService)
|
||||
' Dim oHead = Orders.Helpers.GetOrderHead(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT025)(oData)
|
||||
' Dim oHeadOriginal = Orders.Helpers.GetOrderHead(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT025)(oDataOriginal)
|
||||
|
||||
' ' --- Head Data --------------------------------------------------------------------------------------
|
||||
|
||||
' ' Original, Unreplaced Data
|
||||
' txtCustomerGLN.Text = oHeadOriginal.Fakt_Kontonummer
|
||||
' txtDeliveryAddressGLN.Text = oHeadOriginal.Lief_Kontonummer
|
||||
|
||||
' ' Regular Data from EDI
|
||||
' txtRunningNumber.Text = oHead.Laufnummer
|
||||
' cmbOrderIssuer.Text = oHead.Bestellt_Von
|
||||
' txtOrderNumber.Text = oHead.Auftragsreferenz
|
||||
' txtInfoText.Text = oHead.Infotext
|
||||
|
||||
' Try
|
||||
' dateOrderDate.EditValue = Date.ParseExact(oHead.Datum_AuftragBestellung, "yyyy-MM-dd", Globalization.CultureInfo.InvariantCulture)
|
||||
' Catch ex As Exception
|
||||
' dateOrderDate.EditValue = Nothing
|
||||
' End Try
|
||||
|
||||
' ' --- Find Mandator --------------------------------------------------------------------------------------
|
||||
|
||||
' Dim oMandator = Winline.Mandators.
|
||||
' Where(Function(m) m.Id = pDocument.Mandator).
|
||||
' SingleOrDefault()
|
||||
' cmbMandator.EditValue = oMandator
|
||||
|
||||
' ' --- Find DocumentKinds ---------------------------------------------------------------------------------
|
||||
|
||||
' Dim oMandatorKinds = Winline.DocumentKinds.
|
||||
' Where(Function(k) k.Mandator = oMandator.Id).
|
||||
' ToList()
|
||||
' Dim oSelectedKind = oMandatorKinds.
|
||||
' Where(Function(k) k.Id.ToString = oHead.Belegart).
|
||||
' SingleOrDefault()
|
||||
|
||||
' cmbDocumentKind.Properties.Items.Clear()
|
||||
' cmbDocumentKind.Properties.Items.AddRange(oMandatorKinds)
|
||||
|
||||
' If oSelectedKind Is Nothing Then
|
||||
' cmbDocumentKind.ErrorText = "Es wurde keine passende Belegart gefunden."
|
||||
' cmbDocumentKind.SelectedItem = Nothing
|
||||
' Else
|
||||
' cmbDocumentKind.SelectedItem = oSelectedKind
|
||||
' End If
|
||||
|
||||
' ' --- Find Accounts --------------------------------------------------------------------------------------
|
||||
|
||||
' Dim oMandatorAccounts = Winline.Accounts.
|
||||
' Where(Function(a) a.Mandator = oMandator.Id).
|
||||
' ToList()
|
||||
' cmbCustomer.Properties.DataSource = oMandatorAccounts
|
||||
' cmbDeliveryAddress.Properties.DataSource = oMandatorAccounts
|
||||
|
||||
' ' FAKTURA
|
||||
|
||||
' If oHead.Fakt_Kontonummer = oHeadOriginal.Fakt_Kontonummer Then
|
||||
' cmbCustomer.ErrorText = GetValidationMessage("Faktura Konto")
|
||||
' cmbCustomer.EditValue = Nothing
|
||||
' Else
|
||||
' Dim oMatchingAccounts = oMandatorAccounts.
|
||||
' Where(Function(oAccount) oAccount.Id = oHead.Fakt_Kontonummer)
|
||||
|
||||
' If oMatchingAccounts.Count() > 1 Then
|
||||
' cmbCustomer.EditValue = Nothing
|
||||
' cmbCustomer.ErrorText = "Für die Kontonummer wurden mehrere Konten gefunden."
|
||||
' ElseIf oMatchingAccounts.Count() = 0 Then
|
||||
' cmbCustomer.EditValue = Nothing
|
||||
' cmbCustomer.ErrorText = "Für die Kontonummer wurde kein Konto gefunden."
|
||||
' Else
|
||||
' cmbCustomer.EditValue = oMatchingAccounts.SingleOrDefault()
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' ' CONTACTS
|
||||
' If cmbCustomer.EditValue IsNot Nothing Then
|
||||
' Dim oContacts = Winline.GetContacts(oHead.Fakt_Kontonummer, oMandator)
|
||||
' cmbOrderIssuer.Properties.DataSource = oContacts
|
||||
' End If
|
||||
|
||||
|
||||
' ' DEVLIERY
|
||||
' If oHead.Lief_Kontonummer = oHeadOriginal.Lief_Kontonummer Then
|
||||
' If oHeadOriginal.Lief_Kontonummer = String.Empty Then
|
||||
' txtPlace.EditValue = oHeadOriginal.Lief_Ort
|
||||
' txtZIP.EditValue = oHeadOriginal.Lief_PLZ
|
||||
' txtStreetName.EditValue = oHeadOriginal.Lief_Strasse
|
||||
' txtName.EditValue = oHeadOriginal.Lief_Name
|
||||
' Else
|
||||
' cmbDeliveryAddress.ErrorText = GetValidationMessage("Lieferanten Konto")
|
||||
' cmbDeliveryAddress.EditValue = Nothing
|
||||
' End If
|
||||
' Else
|
||||
' Dim oMatchingAccounts = oMandatorAccounts.
|
||||
' Where(Function(oAccount) oAccount.Id = oHead.Lief_Kontonummer)
|
||||
|
||||
' If oMatchingAccounts.Count() > 1 Then
|
||||
' cmbDeliveryAddress.EditValue = Nothing
|
||||
' cmbDeliveryAddress.ErrorText = "Für die Kontonummer wurden mehrere Konten gefunden."
|
||||
' ElseIf oMatchingAccounts.Count() = 0 Then
|
||||
' cmbDeliveryAddress.EditValue = Nothing
|
||||
' cmbDeliveryAddress.ErrorText = "Für die Kontonummer wurde kein Konto gefunden."
|
||||
' Else
|
||||
' cmbDeliveryAddress.EditValue = oMatchingAccounts.SingleOrDefault()
|
||||
' End If
|
||||
' End If
|
||||
|
||||
' ' --- Find Positions ------------------------------------------------------------------------------------
|
||||
|
||||
' Dim oPositionList = PositionData.Load(oMandator, oData, oDataOriginal)
|
||||
' GridControlPositions.DataSource = oPositionList
|
||||
' GridViewPositions.BestFitColumns()
|
||||
'End Sub
|
||||
|
||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.InputDirectory, "Eingangsverzeichnis")
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
|
||||
TryOpenDirectory(ConfigManager.Config.OutputDirectory, "Ausgangsverzeichnis")
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
|
||||
Dim oUserConfigDirectory = New FileInfo(ConfigManager.UserConfigPath).Directory
|
||||
TryOpenDirectory(oUserConfigDirectory.FullName, "Konfigurationsverzeichnis")
|
||||
End Sub
|
||||
|
||||
Private Sub checkShowXml_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles checkShowXml.CheckedChanged
|
||||
SplitContainerControl3.Collapsed = Not checkShowXml.Checked
|
||||
End Sub
|
||||
|
||||
'Private Async Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick
|
||||
' Dim oMessageText As String = ""
|
||||
' Dim oMessageStyle As MsgBoxStyle = MsgBoxStyle.Critical
|
||||
|
||||
' Dim oDocument As Document = GetFocusedDocument()
|
||||
' If oDocument Is Nothing Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' SplashScreenManager1.ShowWaitForm()
|
||||
' ChangeUIState(False)
|
||||
|
||||
' Try
|
||||
' Dim oFinalDocument As Document = TransferChangesToDocument(oDocument)
|
||||
' Dim oResult = Await WebService.TransferDocumentToWinLine(oFinalDocument)
|
||||
|
||||
' oMessageText = "Beleg wurde erfolgreich übertragen!"
|
||||
' oMessageStyle = MsgBoxStyle.Information
|
||||
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
|
||||
' oMessageText = $"Fehler beim Übertragen des Dokuments:{vbNewLine}{vbNewLine}{ex.Message}"
|
||||
' oMessageStyle = MsgBoxStyle.Critical
|
||||
|
||||
' Finally
|
||||
' SplashScreenManager1.CloseWaitForm()
|
||||
' ChangeUIState(True)
|
||||
|
||||
' MsgBox(oMessageText, oMessageStyle, Text)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
Private Sub ChangeUIState(pEnabled As Boolean)
|
||||
GridControlPositions.Enabled = pEnabled
|
||||
GridControlFiles.Enabled = pEnabled
|
||||
LayoutControlHead.Enabled = pEnabled
|
||||
|
||||
RibbonGroupDataTransmission.Enabled = pEnabled
|
||||
RibbonGroupDataLoading.Enabled = pEnabled
|
||||
RibbonGroupDocument.Enabled = pEnabled
|
||||
RibbonGroupPositions.Enabled = pEnabled
|
||||
End Sub
|
||||
|
||||
'Private Function TransferChangesToDocument(pDocument As Document)
|
||||
' Dim oData As Orders.Input.MESOWebService = pDocument.Data
|
||||
|
||||
' Try
|
||||
' Orders.Helpers.SetOrderHead(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT025)(oData, AddressOf UpdateOrderHead)
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
|
||||
' Throw ex
|
||||
' End Try
|
||||
|
||||
' Return pDocument
|
||||
'End Function
|
||||
|
||||
'Private Function UpdateOrderHead(pObject As Orders.Input.MESOWebServiceEXIMVRG_ordersT025) As Orders.Input.MESOWebServiceEXIMVRG_ordersT025
|
||||
' ' Update DocumentKind
|
||||
' If cmbDocumentKind.EditValue IsNot Nothing AndAlso TypeOf cmbDocumentKind.EditValue Is DocumentKind Then
|
||||
' pObject.Belegart = DirectCast(cmbDocumentKind.EditValue, DocumentKind).Id
|
||||
' End If
|
||||
|
||||
' ' Update Talking Person lol
|
||||
' If cmbOrderIssuer.EditValue IsNot Nothing AndAlso TypeOf cmbOrderIssuer.EditValue Is Contact Then
|
||||
' pObject.Bestellt_Von = DirectCast(cmbOrderIssuer.EditValue, Contact).Id
|
||||
' End If
|
||||
|
||||
' ' Update Delivery Address
|
||||
' If cmbDeliveryAddress.EditValue IsNot Nothing AndAlso TypeOf cmbDeliveryAddress.EditValue Is Account Then
|
||||
' pObject.Lief_Kontonummer = DirectCast(cmbDeliveryAddress.EditValue, Account)?.Id
|
||||
' End If
|
||||
|
||||
' ' Update Order Number
|
||||
' If txtOrderNumber.EditValue IsNot Nothing AndAlso txtOrderNumber.EditValue <> String.Empty Then
|
||||
' pObject.Auftragsreferenz = txtOrderNumber.EditValue
|
||||
|
||||
' End If
|
||||
|
||||
' ' Update Order Date
|
||||
' If dateOrderDate IsNot Nothing Then
|
||||
' pObject.Datum_AuftragBestellung = DirectCast(dateOrderDate.EditValue, Date).ToString("yyyy-MM-dd")
|
||||
' End If
|
||||
|
||||
' ' Update Extra Address
|
||||
' pObject.Lief_Name = txtName.EditValue
|
||||
' pObject.Lief_Ort = txtPlace.EditValue
|
||||
' pObject.Lief_PLZ = txtZIP.EditValue
|
||||
' pObject.Lief_Strasse = txtStreetName.EditValue
|
||||
|
||||
' Return pObject
|
||||
'End Function
|
||||
|
||||
Private Sub BarButtonItem8_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem8.ItemClick
|
||||
TryOpenDirectory(LogConfig.LogDirectory, "Logverzeichnis")
|
||||
End Sub
|
||||
|
||||
Private Sub cmbCustomer_Validating(sender As BaseEdit, e As System.ComponentModel.CancelEventArgs) Handles cmbCustomer.Validating, cmbDocumentKind.Validating, cmbMandator.Validating, cmbYear.Validating
|
||||
If sender.EditValue Is Nothing Then
|
||||
sender.ErrorText = "Dieses Feld muss ausgefüllt werden"
|
||||
Else
|
||||
sender.ErrorText = ""
|
||||
End If
|
||||
End Sub
|
||||
'Private Sub btnPreviewReport_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnPreviewReport.ItemClick
|
||||
' Dim oDocument As Document = GetFocusedDocument()
|
||||
' If oDocument Is Nothing Then
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim oReport As New OrderReport()
|
||||
' Dim oDataSource = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource With {
|
||||
' .DataSource = New Orders.ReportSource With {
|
||||
' .Head = Orders.Helpers.GetOrderHead(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT025)(oDocument.Data),
|
||||
' .Positions = Orders.Helpers.GetOrderPositions(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT025)(oDocument.Data)
|
||||
' }
|
||||
' }
|
||||
' oDataSource.Fill()
|
||||
' oReport.DataSource = oDataSource
|
||||
|
||||
' Dim oReportPrintTool As New ReportPrintTool(oReport)
|
||||
' oReportPrintTool.ShowPreview()
|
||||
'End Sub
|
||||
|
||||
Private Sub btnReloadDocument_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnReloadDocument.ItemClick
|
||||
Dim oResult = MsgBox("Wenn sie das Dokument neu laden, werden alle manuell geänderten Wert verworfen. Wollen Sie fortfahren?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question, Text)
|
||||
|
||||
If oResult = MsgBoxResult.Yes Then
|
||||
Dim oDocument As Document = GetFocusedDocument()
|
||||
|
||||
If oDocument Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
ShowDocument(oDocument)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnDeletePosition_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeletePosition.ItemClick
|
||||
Dim oPosition = GetFocusedPosition()
|
||||
|
||||
If oPosition Is Nothing Then
|
||||
MsgBox("Bitte wählen Sie eine Position aus!", MsgBoxStyle.Exclamation, Text)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oResult = MsgBox($"Wollen Sie die ausgewählte Position Artikel [{oPosition.ArticleNumber}] wirklich löschen?", MsgBoxStyle.Question Or MsgBoxStyle.YesNo, Text)
|
||||
|
||||
If oResult = MsgBoxResult.Yes Then
|
||||
GridViewPositions.DeleteSelectedRows()
|
||||
MsgBox("Position gelöscht")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick
|
||||
MsgBox("Mach et!")
|
||||
End Sub
|
||||
|
||||
Private Sub BarButtonItem6_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs)
|
||||
Dim oUserConfigDirectory = New FileInfo(ConfigManager.UserConfigPath).Directory
|
||||
TryOpenDirectory(oUserConfigDirectory.FullName, "Konfigurationsverzeichnis")
|
||||
End Sub
|
||||
End Class
|
||||
93
EDIDocumentImport/frmMain.Designer.vb
generated
93
EDIDocumentImport/frmMain.Designer.vb
generated
@@ -1,93 +0,0 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmMain
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.LabelControl2 = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.ListBoxControl1 = New DevExpress.XtraEditors.ListBoxControl()
|
||||
Me.ListBoxControl2 = New DevExpress.XtraEditors.ListBoxControl()
|
||||
Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton()
|
||||
CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.ListBoxControl2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'LabelControl1
|
||||
'
|
||||
Me.LabelControl1.Location = New System.Drawing.Point(41, 43)
|
||||
Me.LabelControl1.Name = "LabelControl1"
|
||||
Me.LabelControl1.Size = New System.Drawing.Size(32, 13)
|
||||
Me.LabelControl1.TabIndex = 0
|
||||
Me.LabelControl1.Text = "Import"
|
||||
'
|
||||
'LabelControl2
|
||||
'
|
||||
Me.LabelControl2.Location = New System.Drawing.Point(41, 239)
|
||||
Me.LabelControl2.Name = "LabelControl2"
|
||||
Me.LabelControl2.Size = New System.Drawing.Size(32, 13)
|
||||
Me.LabelControl2.TabIndex = 1
|
||||
Me.LabelControl2.Text = "Export"
|
||||
'
|
||||
'ListBoxControl1
|
||||
'
|
||||
Me.ListBoxControl1.Location = New System.Drawing.Point(41, 62)
|
||||
Me.ListBoxControl1.Name = "ListBoxControl1"
|
||||
Me.ListBoxControl1.Size = New System.Drawing.Size(600, 126)
|
||||
Me.ListBoxControl1.TabIndex = 2
|
||||
'
|
||||
'ListBoxControl2
|
||||
'
|
||||
Me.ListBoxControl2.Location = New System.Drawing.Point(41, 258)
|
||||
Me.ListBoxControl2.Name = "ListBoxControl2"
|
||||
Me.ListBoxControl2.Size = New System.Drawing.Size(600, 126)
|
||||
Me.ListBoxControl2.TabIndex = 2
|
||||
'
|
||||
'SimpleButton1
|
||||
'
|
||||
Me.SimpleButton1.Location = New System.Drawing.Point(608, 481)
|
||||
Me.SimpleButton1.Name = "SimpleButton1"
|
||||
Me.SimpleButton1.Size = New System.Drawing.Size(137, 44)
|
||||
Me.SimpleButton1.TabIndex = 3
|
||||
Me.SimpleButton1.Text = "SimpleButton1"
|
||||
'
|
||||
'frmMain
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(757, 537)
|
||||
Me.Controls.Add(Me.SimpleButton1)
|
||||
Me.Controls.Add(Me.ListBoxControl2)
|
||||
Me.Controls.Add(Me.ListBoxControl1)
|
||||
Me.Controls.Add(Me.LabelControl2)
|
||||
Me.Controls.Add(Me.LabelControl1)
|
||||
Me.Name = "frmMain"
|
||||
Me.Text = "frmMain"
|
||||
CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.ListBoxControl2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents LabelControl1 As DevExpress.XtraEditors.LabelControl
|
||||
Friend WithEvents LabelControl2 As DevExpress.XtraEditors.LabelControl
|
||||
Friend WithEvents ListBoxControl1 As DevExpress.XtraEditors.ListBoxControl
|
||||
Friend WithEvents ListBoxControl2 As DevExpress.XtraEditors.ListBoxControl
|
||||
Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton
|
||||
End Class
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class frmMain
|
||||
|
||||
End Class
|
||||
115
EDIDocumentImport/frmMandatorSelection.Designer.vb
generated
115
EDIDocumentImport/frmMandatorSelection.Designer.vb
generated
@@ -1,115 +0,0 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class frmMandatorSelection
|
||||
Inherits DevExpress.XtraEditors.XtraForm
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
MyBase.Dispose(disposing)
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMandatorSelection))
|
||||
Me.GridMandators = New DevExpress.XtraGrid.GridControl()
|
||||
Me.ViewMandators = New DevExpress.XtraGrid.Views.Grid.GridView()
|
||||
Me.PanelControl1 = New DevExpress.XtraEditors.PanelControl()
|
||||
Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton()
|
||||
Me.LabelControl1 = New DevExpress.XtraEditors.LabelControl()
|
||||
Me.SimpleButton2 = New DevExpress.XtraEditors.SimpleButton()
|
||||
CType(Me.GridMandators, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.ViewMandators, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.PanelControl1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'GridMandators
|
||||
'
|
||||
Me.GridMandators.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.GridMandators.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GridMandators.MainView = Me.ViewMandators
|
||||
Me.GridMandators.Name = "GridMandators"
|
||||
Me.GridMandators.Size = New System.Drawing.Size(606, 292)
|
||||
Me.GridMandators.TabIndex = 0
|
||||
Me.GridMandators.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ViewMandators})
|
||||
'
|
||||
'ViewMandators
|
||||
'
|
||||
Me.ViewMandators.GridControl = Me.GridMandators
|
||||
Me.ViewMandators.Name = "ViewMandators"
|
||||
'
|
||||
'PanelControl1
|
||||
'
|
||||
Me.PanelControl1.Controls.Add(Me.LabelControl1)
|
||||
Me.PanelControl1.Controls.Add(Me.SimpleButton2)
|
||||
Me.PanelControl1.Controls.Add(Me.SimpleButton1)
|
||||
Me.PanelControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.PanelControl1.Location = New System.Drawing.Point(0, 292)
|
||||
Me.PanelControl1.Name = "PanelControl1"
|
||||
Me.PanelControl1.Size = New System.Drawing.Size(606, 61)
|
||||
Me.PanelControl1.TabIndex = 1
|
||||
'
|
||||
'SimpleButton1
|
||||
'
|
||||
Me.SimpleButton1.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.SimpleButton1.Location = New System.Drawing.Point(465, 6)
|
||||
Me.SimpleButton1.Name = "SimpleButton1"
|
||||
Me.SimpleButton1.Size = New System.Drawing.Size(129, 43)
|
||||
Me.SimpleButton1.TabIndex = 0
|
||||
Me.SimpleButton1.Text = "OK"
|
||||
'
|
||||
'LabelControl1
|
||||
'
|
||||
Me.LabelControl1.Appearance.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.LabelControl1.Appearance.Options.UseFont = True
|
||||
Me.LabelControl1.AutoSizeMode = DevExpress.XtraEditors.LabelAutoSizeMode.Vertical
|
||||
Me.LabelControl1.Location = New System.Drawing.Point(12, 6)
|
||||
Me.LabelControl1.Name = "LabelControl1"
|
||||
Me.LabelControl1.Size = New System.Drawing.Size(312, 45)
|
||||
Me.LabelControl1.TabIndex = 1
|
||||
Me.LabelControl1.Text = "Für das Dokument konnte kein eindeutiger Mandant bestimmt werden. Bitte wählen si" &
|
||||
"e einen Mandanten aus der Liste oder klicken Sie auf Überspringen."
|
||||
'
|
||||
'SimpleButton2
|
||||
'
|
||||
Me.SimpleButton2.DialogResult = System.Windows.Forms.DialogResult.Ignore
|
||||
Me.SimpleButton2.Location = New System.Drawing.Point(330, 6)
|
||||
Me.SimpleButton2.Name = "SimpleButton2"
|
||||
Me.SimpleButton2.Size = New System.Drawing.Size(129, 43)
|
||||
Me.SimpleButton2.TabIndex = 0
|
||||
Me.SimpleButton2.Text = "Überspringen"
|
||||
'
|
||||
'frmMandatorSelection
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(606, 353)
|
||||
Me.Controls.Add(Me.PanelControl1)
|
||||
Me.Controls.Add(Me.GridMandators)
|
||||
Me.IconOptions.SvgImage = CType(resources.GetObject("frmMandatorSelection.IconOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
||||
Me.Name = "frmMandatorSelection"
|
||||
Me.Text = "Mandanten Auswahl"
|
||||
CType(Me.GridMandators, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.ViewMandators, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.PanelControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.PanelControl1.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents GridMandators As DevExpress.XtraGrid.GridControl
|
||||
Friend WithEvents ViewMandators As DevExpress.XtraGrid.Views.Grid.GridView
|
||||
Friend WithEvents PanelControl1 As DevExpress.XtraEditors.PanelControl
|
||||
Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton
|
||||
Friend WithEvents LabelControl1 As DevExpress.XtraEditors.LabelControl
|
||||
Friend WithEvents SimpleButton2 As DevExpress.XtraEditors.SimpleButton
|
||||
End Class
|
||||
@@ -1,10 +0,0 @@
|
||||
Imports ImporterShared.Winline
|
||||
|
||||
Public Class frmMandatorSelection
|
||||
Public Property Mandators As List(Of Mandator)
|
||||
Public Property SelectedMandator As Mandator
|
||||
|
||||
Private Sub frmMandatorSelection_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
MsgBox("TODO: Mach et!")
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,137 +0,0 @@
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
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 ReadOnly _Columns As List(Of String)
|
||||
Private ReadOnly _DataTable As New DataTable
|
||||
Private ReadOnly _Accounts As List(Of Account)
|
||||
Private _DocumentRow 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
|
||||
_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 oDict = New Dictionary(Of String, FieldValue)
|
||||
|
||||
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 FieldValue())
|
||||
Else
|
||||
oDict.Add(oColumn, oField.Value)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
_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
|
||||
_DataTable.Rows.Add(oKV.Key, oKV.Value.Original, oKV.Value.External, oKV.Value.Final)
|
||||
Next
|
||||
|
||||
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
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"></xsd:import>
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute name="type" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute name="mimetype" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute ref="xml:space"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string"></xsd:attribute>
|
||||
<xsd:attribute name="name" type="xsd:string"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"></xsd:attribute>
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"></xsd:attribute>
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"></xsd:attribute>
|
||||
<xsd:attribute ref="xml:space"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -1,31 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31005.135
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ImporterForm", "EDIDocumentImport\ImporterForm.vbproj", "{7AAEC958-955D-4F77-964C-38658684E424}"
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ImporterShared", "ImporterShared\ImporterShared.vbproj", "{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7AAEC958-955D-4F77-964C-38658684E424}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7AAEC958-955D-4F77-964C-38658684E424}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7AAEC958-955D-4F77-964C-38658684E424}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7AAEC958-955D-4F77-964C-38658684E424}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {AD617F4E-5646-4DF2-923B-6EE1E0A5CD95}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,11 +0,0 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class BaseClass
|
||||
Public ReadOnly LogConfig As LogConfig
|
||||
Public ReadOnly Logger As Logger
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pLogger As Logger)
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogger
|
||||
End Sub
|
||||
End Class
|
||||
@@ -1,35 +0,0 @@
|
||||
Public Class Config
|
||||
Public Property ConnectionString As String = ""
|
||||
Public Property Mandators As New List(Of MandatorConfig)
|
||||
|
||||
Public Property InputDirectory As String = ""
|
||||
Public Property OutputDirectory As String = ""
|
||||
|
||||
Public Property SchemaDirectory As String = ""
|
||||
|
||||
Public Property Webservice As New WebServiceConfig()
|
||||
Public Property DefaultYearOverride As Integer = 0
|
||||
|
||||
Public Class WebServiceConfig
|
||||
Public Property BaseUrl As String = "http://127.0.0.1/EWL"
|
||||
Public Property Username As String = "Username"
|
||||
Public Property Password As String = "Password"
|
||||
Public Property ImportBasePath As String = ""
|
||||
Public Property ImportRelativePath As String = ""
|
||||
End Class
|
||||
|
||||
Public Class MandatorConfig
|
||||
Public Property Order As Integer
|
||||
Public Property Name As String
|
||||
Public Property ArticleRegex As String
|
||||
End Class
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetYear() As Integer
|
||||
If DefaultYearOverride > 0 Then
|
||||
Return DefaultYearOverride
|
||||
End If
|
||||
|
||||
Return Now.Year
|
||||
End Function
|
||||
End Class
|
||||
@@ -1,6 +0,0 @@
|
||||
Public Class Constants
|
||||
Public Enum XmlFunction
|
||||
GLN = 1
|
||||
EAN = 2
|
||||
End Enum
|
||||
End Class
|
||||
@@ -1,66 +0,0 @@
|
||||
Imports System.IO
|
||||
|
||||
Namespace Documents
|
||||
Public Class Document
|
||||
Public File As FileInfo
|
||||
Public Mandator As String
|
||||
Public Type As DocumentType
|
||||
Public Selected As Boolean = False
|
||||
|
||||
''' <summary>
|
||||
''' TODO: Set before submitting to web services
|
||||
''' </summary>
|
||||
Public CreatedAt As Date
|
||||
|
||||
|
||||
Public TemplateName As String
|
||||
Public TemplateType As Integer
|
||||
Public [Option] 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
|
||||
Get
|
||||
Return File?.FullName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Name As String
|
||||
Get
|
||||
Return File?.Name
|
||||
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
|
||||
' Public DataOriginal As Object
|
||||
' Public DataOutput As Object
|
||||
' Public DataString As String
|
||||
|
||||
' Public Selected As Boolean = False
|
||||
|
||||
|
||||
' Public Shared Function GetDocumentTypeFromTemplateName(pTemplateName As String) As DocumentType
|
||||
' Return DocumentMatch.TypeMatchingTable.
|
||||
' Where(Function(kv) pTemplateName.Contains(kv.Key)).
|
||||
' Select(Function(kv) kv.Value).
|
||||
' FirstOrDefault()
|
||||
' End Function
|
||||
|
||||
' Public Shared Function GetDocumentSchemaFromDocumentType(pDocumentType As DocumentType) As Type
|
||||
' Return DocumentMatch.SchemaMatchingTable.
|
||||
' Where(Function(kv) pDocumentType = kv.Key).
|
||||
' Select(Function(kv) kv.Value).
|
||||
' FirstOrDefault()
|
||||
' End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,222 +0,0 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Xml.Serialization
|
||||
Imports System.Xml.XPath
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports ImporterShared.Documents
|
||||
Imports ImporterShared.Schemas.Orders
|
||||
|
||||
Namespace Documents
|
||||
Public Class DocumentLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Winline As Winline.Data
|
||||
Private ReadOnly Serializer As Serializer
|
||||
|
||||
Public Files As New List(Of Document)
|
||||
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pWinline As Winline.Data)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
Winline = pWinline
|
||||
Serializer = New Serializer(pLogConfig)
|
||||
End Sub
|
||||
|
||||
Public Function LoadFiles(pInputDirectory) As Boolean
|
||||
If pInputDirectory = String.Empty Then
|
||||
Throw New ArgumentNullException("InputDirectory")
|
||||
End If
|
||||
|
||||
Logger.Info("Loading files from directory [{0}]", pInputDirectory)
|
||||
Files.Clear()
|
||||
|
||||
Try
|
||||
Dim oDirectory As New DirectoryInfo(pInputDirectory)
|
||||
Dim oFiles = oDirectory.GetFiles()
|
||||
|
||||
Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
|
||||
|
||||
For Each oFile In oFiles
|
||||
Dim oDocument = LoadFile(oFile)
|
||||
Files.Add(oDocument)
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(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)
|
||||
Dim oRootElement As XElement = XmlData.GetElement(oDoc, "MESOWebService")
|
||||
|
||||
Dim oTemplateName = XmlData.GetElementAttribute(oRootElement, "Template")
|
||||
Dim oTemplateType = XmlData.GetElementAttribute(oRootElement, "TemplateType")
|
||||
Dim oOption = XmlData.GetElementAttribute(oRootElement, "option")
|
||||
Dim oPrintVoucher = XmlData.GetElementAttribute(oRootElement, "printVoucher")
|
||||
|
||||
Dim oRowElements As List(Of XElement) = oRootElement.Elements.ToList
|
||||
|
||||
|
||||
Dim oRows As New List(Of DocumentRow)
|
||||
|
||||
For Each oElement As XElement In oRowElements
|
||||
Dim oFields As New Dictionary(Of String, DocumentRow.FieldValue)
|
||||
|
||||
Dim oSubElements = oElement.Descendants().ToList()
|
||||
|
||||
For Each oSubElement As XElement In oSubElements
|
||||
oFields.Add(oSubElement.Name.ToString, New DocumentRow.FieldValue With {
|
||||
.Original = oSubElement.Value,
|
||||
.Final = oSubElement.Value
|
||||
})
|
||||
Next
|
||||
|
||||
Dim oRow = New DocumentRow With {
|
||||
.Name = oElement.Name.ToString,
|
||||
.Fields = oFields
|
||||
}
|
||||
|
||||
oRows.Add(oRow)
|
||||
Next
|
||||
|
||||
pDocument.TemplateName = oTemplateName
|
||||
pDocument.TemplateType = oTemplateType
|
||||
pDocument.Rows = oRows
|
||||
pDocument.Option = oOption
|
||||
pDocument.PrintVoucher = oPrintVoucher
|
||||
|
||||
Return pDocument
|
||||
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()
|
||||
|
||||
Dim oMandator = Winline.FindMatchingMandatorFromOrder(pDocument)
|
||||
|
||||
If oMandator Is Nothing Then
|
||||
Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
|
||||
End If
|
||||
|
||||
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()
|
||||
|
||||
If pMandator Is Nothing Then
|
||||
Return pDocument
|
||||
End If
|
||||
|
||||
Dim oHead As DocumentRow = pDocument.Rows.
|
||||
Where(Function(r) r.Name.ToUpper.EndsWith("T025")).
|
||||
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(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
|
||||
oNumberItem.External = oArticleNumber
|
||||
oNumberItem.Final = oArticleNumber
|
||||
End If
|
||||
End Sub).
|
||||
ToList()
|
||||
|
||||
Dim oList As New List(Of DocumentRow) From {oHead}
|
||||
pDocument.Rows = oList.Concat(oPositions).ToList()
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
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 WrapFileInfo(pFileInfo As FileInfo) As Document
|
||||
Return New Document With {.File = pFileInfo}
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,28 +0,0 @@
|
||||
Namespace Documents
|
||||
Public Class DocumentMatch
|
||||
Public Shared Property TypeMatchingTable As New Dictionary(Of String, DocumentType) From {
|
||||
{"orders", DocumentType.Order},
|
||||
{"ordrsp", DocumentType.OrderResponse},
|
||||
{"desadv", DocumentType.DispatchNotification},
|
||||
{"invoic", DocumentType.Invoice}
|
||||
}
|
||||
|
||||
Public Shared Property SchemaMatchingTable As New Dictionary(Of DocumentType, Type) From {
|
||||
{DocumentType.Order, GetType(Schemas.OrderSchema)}
|
||||
}
|
||||
|
||||
Public Shared Function GetDocumentTypeFromTemplateName(pTemplateName As String) As DocumentType
|
||||
Return TypeMatchingTable.
|
||||
Where(Function(kv) pTemplateName.Contains(kv.Key)).
|
||||
Select(Function(kv) kv.Value).
|
||||
FirstOrDefault()
|
||||
End Function
|
||||
|
||||
Public Shared Function GetDocumentSchemaFromDocumentType(pDocumentType As DocumentType) As Type
|
||||
Return SchemaMatchingTable.
|
||||
Where(Function(kv) pDocumentType = kv.Key).
|
||||
Select(Function(kv) kv.Value).
|
||||
FirstOrDefault()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,23 +0,0 @@
|
||||
Public Class DocumentRow
|
||||
''' <summary>
|
||||
''' Tabellen/Elementname aus XML
|
||||
''' </summary>
|
||||
Public Name As 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
|
||||
@@ -1,8 +0,0 @@
|
||||
Namespace Documents
|
||||
Public Enum DocumentType
|
||||
Order ' Auftrag
|
||||
OrderResponse ' Bestellbestätigung
|
||||
DispatchNotification ' Lieferavis/ Eingangs Lieferschein
|
||||
Invoice ' Rechnung
|
||||
End Enum
|
||||
End Namespace
|
||||
@@ -1,146 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ImporterShared</RootNamespace>
|
||||
<AssemblyName>ImporterShared</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>ImporterShared.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>ImporterShared.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AutoMapper, Version=10.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.DataAccess.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Modules.Database">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Filesystem">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Language">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Release\DigitalData.Modules.Language.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Logging">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Release\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BaseClass.vb" />
|
||||
<Compile Include="Config.vb" />
|
||||
<Compile Include="Documents\Document.vb" />
|
||||
<Compile Include="Documents\DocumentMatch.vb" />
|
||||
<Compile Include="Documents\DocumentType.vb" />
|
||||
<Compile Include="Documents\DocumentLoader.vb" />
|
||||
<Compile Include="IEnumerableEx.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Mapper.vb" />
|
||||
<Compile Include="Schemas\Orders\Input.vb" />
|
||||
<Compile Include="Schemas\Orders\Output.vb" />
|
||||
<Compile Include="Schemas\Orders\ReportSource.vb" />
|
||||
<Compile Include="Serializer.vb" />
|
||||
<Compile Include="Winline\Account.vb" />
|
||||
<Compile Include="Winline\Data.vb" />
|
||||
<Compile Include="Winline\Mandator.vb" />
|
||||
<Compile Include="Winline\WebService.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
@@ -1,47 +0,0 @@
|
||||
Imports System.Globalization
|
||||
Imports AutoMapper
|
||||
Imports AutoMapper.Configuration
|
||||
|
||||
Public Class MapperFactory
|
||||
Private Shared MapperConfig As Object
|
||||
|
||||
'Public Shared Function GetMapper() As Mapper
|
||||
' MapperConfig = New MapperConfiguration(CreateMapperConfig())
|
||||
' MapperConfig.AssertConfigurationIsValid()
|
||||
' Return MapperConfig.CreateMapper()
|
||||
'End Function
|
||||
|
||||
'Private Shared Function CreateMapperConfig() As MapperConfigurationExpression
|
||||
' Dim oConfig As New MapperConfigurationExpression()
|
||||
|
||||
' oConfig.CreateMap(Of String, Integer)().ConvertUsing(New IntegerTypeConverter())
|
||||
' oConfig.CreateMap(Of String, Decimal)().ConvertUsing(New DecimalTypeConverter())
|
||||
' oConfig.CreateMap(Of String, DateTime)().ConvertUsing(New DateTimeTypeConverter())
|
||||
' oConfig.CreateMap(Of Schemas.Orders.Input.MESOWebService, Schemas.Orders.Output.MESOWebService)()
|
||||
' oConfig.CreateMap(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT025, Schemas.Orders.Output.MESOWebServiceEXIMVRG_ordersT025)()
|
||||
' oConfig.CreateMap(Of Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT026, Schemas.Orders.Output.MESOWebServiceEXIMVRG_ordersT026)()
|
||||
|
||||
' Return oConfig
|
||||
'End Function
|
||||
|
||||
Private Class DateTimeTypeConverter
|
||||
Implements ITypeConverter(Of String, DateTime)
|
||||
|
||||
Public Function Convert(source As String, destination As Date, context As ResolutionContext) As Date Implements ITypeConverter(Of String, Date).Convert
|
||||
Return System.Convert.ToDateTime(source)
|
||||
End Function
|
||||
End Class
|
||||
Private Class IntegerTypeConverter
|
||||
Implements ITypeConverter(Of String, Integer)
|
||||
Public Function Convert(source As String, destination As Integer, context As ResolutionContext) As Integer Implements ITypeConverter(Of String, Integer).Convert
|
||||
Return System.Convert.ToInt32(source)
|
||||
End Function
|
||||
End Class
|
||||
Private Class DecimalTypeConverter
|
||||
Implements ITypeConverter(Of String, Decimal)
|
||||
Public Function Convert(source As String, destination As Decimal, context As ResolutionContext) As Decimal Implements ITypeConverter(Of String, Decimal).Convert
|
||||
Return System.Convert.ToDecimal(source, CultureInfo.InvariantCulture)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Class
|
||||
62
ImporterShared/My Project/Resources.Designer.vb
generated
62
ImporterShared/My Project/Resources.Designer.vb
generated
@@ -1,62 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
'class via a tool like ResGen or Visual Studio.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("ImporterShared.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set(ByVal value As Global.System.Globalization.CultureInfo)
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
73
ImporterShared/My Project/Settings.Designer.vb
generated
73
ImporterShared/My Project/Settings.Designer.vb
generated
@@ -1,73 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
||||
|
||||
#Region "My.Settings Auto-Save Functionality"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.ImporterShared.My.MySettings
|
||||
Get
|
||||
Return Global.ImporterShared.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,8 +0,0 @@
|
||||
Namespace Schemas
|
||||
Public Class BaseSchema
|
||||
Public Property Template As String
|
||||
Public Property TemplateType As Integer
|
||||
Public Property [Option] As Integer
|
||||
Public Property PrintVoucher As Integer
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,28 +0,0 @@
|
||||
Namespace Schemas.Orders
|
||||
'Public Class Helpers
|
||||
' Public Shared Function GetOrderHead(Of T)(pData As IMesoWebservice) As T
|
||||
' Dim oHead As T = pData.Items.
|
||||
' Where(Function(i) TypeOf i Is T).
|
||||
' FirstOrDefault()
|
||||
' Return oHead
|
||||
' End Function
|
||||
|
||||
' Public Shared Sub SetOrderHead(Of T)(pData As IMesoWebservice, pUpdateFunction As Action(Of T))
|
||||
' Dim oHead As T = pData.Items.
|
||||
' Where(Function(i) TypeOf i Is T).
|
||||
' SetValue(Sub(pObject As T)
|
||||
' pUpdateFunction(pObject)
|
||||
' End Sub).
|
||||
' FirstOrDefault()
|
||||
|
||||
' End Sub
|
||||
|
||||
' Public Shared Function GetOrderPositions(Of T)(pData As IMesoWebservice) As List(Of T)
|
||||
' Dim oPositions As List(Of T) = pData.Items.
|
||||
' Where(Function(i) TypeOf i Is T).
|
||||
' Select(Of T)(Function(i) i).
|
||||
' ToList()
|
||||
' Return oPositions
|
||||
' End Function
|
||||
'End Class
|
||||
End Namespace
|
||||
@@ -1,713 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Xml.Serialization
|
||||
|
||||
'
|
||||
'This source code was auto-generated by xsd, Version=4.8.3928.0.
|
||||
'
|
||||
Namespace Schemas.Orders.Input
|
||||
|
||||
'''<remarks/>
|
||||
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0"),
|
||||
System.SerializableAttribute(),
|
||||
System.Diagnostics.DebuggerStepThroughAttribute(),
|
||||
System.ComponentModel.DesignerCategoryAttribute("code"),
|
||||
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True),
|
||||
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=False)>
|
||||
Partial Public Class MESOWebService
|
||||
|
||||
Private itemsField() As Object
|
||||
|
||||
Private templateTypeField As String
|
||||
|
||||
Private templateField As String
|
||||
|
||||
Private optionField As String
|
||||
|
||||
Private amountField As String
|
||||
|
||||
Private extEntryField As String
|
||||
|
||||
Private printVoucherField As String
|
||||
|
||||
Private extInsertField As String
|
||||
|
||||
Private changeLotSizeField As String
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute("EXIM-VRG_ordersT025", GetType(MESOWebServiceEXIMVRG_ordersT025), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified),
|
||||
System.Xml.Serialization.XmlElementAttribute("EXIM-VRG_ordersT026", GetType(MESOWebServiceEXIMVRG_ordersT026), Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
|
||||
Public Property Items() As Object()
|
||||
Get
|
||||
Return Me.itemsField
|
||||
End Get
|
||||
Set
|
||||
Me.itemsField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property TemplateType() As String
|
||||
Get
|
||||
Return Me.templateTypeField
|
||||
End Get
|
||||
Set
|
||||
Me.templateTypeField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute()>
|
||||
Public Property Template() As String
|
||||
Get
|
||||
Return Me.templateField
|
||||
End Get
|
||||
Set
|
||||
Me.templateField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property [option]() As String
|
||||
Get
|
||||
Return Me.optionField
|
||||
End Get
|
||||
Set
|
||||
Me.optionField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property amount() As String
|
||||
Get
|
||||
Return Me.amountField
|
||||
End Get
|
||||
Set
|
||||
Me.amountField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property extEntry() As String
|
||||
Get
|
||||
Return Me.extEntryField
|
||||
End Get
|
||||
Set
|
||||
Me.extEntryField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property printVoucher() As String
|
||||
Get
|
||||
Return Me.printVoucherField
|
||||
End Get
|
||||
Set
|
||||
Me.printVoucherField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property extInsert() As String
|
||||
Get
|
||||
Return Me.extInsertField
|
||||
End Get
|
||||
Set
|
||||
Me.extInsertField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlAttributeAttribute(DataType:="string")>
|
||||
Public Property ChangeLotSize() As String
|
||||
Get
|
||||
Return Me.changeLotSizeField
|
||||
End Get
|
||||
Set
|
||||
Me.changeLotSizeField = Value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
|
||||
'''<remarks/>
|
||||
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0"), _
|
||||
System.SerializableAttribute(), _
|
||||
System.Diagnostics.DebuggerStepThroughAttribute(), _
|
||||
System.ComponentModel.DesignerCategoryAttribute("code"), _
|
||||
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)> _
|
||||
Partial Public Class MESOWebServiceEXIMVRG_ordersT025
|
||||
|
||||
Private bELEGKEYField As String
|
||||
|
||||
Private fakt_KontonummerField As String
|
||||
|
||||
Private laufnummerField As String
|
||||
|
||||
Private fakt_NameField As String
|
||||
|
||||
Private fakt_StrasseField As String
|
||||
|
||||
Private fakt_PLZField As String
|
||||
|
||||
Private fakt_OrtField As String
|
||||
|
||||
Private fakt_AnsprechpartnerField As String
|
||||
|
||||
Private lief_KontonummerField As String
|
||||
|
||||
Private lief_NameField As String
|
||||
|
||||
Private lief_StrasseField As String
|
||||
|
||||
Private lief_PLZField As String
|
||||
|
||||
Private lief_OrtField As String
|
||||
|
||||
Private belegartField As String
|
||||
|
||||
Private datum_AuftragBestellungField As String
|
||||
|
||||
Private datum_AuftragBestellungFieldSpecified As Boolean
|
||||
|
||||
Private auftragsBestellnummerField As String
|
||||
|
||||
Private leistungsdatumField As String
|
||||
|
||||
Private leistungsdatumFieldSpecified As Boolean
|
||||
|
||||
Private auftragsreferenzField As String
|
||||
|
||||
Private infotextField As String
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="string")> _
|
||||
Public Property BELEGKEY() As String
|
||||
Get
|
||||
Return Me.bELEGKEYField
|
||||
End Get
|
||||
Set
|
||||
Me.bELEGKEYField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_Kontonummer() As String
|
||||
Get
|
||||
Return Me.fakt_KontonummerField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_KontonummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Laufnummer() As String
|
||||
Get
|
||||
Return Me.laufnummerField
|
||||
End Get
|
||||
Set
|
||||
Me.laufnummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_Name() As String
|
||||
Get
|
||||
Return Me.fakt_NameField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_NameField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_Strasse() As String
|
||||
Get
|
||||
Return Me.fakt_StrasseField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_StrasseField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_PLZ() As String
|
||||
Get
|
||||
Return Me.fakt_PLZField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_PLZField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_Ort() As String
|
||||
Get
|
||||
Return Me.fakt_OrtField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_OrtField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Fakt_Ansprechpartner() As String
|
||||
Get
|
||||
Return Me.fakt_AnsprechpartnerField
|
||||
End Get
|
||||
Set
|
||||
Me.fakt_AnsprechpartnerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lief_Kontonummer() As String
|
||||
Get
|
||||
Return Me.lief_KontonummerField
|
||||
End Get
|
||||
Set
|
||||
Me.lief_KontonummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lief_Name() As String
|
||||
Get
|
||||
Return Me.lief_NameField
|
||||
End Get
|
||||
Set
|
||||
Me.lief_NameField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lief_Strasse() As String
|
||||
Get
|
||||
Return Me.lief_StrasseField
|
||||
End Get
|
||||
Set
|
||||
Me.lief_StrasseField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lief_PLZ() As String
|
||||
Get
|
||||
Return Me.lief_PLZField
|
||||
End Get
|
||||
Set
|
||||
Me.lief_PLZField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lief_Ort() As String
|
||||
Get
|
||||
Return Me.lief_OrtField
|
||||
End Get
|
||||
Set
|
||||
Me.lief_OrtField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Belegart() As String
|
||||
Get
|
||||
Return Me.belegartField
|
||||
End Get
|
||||
Set
|
||||
Me.belegartField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute("Datum_Auftrag-Bestellung", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="string")> _
|
||||
Public Property Datum_AuftragBestellung() As String
|
||||
Get
|
||||
Return Me.datum_AuftragBestellungField
|
||||
End Get
|
||||
Set
|
||||
Me.datum_AuftragBestellungField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Datum_AuftragBestellungSpecified() As Boolean
|
||||
Get
|
||||
Return Me.datum_AuftragBestellungFieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.datum_AuftragBestellungFieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute("Auftrags-Bestellnummer", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property AuftragsBestellnummer() As String
|
||||
Get
|
||||
Return Me.auftragsBestellnummerField
|
||||
End Get
|
||||
Set
|
||||
Me.auftragsBestellnummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="string")> _
|
||||
Public Property Leistungsdatum() As String
|
||||
Get
|
||||
Return Me.leistungsdatumField
|
||||
End Get
|
||||
Set
|
||||
Me.leistungsdatumField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property LeistungsdatumSpecified() As Boolean
|
||||
Get
|
||||
Return Me.leistungsdatumFieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.leistungsdatumFieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Auftragsreferenz() As String
|
||||
Get
|
||||
Return Me.auftragsreferenzField
|
||||
End Get
|
||||
Set
|
||||
Me.auftragsreferenzField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Infotext() As String
|
||||
Get
|
||||
Return Me.infotextField
|
||||
End Get
|
||||
Set
|
||||
Me.infotextField = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
|
||||
'''<remarks/>
|
||||
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0"), _
|
||||
System.SerializableAttribute(), _
|
||||
System.Diagnostics.DebuggerStepThroughAttribute(), _
|
||||
System.ComponentModel.DesignerCategoryAttribute("code"), _
|
||||
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true)> _
|
||||
Partial Public Class MESOWebServiceEXIMVRG_ordersT026
|
||||
|
||||
Private bELEGKEYField As String
|
||||
|
||||
Private zeilennummerField As String
|
||||
|
||||
Private datentypField As String
|
||||
|
||||
Private artikelnummerField As String
|
||||
|
||||
Private bezeichnungField As String
|
||||
|
||||
Private notizblockField As String
|
||||
|
||||
Private lieferantenartikelnummerField As String
|
||||
|
||||
Private menge_bestelltField As String
|
||||
|
||||
Private menge_bestelltFieldSpecified As Boolean
|
||||
|
||||
Private menge_geliefertField As String
|
||||
|
||||
Private colliField As String
|
||||
|
||||
Private einzelpreisField As String
|
||||
|
||||
Private einzelpreisFieldSpecified As Boolean
|
||||
|
||||
Private zeilenrabatt1Field As String
|
||||
|
||||
Private zeilenrabatt1FieldSpecified As Boolean
|
||||
|
||||
Private zeilenrabatt2Field As String
|
||||
|
||||
Private zeilenrabatt2FieldSpecified As Boolean
|
||||
|
||||
Private zeilenrabatt3Field As String
|
||||
|
||||
Private zeilenrabatt3FieldSpecified As Boolean
|
||||
|
||||
Private zeilenrabatt4Field As String
|
||||
|
||||
Private zeilenrabatt4FieldSpecified As Boolean
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="string")> _
|
||||
Public Property BELEGKEY() As String
|
||||
Get
|
||||
Return Me.bELEGKEYField
|
||||
End Get
|
||||
Set
|
||||
Me.bELEGKEYField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType:="string")> _
|
||||
Public Property Zeilennummer() As String
|
||||
Get
|
||||
Return Me.zeilennummerField
|
||||
End Get
|
||||
Set
|
||||
Me.zeilennummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Datentyp() As String
|
||||
Get
|
||||
Return Me.datentypField
|
||||
End Get
|
||||
Set
|
||||
Me.datentypField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Artikelnummer() As String
|
||||
Get
|
||||
Return Me.artikelnummerField
|
||||
End Get
|
||||
Set
|
||||
Me.artikelnummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Bezeichnung() As String
|
||||
Get
|
||||
Return Me.bezeichnungField
|
||||
End Get
|
||||
Set
|
||||
Me.bezeichnungField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Notizblock() As String
|
||||
Get
|
||||
Return Me.notizblockField
|
||||
End Get
|
||||
Set
|
||||
Me.notizblockField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Lieferantenartikelnummer() As String
|
||||
Get
|
||||
Return Me.lieferantenartikelnummerField
|
||||
End Get
|
||||
Set
|
||||
Me.lieferantenartikelnummerField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Menge_bestellt() As String
|
||||
Get
|
||||
Return Me.menge_bestelltField
|
||||
End Get
|
||||
Set
|
||||
Me.menge_bestelltField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Menge_bestelltSpecified() As Boolean
|
||||
Get
|
||||
Return Me.menge_bestelltFieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.menge_bestelltFieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Menge_geliefert() As String
|
||||
Get
|
||||
Return Me.menge_geliefertField
|
||||
End Get
|
||||
Set
|
||||
Me.menge_geliefertField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Colli() As String
|
||||
Get
|
||||
Return Me.colliField
|
||||
End Get
|
||||
Set
|
||||
Me.colliField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Einzelpreis() As String
|
||||
Get
|
||||
Return Me.einzelpreisField
|
||||
End Get
|
||||
Set
|
||||
Me.einzelpreisField = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property EinzelpreisSpecified() As Boolean
|
||||
Get
|
||||
Return Me.einzelpreisFieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.einzelpreisFieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Zeilenrabatt1() As String
|
||||
Get
|
||||
Return Me.zeilenrabatt1Field
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt1Field = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Zeilenrabatt1Specified() As Boolean
|
||||
Get
|
||||
Return Me.zeilenrabatt1FieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt1FieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Zeilenrabatt2() As String
|
||||
Get
|
||||
Return Me.zeilenrabatt2Field
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt2Field = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Zeilenrabatt2Specified() As Boolean
|
||||
Get
|
||||
Return Me.zeilenrabatt2FieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt2FieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Zeilenrabatt3() As String
|
||||
Get
|
||||
Return Me.zeilenrabatt3Field
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt3Field = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Zeilenrabatt3Specified() As Boolean
|
||||
Get
|
||||
Return Me.zeilenrabatt3FieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt3FieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _
|
||||
Public Property Zeilenrabatt4() As String
|
||||
Get
|
||||
Return Me.zeilenrabatt4Field
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt4Field = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
'''<remarks/>
|
||||
<System.Xml.Serialization.XmlIgnoreAttribute()> _
|
||||
Public Property Zeilenrabatt4Specified() As Boolean
|
||||
Get
|
||||
Return Me.zeilenrabatt4FieldSpecified
|
||||
End Get
|
||||
Set
|
||||
Me.zeilenrabatt4FieldSpecified = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
|
||||
Namespace Schemas
|
||||
|
||||
''' <summary>
|
||||
''' XML Schema to import the Data-Files
|
||||
''' </summary>
|
||||
Public Class OrderSchema
|
||||
Inherits BaseSchema
|
||||
|
||||
<Description("EXIM-VRG_ordersT025")>
|
||||
Public Property Head As New OrderHead
|
||||
|
||||
<Description("EXIM-VRG_ordersT026")>
|
||||
Public Property Positions As New List(Of OrderPosition)
|
||||
|
||||
|
||||
Public Class OrderHead
|
||||
<Description("BELEGKEY")>
|
||||
Public Property DocumentKey As String
|
||||
<Description("Fakt_Kontonummer")>
|
||||
Public Property AccountNumber As String
|
||||
<Description("Laufnummer")>
|
||||
Public Property RunningNumber As String
|
||||
<Description("Bestellt_von")>
|
||||
Public Property OrderedBy As String
|
||||
<Description("Lief_Kontonummer")>
|
||||
Public Property AccountNumber2 As String
|
||||
<Description("Belegart")>
|
||||
Public Property DocumentType As Integer
|
||||
<Description("Datum_Auftrag-Bestellung")>
|
||||
Public Property OrderDate As Date
|
||||
<Description("Auftrags-Bestellnummer")>
|
||||
Public Property OrderNumber As String
|
||||
<Description("Infotext")>
|
||||
Public Property InfoText As String
|
||||
End Class
|
||||
|
||||
|
||||
Public Class OrderPosition
|
||||
<Description("BELEGKEY")>
|
||||
Public Property DocumentKey As String
|
||||
<Description("Zeilennummer")>
|
||||
Public Property LineNumber As String
|
||||
<Description("Artikelnummer")>
|
||||
Public Property ArticleNumber As String
|
||||
<Description("Bezeichnung")>
|
||||
Public Property ArticleDescription As String
|
||||
<Description("Lieferantenartikelnummer")>
|
||||
Public Property VendorNumber As String
|
||||
End Class
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,21 +0,0 @@
|
||||
Imports DevExpress.DataAccess.ObjectBinding
|
||||
Imports System.Collections.Generic
|
||||
Imports System.ComponentModel
|
||||
|
||||
Namespace Schemas.Orders
|
||||
<DisplayName("OrdersReport"), HighlightedClass>
|
||||
Public Class ReportSource
|
||||
<HighlightedMember>
|
||||
Public Property Head As Orders.Input.MESOWebServiceEXIMVRG_ordersT025
|
||||
|
||||
<HighlightedMember>
|
||||
Public Property Positions As IEnumerable(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026)
|
||||
|
||||
<HighlightedMember>
|
||||
Public Iterator Function GetPositionList() As IEnumerable(Of Orders.Input.MESOWebServiceEXIMVRG_ordersT026)
|
||||
For Each oPosition In Positions
|
||||
Yield oPosition
|
||||
Next
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,28 +0,0 @@
|
||||
Namespace Schemas
|
||||
Public Class Schema
|
||||
|
||||
Public Enum ColumnType As Integer
|
||||
[String]
|
||||
[Integer]
|
||||
[Date]
|
||||
[Boolean]
|
||||
[Decimal]
|
||||
End Enum
|
||||
|
||||
Public Property Tables As New List(Of Table)
|
||||
Public Property Name As String
|
||||
|
||||
Class Table
|
||||
Public Property Name As String
|
||||
Public Property Columns As New List(Of Column)
|
||||
End Class
|
||||
|
||||
Class Column
|
||||
Public Property Name As String
|
||||
Public Property Required As String
|
||||
Public Property DataType As ColumnType
|
||||
End Class
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
Imports System.IO
|
||||
Imports System.Xml
|
||||
Imports System.Xml.XPath
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace Schemas
|
||||
Public Class SchemaLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Private ns As XNamespace = "http://www.w3.org/2001/XMLSchema"
|
||||
|
||||
Public SchemaList As List(Of FileInfo)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger)
|
||||
End Sub
|
||||
|
||||
Public Function LoadFiles(pSchemaDirectory) As Boolean
|
||||
If pSchemaDirectory = String.Empty Then
|
||||
Throw New ArgumentNullException("SchemaDirectory")
|
||||
End If
|
||||
|
||||
Logger.Info("Loading files from directory [{0}]", pSchemaDirectory)
|
||||
|
||||
Try
|
||||
Dim oDirectory As New DirectoryInfo(pSchemaDirectory)
|
||||
Dim oFiles = oDirectory.GetFiles()
|
||||
|
||||
Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
|
||||
|
||||
SchemaList = oFiles.ToList()
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw New IO.IOException($"Could not load files from directory {pSchemaDirectory}", ex)
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetSchemaFromFile(pSchemaFilePath As String) As Schema
|
||||
Dim oSchema As New Schema
|
||||
Dim oElements = GetSchemaElements(pSchemaFilePath)
|
||||
|
||||
For Each oElement In oElements
|
||||
Dim oColumns = GetElementColumns(oElement)
|
||||
Dim oSchemaColumns As New List(Of Schema.Column)
|
||||
|
||||
For Each oColumn As XElement In oColumns
|
||||
Dim oName = XmlData.GetElementAttribute(oColumn, "name")
|
||||
Dim oMinOccurs = XmlData.GetElementAttribute(oColumn, "minOccurs")
|
||||
Dim oMaxOccurs = XmlData.GetElementAttribute(oColumn, "maxOccurs")
|
||||
Dim oType = GetElementType(oColumn)
|
||||
Dim oRequired = False
|
||||
|
||||
If oMinOccurs = 1 And oMaxOccurs = 1 Then
|
||||
oRequired = True
|
||||
End If
|
||||
|
||||
Dim oSchemaColumn As New Schema.Column With {
|
||||
.Name = oName,
|
||||
.Required = oRequired,
|
||||
.DataType = oType
|
||||
}
|
||||
oSchemaColumns.Add(oSchemaColumn)
|
||||
Next
|
||||
|
||||
oSchema.Tables.Add(New Schema.Table With {
|
||||
.Name = XmlData.GetElementAttribute(oElement, "name"),
|
||||
.Columns = oSchemaColumns
|
||||
})
|
||||
|
||||
Next
|
||||
|
||||
Return oSchema
|
||||
End Function
|
||||
|
||||
Public Function GetElementType(pElement As XElement) As Schema.ColumnType
|
||||
Dim oTypeString = XmlData.GetElementAttribute(pElement, "type")
|
||||
|
||||
If oTypeString Is Nothing Then
|
||||
Dim oRestrictionElement As XElement = pElement.
|
||||
Descendants(ns + "restriction").
|
||||
FirstOrDefault()
|
||||
|
||||
oTypeString = XmlData.GetElementAttribute(oRestrictionElement, "base")
|
||||
End If
|
||||
|
||||
Select Case oTypeString
|
||||
Case "xs:date"
|
||||
Return Schema.ColumnType.Date
|
||||
Case "xs:integer"
|
||||
Return Schema.ColumnType.Integer
|
||||
Case "xs:decimal"
|
||||
Return Schema.ColumnType.Decimal
|
||||
Case "xs:boolean"
|
||||
Return Schema.ColumnType.Boolean
|
||||
Case Else
|
||||
Return Schema.ColumnType.String
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function GetSchemaElements(pSchemaFilePath As String) As List(Of XElement)
|
||||
Dim oText As String = IO.File.ReadAllText(pSchemaFilePath)
|
||||
Dim oDoc = XDocument.Parse(oText)
|
||||
|
||||
Return XmlData.GetElementsFromElement(oDoc, "choice", ns)
|
||||
End Function
|
||||
|
||||
Public Function GetElementColumns(pElement As XElement) As List(Of XElement)
|
||||
Return XmlData.GetElementsFromElement(pElement, "sequence", ns)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,579 +0,0 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports ImporterShared
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
|
||||
Namespace Winline
|
||||
Public Class Data
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Database As MSSQLServer
|
||||
Private ReadOnly Config As Config
|
||||
|
||||
Public Accounts As New List(Of Account)
|
||||
Public Mandators As New List(Of Mandator)
|
||||
Public DocumentKinds As New List(Of DocumentKind)
|
||||
Public Years As List(Of Integer)
|
||||
Public TemplateConfiguration As New List(Of TemplateColumn)
|
||||
|
||||
'Public XmlConfigHead As List(Of TemplateColumn)
|
||||
'Public XmlConfigPositions As List(Of TemplateColumn)
|
||||
|
||||
Public Const ALL_MESOCOMP = "mesocomp"
|
||||
|
||||
Public Const V21_ARTICLENUMBER = "c011"
|
||||
Public Const V21_REPLACEMENTARTICLENUMBER = "c123"
|
||||
|
||||
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"
|
||||
Public Const T45_CONTACTNUMBER = "c063"
|
||||
|
||||
Public Const V05_ACCOUNTID = "c002"
|
||||
Public Const V05_ACCOUNTNAME = "c003"
|
||||
|
||||
Public Const T357_KINDID = "c030"
|
||||
Public Const T357_KINDNAME = "c001"
|
||||
|
||||
Public Const T01_DATABASEINFO = "c004"
|
||||
Public Const T01_MANDATORID = "c000"
|
||||
Public Const T01_MANDATORNAME = "c003"
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pConfig As Config)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
Database = pDatabase
|
||||
Config = pConfig
|
||||
End Sub
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetWinLineYear(pYear As Integer)
|
||||
Return (pYear - 1900) * 12
|
||||
End Function
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetWinLineYear()
|
||||
Return GetWinLineYear(Config.GetYear)
|
||||
End Function
|
||||
|
||||
Public Sub LoadAccounts(pMandator As Mandator)
|
||||
Logger.Info("Loading Accounts for Mandator [{0}]", pMandator)
|
||||
Dim oYear = GetWinLineYear()
|
||||
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
SELECT DISTINCT
|
||||
[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}'
|
||||
AND mesoyear = {oYear}"
|
||||
Dim oTable = Database.GetDatatable(oSQL)
|
||||
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 = oAccountNumber,
|
||||
.Name = oAccountName,
|
||||
.StreetName = oStreetName,
|
||||
.ZipCode = oZipCode,
|
||||
.CityName = oCityName,
|
||||
.Mandator = pMandator.Id
|
||||
})
|
||||
Next
|
||||
Accounts.AddRange(oAccounts)
|
||||
|
||||
Logger.Info("[{0}] Accounts loaded for Mandator [{1}]", oAccounts.Count, pMandator)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not load Accounts for Mandator [{0}]", pMandator)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub LoadMandators()
|
||||
Try
|
||||
Dim oSQL = "SELECT [c000], [c003], [c004] FROM [cwlsystem].[dbo].[T001SRV] (NOLOCK)"
|
||||
Dim oTable = Database.GetDatatable(oSQL)
|
||||
|
||||
Mandators.Clear()
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oDbInfo = SplitConnectionInfo(oRow)
|
||||
Dim oMandator = New Mandator With {
|
||||
.Id = oRow.Item(T01_MANDATORID),
|
||||
.Name = oRow.Item(T01_MANDATORNAME),
|
||||
.Database = oDbInfo.Item1,
|
||||
.Server = oDbInfo.Item2
|
||||
}
|
||||
|
||||
Dim oMandatorConfig As Config.MandatorConfig = Config.Mandators.
|
||||
Where(Function(m) oMandator.Id = m.Name).
|
||||
SingleOrDefault()
|
||||
|
||||
If oMandatorConfig IsNot Nothing Then
|
||||
oMandator.IsWhitelisted = True
|
||||
oMandator.Regex = oMandatorConfig.ArticleRegex
|
||||
oMandator.Order = oMandatorConfig.Order
|
||||
End If
|
||||
|
||||
|
||||
Mandators.Add(oMandator)
|
||||
Next
|
||||
|
||||
Logger.Info("[{0}] Mandators loaded", Mandators.Count)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not load Mandators")
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub LoadEconomicYears()
|
||||
Dim oCurrentYear = Now.Year
|
||||
Dim oRange As IEnumerable(Of Integer) = Enumerable.Range(oCurrentYear - 10, 12).ToList()
|
||||
Years = oRange
|
||||
End Sub
|
||||
|
||||
Public Sub LoadDocumentKinds(pMandators As List(Of Mandator))
|
||||
Dim oDocumentKinds As New List(Of DocumentKind)
|
||||
Dim oMandatorString = String.Join(",", pMandators.Select(Function(m) $"'{m.Id}'").ToArray)
|
||||
Dim oYear As Integer = GetWinLineYear()
|
||||
DocumentKinds.Clear()
|
||||
|
||||
For Each oMandator As Mandator In pMandators
|
||||
Try
|
||||
Dim oSQL = $"
|
||||
SELECT
|
||||
[c030],
|
||||
[c001],
|
||||
[mesocomp]
|
||||
FROM [{oMandator.Database}].[dbo].[t357] (NOLOCK)
|
||||
WHERE (
|
||||
[c001] LIKE 'Werk%(VK)' OR
|
||||
[c001] LIKE 'Werk%(WK)'
|
||||
)
|
||||
AND [mesocomp] = '{oMandator.Id}' AND [mesoyear] = {oYear}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Logger.Warn("No DocumentKinds found for Mandator [{0}]", oMandator.Id)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
oDocumentKinds.Add(New DocumentKind With {
|
||||
.Id = oRow.Item(T357_KINDID),
|
||||
.Name = oRow.Item(T357_KINDNAME),
|
||||
.Mandator = oRow.Item(ALL_MESOCOMP)
|
||||
})
|
||||
Next
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not load DocumentKinds")
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
Next
|
||||
|
||||
DocumentKinds = oDocumentKinds.ToList()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function TryGetAccount(pGLN As String, pMandator As Mandator) As Account
|
||||
Try
|
||||
If pGLN Is Nothing OrElse pGLN = String.Empty Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oYear As Integer = GetWinLineYear()
|
||||
Dim oSQL = $"
|
||||
SELECT
|
||||
[c002], -- Kundennummer
|
||||
[c003], -- Kundenname
|
||||
[c050], -- Straße
|
||||
[c052], -- Ort
|
||||
[c051] -- PLZ
|
||||
FROM [{pMandator.Database}].[dbo].[v050]
|
||||
WHERE [c004] = 2 -- KontoTyp
|
||||
AND [c260] = '{pGLN}'
|
||||
AND [mesocomp] = '{pMandator.Id}' and [mesoyear] = {oYear}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
|
||||
' GLN not found in this Mandator, continue to next one
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Logger.Debug("GLN [{0}] was not found in Mandator: [{1}]", pGLN, pMandator.Id)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
' Duplicate GLN, exit and do nothing about this number
|
||||
If oTable.Rows.Count > 1 Then
|
||||
Logger.Warn("GLN [{0}] was found more than once in Mandator: [{1}]", pGLN, pMandator.Id)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
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
|
||||
Logger.Warn("Error while trying to get account for GLN [{0}]", pGLN)
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function TryGetArticleNumber(pEAN As String, pMandator As Mandator) As String
|
||||
Try
|
||||
Dim oYear As Integer = GetWinLineYear()
|
||||
Dim oSQL As String = $"
|
||||
SELECT
|
||||
[c011], -- Artikelnummer
|
||||
[c003], -- Artikelbezeichnung
|
||||
[c075], -- EAN-Nummer
|
||||
[c123] -- Ersatzartikelnummer
|
||||
FROM [{pMandator.Database}].[dbo].[v021]
|
||||
WHERE [c075] = '{pEAN}'
|
||||
AND [mesocomp] = '{pMandator.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}]", pEAN, pMandator.Id)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
' Duplicate EAN, exit and do nothing about this number
|
||||
If oTable.Rows.Count > 1 Then
|
||||
Logger.Warn("EAN [{0}] was found more than once", pEAN)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
||||
Dim oArticleNumber As String = Utils.NotNull(oRow.Item(V21_ARTICLENUMBER), String.Empty)
|
||||
Return oArticleNumber
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetContacts(pAccountNumber As String, pMandator As Mandator) As List(Of Contact)
|
||||
Try
|
||||
Dim oContacts As New List(Of Contact)
|
||||
Dim oYear As Integer = GetWinLineYear()
|
||||
Dim oSQL As String = $"
|
||||
SELECT
|
||||
[c000], -- Key
|
||||
[c001], -- Name
|
||||
[c063] -- Kontaktnummer
|
||||
FROM [{pMandator.Database}].[dbo].[t045]
|
||||
WHERE [c063] LIKE '{pAccountNumber}-%'
|
||||
AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
|
||||
' Contact not found in this Mandator, continue to next one
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Logger.Debug("Contact for Account [{0}] was not found in Mandator: [{1}]", pAccountNumber, pMandator.Id)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
For Each oRow In oTable.Rows
|
||||
oContacts.Add(New Contact With {
|
||||
.Id = Utils.NotNull(oRow.Item(T45_KEY), Nothing),
|
||||
.Name = Utils.NotNull(oRow.Item(T45_NAME), Nothing),
|
||||
.Number = Utils.NotNull(oRow.Item(T45_CONTACTNUMBER), Nothing)
|
||||
})
|
||||
Next
|
||||
|
||||
Return oContacts
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetReplacementArticleNumber(pArticleNumber As String, pMandator As Mandator)
|
||||
Try
|
||||
Dim oYear As Integer = GetWinLineYear()
|
||||
Dim oSQL As String = $"
|
||||
SELECT
|
||||
[c011], -- Artikelnummer
|
||||
[c003], -- Artikelbezeichnung
|
||||
[c075], -- EAN-Nummer
|
||||
[c123] -- Ersatzartikelnummer
|
||||
FROM [{pMandator.Database}].[dbo].[v021]
|
||||
WHERE [c011] = '{pArticleNumber}'
|
||||
AND [mesocomp] = '{pMandator.Id}' AND [mesoyear] = {oYear}"
|
||||
Dim oTable As DataTable = Database.GetDatatable(oSQL)
|
||||
|
||||
' ArticleNumber not found in this Mandator, continue to next one
|
||||
If oTable.Rows.Count = 0 Then
|
||||
Logger.Debug("ArticleNumber [{0}] was not found in Mandator: [{1}]", pArticleNumber, pMandator.Id)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
' Duplicate EAN, exit and do nothing about this number
|
||||
If oTable.Rows.Count > 1 Then
|
||||
Logger.Warn("ArticleNumber [{0}] was found more than once", pArticleNumber)
|
||||
Return Nothing
|
||||
|
||||
End If
|
||||
|
||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
||||
Dim oReplacementArticleNumber = Utils.NotNull(oRow.Item(V21_REPLACEMENTARTICLENUMBER), Nothing)
|
||||
|
||||
If oReplacementArticleNumber Is Nothing Then
|
||||
Return pArticleNumber
|
||||
End If
|
||||
|
||||
Return GetReplacementArticleNumber(oReplacementArticleNumber, pMandator)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function FindMatchingMandatorFromOrder(pData As Documents.Document) As Mandator
|
||||
Dim oPositions = pData.Rows.
|
||||
Where(Function(r) r.Name.ToUpper.EndsWith("T026")).
|
||||
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 oMandatorId As String = String.Empty
|
||||
Dim oWhitelistedMandators = Mandators.
|
||||
Where(Function(m) m.IsWhitelisted = True).
|
||||
ToList()
|
||||
|
||||
For Each oEANNumber In oEANNumbers
|
||||
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] = '{oEANNumber}'
|
||||
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}]", oEANNumber, 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}]", oEANNumber, 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 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
|
||||
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 oItems As New List(Of TemplateColumn)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oColumn As New TemplateColumn With {
|
||||
.Name = oRow.Item("XML_NAME"),
|
||||
.Root = oRow.Item("XML_ROOT"),
|
||||
.Type = oRow.Item("XML_TYPE"),
|
||||
.Template = oRow.Item("TEMPLATE_NAME"),
|
||||
.[Function] = oRow.Item("FUNCTION_ID"),
|
||||
.[ReadOnly] = oRow.Item("READ_ONLY")
|
||||
}
|
||||
|
||||
oItems.Add(oColumn)
|
||||
Next
|
||||
|
||||
TemplateConfiguration = oItems
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Turns a database info like "SQLCWLDATEN on SERVER\INSTANCE" into a Tuple of two strings
|
||||
''' </summary>
|
||||
''' <param name="pRow"></param>
|
||||
''' <returns></returns>
|
||||
Private Function SplitConnectionInfo(pRow As DataRow) As Tuple(Of String, String)
|
||||
Dim oDbInfo = pRow.Item(T01_DATABASEINFO).ToString()
|
||||
Dim oSplittedInfo = SplitAtString(oDbInfo.ToUpper, "ON")
|
||||
Dim oServer = oSplittedInfo.Item(1).Trim()
|
||||
|
||||
Dim oDatabase = oSplittedInfo.Item(0).Trim()
|
||||
If oDatabase.StartsWith("SQL") Then
|
||||
oDatabase = oDatabase.Remove(0, 3)
|
||||
End If
|
||||
|
||||
Return New Tuple(Of String, String)(oDatabase, oServer)
|
||||
End Function
|
||||
|
||||
Private Function SplitAtString(pStringToSplit As String, pDelimiter As String) As List(Of String)
|
||||
Dim oDelimiter As String() = New String(0) {pDelimiter}
|
||||
Return pStringToSplit.
|
||||
Split(oDelimiter, StringSplitOptions.None).
|
||||
ToList()
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -1,12 +0,0 @@
|
||||
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,259 +0,0 @@
|
||||
Imports System.Xml
|
||||
Imports System.Net
|
||||
Imports System.Net.Http
|
||||
Imports System.Globalization
|
||||
Imports AutoMapper
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Filesystem
|
||||
Imports ImporterShared.Documents
|
||||
Imports System.Text
|
||||
|
||||
Namespace Winline
|
||||
Public Class WebService
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Config As Config
|
||||
Private ReadOnly Serializer As Serializer
|
||||
Private ReadOnly Mapper As AutoMapper.Mapper
|
||||
Private ReadOnly FileEx As File
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pConfig As Config)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
FileEx = New File(pLogConfig)
|
||||
Serializer = New Serializer(pLogConfig)
|
||||
Config = pConfig
|
||||
'Mapper = MapperFactory.GetMapper()
|
||||
End Sub
|
||||
|
||||
Public Async Function TransferDocumentToWinline(pDocument As Document) As Task(Of Boolean)
|
||||
Dim oBytes As Byte() = GetBytesFromDocument(pDocument)
|
||||
Dim oWS As Config.WebServiceConfig = Config.Webservice
|
||||
|
||||
' --- 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
|
||||
|
||||
' --- Build all teh filenamez and pathz
|
||||
|
||||
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)
|
||||
|
||||
' 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
|
||||
|
||||
Dim oOutputFilePath = IO.Path.Combine(GetBaseWebServicePath(), oFileName)
|
||||
IO.File.WriteAllBytes(oOutputFilePath, oBytes)
|
||||
|
||||
' --- Copy file to Winline Import Directory
|
||||
|
||||
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
|
||||
|
||||
' 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
|
||||
|
||||
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)
|
||||
|
||||
' --- 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
|
||||
|
||||
Private Async Function HandleResponse(pResponse As HttpResponseMessage, pPath As String, pBaseFileNAme As String) As Task
|
||||
pResponse.EnsureSuccessStatusCode()
|
||||
Dim oResponseBody As String = Await pResponse.Content.ReadAsStringAsync()
|
||||
Dim oContentType = pResponse.Content.Headers.ContentType.MediaType
|
||||
Dim oSerializer = Serializer.GetSerializer(GetType(Schemas.MESOWebServiceResult))
|
||||
|
||||
Select Case oContentType
|
||||
Case "text/xml"
|
||||
WriteResponseFile(pPath, pBaseFileNAme, oResponseBody, "xml")
|
||||
|
||||
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
|
||||
|
||||
If oDetails.Success = True Then
|
||||
Logger.Info("KeyValue: [{0}]", oDetails.KeyValue)
|
||||
Logger.Info("VoucherNumber: [{0}]", oDetails.VoucherNumber)
|
||||
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
|
||||
Dim oMessage = $"Request to Webservice was unsuccessful:{vbNewLine}{vbNewLine}{String.Join(vbNewLine, oErrorStrings.ToArray)}"
|
||||
|
||||
Throw New ApplicationException(oMessage)
|
||||
End If
|
||||
End Using
|
||||
|
||||
Case "text/html"
|
||||
WriteResponseFile(pPath, pBaseFileNAme, oResponseBody, "txt")
|
||||
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
|
||||
Case Else
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function WriteResponseFile(pPath As String, pBaseFileName As String, pResponseBody As String, pExtension As String)
|
||||
Try
|
||||
Dim oRequestFileName As String = GetXmlFilenameWithSuffix(pBaseFileName, "Response", pExtension)
|
||||
Dim oFilePath As String = IO.Path.Combine(pPath, oRequestFileName)
|
||||
IO.File.WriteAllText(oFilePath, pResponseBody)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
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)
|
||||
|
||||
' Dim oItems = oData.Items.
|
||||
' Select(Function(i)
|
||||
' If TypeOf i Is Schemas.Orders.Input.MESOWebServiceEXIMVRG_ordersT025 Then
|
||||
' Return Mapper.Map(Of Schemas.Orders.Output.MESOWebServiceEXIMVRG_ordersT025)(i)
|
||||
' Else
|
||||
' Return Mapper.Map(Of Schemas.Orders.Output.MESOWebServiceEXIMVRG_ordersT026)(i)
|
||||
' End If
|
||||
' End Function).
|
||||
' ToList()
|
||||
|
||||
' oResult.Items = oItems.ToArray()
|
||||
' Return oResult
|
||||
'End Function
|
||||
|
||||
'Private Function SerializeOrder(pData As Schemas.Orders.Output.MESOWebService, pFileName As String) As String
|
||||
' Dim oSerializer = Serializer.GetSerializer(GetType(Schemas.Orders.Output.MESOWebService))
|
||||
' Dim oPath As String = GetBaseWebServicePath()
|
||||
' Dim oFilePath As String = IO.Path.Combine(oPath, pFileName)
|
||||
|
||||
' Using oWriter = XmlWriter.Create(oFilePath, New XmlWriterSettings With {.Indent = True})
|
||||
' oSerializer.Serialize(oWriter, pData)
|
||||
' End Using
|
||||
|
||||
' Return oFilePath
|
||||
'End Function
|
||||
|
||||
Private Function GetBaseWebServicePath() As String
|
||||
Return IO.Path.Combine(FileEx.GetAppDataPath("Digital Data", "EDI Document Importer"), "WebService")
|
||||
End Function
|
||||
|
||||
Private Function GetBaseFilenameForRequest() As String
|
||||
Return $"{Now:yyyy-MM-dd_hh-mm-ffff}"
|
||||
End Function
|
||||
|
||||
Private Function GetXmlFilenameWithSuffix(pBaseString As String, pSuffix As String, pExtension As String)
|
||||
Return $"{pBaseString}-{pSuffix}.{pExtension}"
|
||||
End Function
|
||||
|
||||
Private Function GetDateSubDirectoryPath(pBasePath As String)
|
||||
Dim oDirectoryPath As String = Now.ToString("yyyy\\MM\\dd")
|
||||
Dim oFullPath As String = IO.Path.Combine(pBasePath, oDirectoryPath)
|
||||
|
||||
If IO.Directory.Exists(oFullPath) = False Then
|
||||
Try
|
||||
IO.Directory.CreateDirectory(oFullPath)
|
||||
Return oFullPath
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
Else
|
||||
Return oFullPath
|
||||
End If
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
17
MultiTool.Common/BaseClass.vb
Normal file
17
MultiTool.Common/BaseClass.vb
Normal file
@@ -0,0 +1,17 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class BaseClass
|
||||
Inherits DigitalData.Modules.Base.BaseClass
|
||||
|
||||
Friend Database As MSSQLServer
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
|
||||
MyBase.New(pLogConfig)
|
||||
Database = pDatabase
|
||||
End Sub
|
||||
End Class
|
||||
10
MultiTool.Common/Config.vb
Normal file
10
MultiTool.Common/Config.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Imports DigitalData.Modules.Config.ConfigAttributes
|
||||
|
||||
Public Class Config
|
||||
<ConnectionString>
|
||||
Public Property ConnectionString As String = ""
|
||||
Public Property LastUsedMandator As String = ""
|
||||
Public Property Debug As Boolean = False
|
||||
Public Property AutomaticPriceCalculation As Boolean = True
|
||||
Public Property AutomaticLoadingOnFormOpen As Boolean = False
|
||||
End Class
|
||||
104
MultiTool.Common/Constants.vb
Normal file
104
MultiTool.Common/Constants.vb
Normal file
@@ -0,0 +1,104 @@
|
||||
Public Class Constants
|
||||
Public Const HTTP_REQUEST_TIMEOUT_IN_SECONDS = 60
|
||||
|
||||
Public Const COLUMN_GUID = "GUID"
|
||||
|
||||
Public Const FUNCTION_GLN = "GLN"
|
||||
Public Const FUNCTION_EAN = "EAN"
|
||||
Public Const FUNCTION_PRICE = "PRICE"
|
||||
Public Const FUNCTION_SQL = "SQL"
|
||||
Public Const FUNCTION_FIELD = "FIELD"
|
||||
Public Const FUNCTION_RUNNINGNUMBER = "RUNNINGNUMBER"
|
||||
Public Const FUNCTION_ADDRESS = "ADDRESS"
|
||||
|
||||
Public Const PLACEHOLDER_CONST = "CONST"
|
||||
Public Const PLACEHOLDER_FIELD = "FIELD"
|
||||
|
||||
Public Const TEMPLATE_TYPE_DATE = "xs:date"
|
||||
Public Const TEMPLATE_TYPE_INTEGER = "xs:integer"
|
||||
Public Const TEMPLATE_TYPE_DECIMAL = "xs:decimal"
|
||||
Public Const TEMPLATE_TYPE_BOOLEAN = "xs:boolean"
|
||||
|
||||
Public Const DB_TYPE_DATE = "DATE"
|
||||
Public Const DB_TYPE_INTEGER = "INTEGER"
|
||||
Public Const DB_TYPE_DECIMAL = "DECIMAL"
|
||||
Public Const DB_TYPE_BOOLEAN = "BOOLEAN"
|
||||
|
||||
Public Const ALL_MESOCOMP = "mesocomp"
|
||||
|
||||
Public Const V21_ARTICLENUMBER = "c002"
|
||||
Public Const V21_ARTICLEDESCRIPTION = "c003"
|
||||
Public Const V21_MAINARTICLENUMBER = "c011"
|
||||
Public Const V21_REPLACEMENTARTICLENUMBER = "c123"
|
||||
Public Const V21_EAN = "c075"
|
||||
|
||||
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 V50_GLN = "c260"
|
||||
|
||||
Public Const T45_KEY = "c000"
|
||||
Public Const T45_NAME = "c001"
|
||||
Public Const T45_CONTACTNUMBER = "c063"
|
||||
|
||||
Public Const V05_ACCOUNTID = "c002"
|
||||
Public Const V05_ACCOUNTNAME = "c003"
|
||||
|
||||
Public Const T357_KINDID = "c030"
|
||||
Public Const T357_KINDNAME = "c001"
|
||||
|
||||
Public Const T01_DATABASEINFO = "c004"
|
||||
Public Const T01_MANDATORID = "c000"
|
||||
Public Const T01_MANDATORNAME = "c003"
|
||||
|
||||
Public Enum ColumnType As Integer
|
||||
[String]
|
||||
[Integer]
|
||||
[Date]
|
||||
[Boolean]
|
||||
[Decimal]
|
||||
End Enum
|
||||
|
||||
Public Enum FieldErrorType
|
||||
None
|
||||
MissingValue
|
||||
AccountNotFound
|
||||
ArticleNotFound
|
||||
PriceNotCalculated
|
||||
MissingParameter
|
||||
End Enum
|
||||
|
||||
Public Class FieldError
|
||||
Public Type As FieldErrorType
|
||||
Public Message As String
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return $"{Message} ({Type})"
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
Public Enum DocumentErrorType
|
||||
MandatorNotFound
|
||||
MissingXmlAttribute
|
||||
AttributeValidationFailed
|
||||
PriceNotCalculated
|
||||
End Enum
|
||||
|
||||
Public Class DocumentError
|
||||
Public Type As DocumentErrorType
|
||||
Public Message As String
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return $"{Message} ({Type})"
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Public Enum XmlFunction
|
||||
None = 0
|
||||
GLN = 1
|
||||
EAN = 2
|
||||
End Enum
|
||||
End Class
|
||||
108
MultiTool.Common/Documents/Document.vb
Normal file
108
MultiTool.Common/Documents/Document.vb
Normal file
@@ -0,0 +1,108 @@
|
||||
Imports System.IO
|
||||
Imports MultiTool.Common.Constants
|
||||
Imports MultiTool.Common.Templates
|
||||
Imports MultiTool.Common.Winline.Entities
|
||||
|
||||
Namespace Documents
|
||||
Public Class Document
|
||||
Public File As FileInfo
|
||||
Public Schema As Template
|
||||
Public Mandator As Mandator
|
||||
|
||||
Public TemplateName As String
|
||||
Public Property TemplateType As Integer
|
||||
Public [Option] As Integer
|
||||
Public PrintVoucher As Integer
|
||||
|
||||
''' <summary>
|
||||
''' Original Values, read-only
|
||||
''' </summary>
|
||||
Public Property Rows As New List(Of DocumentRow)
|
||||
|
||||
Public Property Imported As Boolean = False
|
||||
|
||||
''' <summary>
|
||||
''' This is used for saving the selected state via checkbox, don't remove!
|
||||
''' </summary>
|
||||
Public Property Selected As Boolean = False
|
||||
|
||||
Private DocumentErrors As New List(Of DocumentError)
|
||||
|
||||
Public ReadOnly Property HasErrors As Boolean
|
||||
Get
|
||||
Return Errors.Count > 0
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Errors As List(Of String)
|
||||
Get
|
||||
Dim oRowErrors = Rows.
|
||||
SelectMany(Function(row) row.Errors, Function(row, err) err.ToString).
|
||||
ToList()
|
||||
|
||||
Dim oDocumentErrors As List(Of String) = DocumentErrors.
|
||||
Select(Function(err) err.ToString()).
|
||||
ToList()
|
||||
|
||||
Return oDocumentErrors.
|
||||
Concat(oRowErrors).
|
||||
ToList()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub AddDocumentError(pDocumentError As DocumentErrorType, pMessage As String)
|
||||
DocumentErrors.Add(New DocumentError With {
|
||||
.Type = pDocumentError,
|
||||
.Message = pMessage
|
||||
})
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property MandatorId As String
|
||||
Get
|
||||
Return Mandator?.Id
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CreatedAt As Date
|
||||
Get
|
||||
Return File?.CreationTime
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FullName As String
|
||||
Get
|
||||
Return File?.FullName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FileName As String
|
||||
Get
|
||||
Return File?.Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Finds the first occurrence of Field and returns its value
|
||||
''' </summary>
|
||||
Public Function GetFieldValue(pField As String) As String
|
||||
For Each oRow In Rows
|
||||
For Each oField In oRow.Fields
|
||||
If oField.Key = pField Then
|
||||
Return oField.Value.Final
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Public Overrides Function Equals(obj As Object) As Boolean
|
||||
If obj Is Nothing Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return FullName = DirectCast(obj, Document).FullName
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
59
MultiTool.Common/Documents/DocumentCleaner.vb
Normal file
59
MultiTool.Common/Documents/DocumentCleaner.vb
Normal file
@@ -0,0 +1,59 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports MultiTool.Common.Templates
|
||||
|
||||
Namespace Documents
|
||||
Public Class DocumentCleaner
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Template As Template
|
||||
Private ReadOnly FileEx As FilesystemEx
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pTemplate As Template)
|
||||
MyBase.New(pLogConfig)
|
||||
Template = pTemplate
|
||||
FileEx = New FilesystemEx(LogConfig)
|
||||
End Sub
|
||||
|
||||
Public Function CleanImportedDocuments(pDocuments As List(Of Document)) As Boolean
|
||||
Dim oResult = True
|
||||
Dim oOutputDirectory = FileEx.CreateDateDirectory(Template.ArchiveDirectory)
|
||||
Dim oImportedDocuments = pDocuments.
|
||||
Where(Function(doc) doc.Imported = True).
|
||||
ToList()
|
||||
|
||||
If oImportedDocuments.Count = 0 Then
|
||||
Logger.Debug("No exported files found. Skipping.")
|
||||
Return True
|
||||
End If
|
||||
|
||||
Logger.Debug("Cleaning [{0}] exported files, moving to [{1}]", oImportedDocuments.Count, oOutputDirectory)
|
||||
|
||||
Dim oRemovedDocuments As New List(Of Document)
|
||||
|
||||
For Each oDocument As Document In oImportedDocuments
|
||||
Try
|
||||
Dim oFileinfo = New FileInfo(oDocument.FullName)
|
||||
Dim oDestination = Path.Combine(oOutputDirectory, oFileinfo.Name)
|
||||
File.Move(oFileinfo.FullName, oDestination)
|
||||
oRemovedDocuments.Add(oDocument)
|
||||
|
||||
Logger.Debug("File [{0}] successfully moved.", oFileinfo.Name)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("File [{0}] could not be moved to output directory!", oDocument.FullName)
|
||||
Logger.Error(ex)
|
||||
oResult = False
|
||||
End Try
|
||||
Next
|
||||
|
||||
Logger.Debug("Moved [{0}] files successfully.", oRemovedDocuments.Count)
|
||||
|
||||
pDocuments = pDocuments.
|
||||
Except(oRemovedDocuments).
|
||||
ToList()
|
||||
|
||||
Return oResult
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
815
MultiTool.Common/Documents/DocumentLoader.vb
Normal file
815
MultiTool.Common/Documents/DocumentLoader.vb
Normal file
@@ -0,0 +1,815 @@
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports MultiTool.Common.Exceptions
|
||||
Imports MultiTool.Common.Templates
|
||||
Imports MultiTool.Common.Winline
|
||||
Imports MultiTool.Common.Winline.Entities
|
||||
Imports MultiTool.Common.Constants
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DevExpress.Utils.CommonDialogs
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Namespace Documents
|
||||
Public Class DocumentLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Winline As WinlineData
|
||||
Private ReadOnly MappingConfig As MappingConfig
|
||||
Private ReadOnly TemplateConfig As TemplateConfig
|
||||
Private ReadOnly ApplicationConfig As Config
|
||||
Private ReadOnly Patterns As Patterns
|
||||
|
||||
Public Property Files As New List(Of Document)
|
||||
|
||||
Public Property FilesTotal As Integer = 0
|
||||
Public Property FilesLoaded As Integer = 0
|
||||
|
||||
Public Event FileLoadComplete As EventHandler(Of FileLoadInfo)
|
||||
Public Event FileLoadProgress As EventHandler(Of FileLoadProgressInfo)
|
||||
|
||||
Public Class FileLoadInfo
|
||||
Public FilesLoaded As Integer
|
||||
Public FilesTotal As Integer
|
||||
|
||||
Public Sub New(pTotal As Integer, pLoaded As Integer)
|
||||
FilesTotal = pTotal
|
||||
FilesLoaded = pLoaded
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class FileLoadProgressInfo
|
||||
Inherits FileLoadInfo
|
||||
|
||||
Public RunningFunction As String
|
||||
|
||||
Public Sub New(pTotal As Integer, pLoaded As Integer)
|
||||
MyBase.New(pTotal, pLoaded)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pWinline As WinlineData, pDatabase As MSSQLServer, pMappingConfig As MappingConfig, pTemplateConfig As TemplateConfig, pGeneralConfig As GeneralConfig, pApplicationConfig As Config)
|
||||
MyBase.New(pLogConfig, pDatabase)
|
||||
Winline = pWinline
|
||||
MappingConfig = pMappingConfig
|
||||
TemplateConfig = pTemplateConfig
|
||||
ApplicationConfig = pApplicationConfig
|
||||
Patterns = New Patterns(pLogConfig, pGeneralConfig)
|
||||
End Sub
|
||||
|
||||
Public Async Function LoadFiles(pTemplate As Template, pMandator As Mandator) As Task(Of Boolean)
|
||||
Logger.Info("Loading files from directory [{0}]", pTemplate.InputDirectory)
|
||||
Files.Clear()
|
||||
|
||||
Try
|
||||
Dim oDirectory As New DirectoryInfo(pTemplate.InputDirectory)
|
||||
Dim oFiles = oDirectory.GetFiles()
|
||||
FilesTotal = oFiles.Count
|
||||
|
||||
Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
|
||||
|
||||
For Each oFile In oFiles
|
||||
Logger.Info("Loading file [{0}]", oFile.Name)
|
||||
Dim oDocument = Await LoadFile(oFile, pTemplate, pMandator)
|
||||
Files.Add(oDocument)
|
||||
FilesLoaded = Files.Count
|
||||
|
||||
Dim oInfo As New FileLoadInfo(FilesTotal, FilesLoaded)
|
||||
RaiseEvent FileLoadComplete(Me, oInfo)
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadFile(pFileInfo As FileInfo, pTemplate As Template, pMandator As Mandator) As Task(Of Document)
|
||||
Logger.Debug("Creating new Document object for file [{0}]", pFileInfo.Name)
|
||||
Dim oDocument As New Document With {
|
||||
.File = pFileInfo,
|
||||
.Schema = pTemplate
|
||||
}
|
||||
|
||||
Try
|
||||
oDocument = LoadDocumentData(oDocument, pTemplate, TemplateConfig)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
|
||||
End Try
|
||||
|
||||
Try
|
||||
oDocument = Await MatchDataFromWinLine(oDocument, Winline.Mandators, pMandator, pTemplate)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
|
||||
End Try
|
||||
|
||||
Try
|
||||
oDocument = MarkRequiredFields(oDocument)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
|
||||
End Try
|
||||
|
||||
Return oDocument
|
||||
End Function
|
||||
|
||||
Public Function MarkRequiredFields(pDocument As Document) As Document
|
||||
For Each oRow In pDocument.Rows
|
||||
For Each oField In oRow.Fields
|
||||
If oField.Value.Final = String.Empty And oField.Value.IsRequired Then
|
||||
oField.Value.AddFieldError(FieldErrorType.MissingValue, $"Attribut '{oField.Key}' ist ein Pflichtfeld, wurde aber nicht gefüllt.")
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Public Sub ReplaceDocument(pDocument As Document)
|
||||
Dim oIndex = Files.IndexOf(pDocument)
|
||||
Files.Item(oIndex) = pDocument
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function IncludeSchema(pDocument As Document, pTemplate As Template) As Document
|
||||
Logger.Debug("Adding schema to Document object.")
|
||||
pDocument.Schema = pTemplate
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Loads a single document from the FullName Property in the Document Object
|
||||
''' </summary>
|
||||
''' <example>
|
||||
''' A document might look like this:
|
||||
''' <MESOWebService>
|
||||
''' <Row1></Row1>
|
||||
''' <Row2></Row2>
|
||||
''' <Row3></Row3>
|
||||
''' </MESOWebService>
|
||||
''' </example>
|
||||
Private Function LoadDocumentData(pDocument As Document, pTemplate As Template, pTemplateConfig As TemplateConfig) As Document
|
||||
Logger.Debug("Loading file contents")
|
||||
|
||||
Dim oText As String
|
||||
Dim oDoc As XDocument
|
||||
|
||||
Try
|
||||
Logger.Debug("Loading file from fs..")
|
||||
oText = IO.File.ReadAllText(pDocument.FullName)
|
||||
|
||||
Logger.Debug("Parsing file..")
|
||||
oDoc = XDocument.Parse(oText)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
|
||||
Logger.Debug("File Loaded.")
|
||||
|
||||
Dim oRootElement As XElement = XmlData.GetElement(oDoc, "MESOWebService")
|
||||
If oRootElement Is Nothing Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.MissingXmlAttribute, "Datei enthält kein MESOWebService-Attribut")
|
||||
End If
|
||||
|
||||
Dim oTemplateName = XmlData.GetElementAttribute(oRootElement, "Template")
|
||||
If oTemplateName Is Nothing Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.MissingXmlAttribute, "Datei enthält kein Template-Attribut")
|
||||
End If
|
||||
|
||||
Dim oTemplateType = XmlData.GetElementAttribute(oRootElement, "TemplateType")
|
||||
If oTemplateType Is Nothing Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.MissingXmlAttribute, "Datei enthält kein TemplateType-Attribut")
|
||||
End If
|
||||
|
||||
Dim oOption = XmlData.GetElementAttribute(oRootElement, "option")
|
||||
If oOption Is Nothing Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.MissingXmlAttribute, "Datei enthält kein option-Attribut")
|
||||
End If
|
||||
|
||||
Dim oPrintVoucher = XmlData.GetElementAttribute(oRootElement, "printVoucher")
|
||||
If oPrintVoucher Is Nothing Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.MissingXmlAttribute, "Datei enthält kein printVoucher-Attribut")
|
||||
End If
|
||||
|
||||
' The first level of Elements are the document Rows
|
||||
Dim oTopLevelElements As List(Of XElement) = oRootElement.Elements.ToList
|
||||
Dim oDocumentRows As New List(Of DocumentRow)
|
||||
Dim oRowSortKey As Integer = 0
|
||||
|
||||
' TODO: Somehow add all fields in the correct order
|
||||
'
|
||||
' Right now, the method of
|
||||
' - first the filled field from xml
|
||||
' - then the rest from schema
|
||||
'
|
||||
' leads to unordered fields.
|
||||
For Each oTopLevelElement As XElement In oTopLevelElements
|
||||
Dim oColumnSortKey = 0
|
||||
Dim oFields As New Dictionary(Of String, DocumentRow.FieldValue)
|
||||
Dim oSubElements = oTopLevelElement.Descendants().ToList()
|
||||
Dim oTable = pTemplate.Tables.
|
||||
Where(Function(t) t.Name = oTopLevelElement.Name).
|
||||
FirstOrDefault()
|
||||
|
||||
Logger.Debug("Creating fields from [{0}] columns for Table [{1}]", oTable.Columns.Count, oTable.Name)
|
||||
|
||||
For Each oColumn In oTable.Columns
|
||||
Dim oQuery = oSubElements.Where(Function(e) e.Name = oColumn.Name)
|
||||
Dim oElementCount = oQuery.Count()
|
||||
Dim oSubElement = oQuery.FirstOrDefault()
|
||||
|
||||
If oElementCount > 1 Then
|
||||
Logger.Warn("Found [{0}] elements for column [{1}]. Using first occurrence.")
|
||||
End If
|
||||
|
||||
If oSubElement IsNot Nothing Then
|
||||
Dim oRequired = oColumn.IsRequired
|
||||
Dim oValue = oSubElement.Value.Trim()
|
||||
|
||||
Logger.Debug("Creating existing field from Element: [{0}]", oSubElement.Name.ToString)
|
||||
|
||||
' TODO: Needed when we have time for date times
|
||||
'If oTemplateField.DataType = Constants.ColumnType.Date Then
|
||||
' Dim oDate = Date.ParseExact(oValue, "yyyy-MM-dd", CultureInfo.InvariantCulture)
|
||||
' oValue = oDate.ToString("d")
|
||||
'End If
|
||||
|
||||
Dim oFieldValue = GetFieldValueFromColumn(oColumn, oColumnSortKey)
|
||||
oFieldValue.SetOriginalValue(oValue)
|
||||
|
||||
oFields.Add(oSubElement.Name.ToString, oFieldValue)
|
||||
Else
|
||||
Logger.Debug("Creating new field from Configuration: [{0}]", oColumn.Name)
|
||||
|
||||
Dim oFieldValue = GetFieldValueFromColumn(oColumn, oColumnSortKey)
|
||||
|
||||
If oColumn.Config?.IsRequired Then
|
||||
oFieldValue.AddFieldError(FieldErrorType.MissingValue, $"Attribut {oSubElement.Name} wird benötigt, ist aber nicht gefüllt.")
|
||||
End If
|
||||
|
||||
oFields.Add(oColumn.Name, oFieldValue)
|
||||
End If
|
||||
|
||||
oColumnSortKey += 1
|
||||
Next
|
||||
|
||||
' Create a DocumentRow object for each Top Level Element
|
||||
Dim oRow = New DocumentRow With {
|
||||
.SortKey = oRowSortKey,
|
||||
.TableName = oTopLevelElement.Name.ToString,
|
||||
.Fields = oFields
|
||||
}
|
||||
|
||||
oRowSortKey += 1
|
||||
oDocumentRows.Add(oRow)
|
||||
Next
|
||||
|
||||
' Update the document
|
||||
pDocument.TemplateName = oTemplateName
|
||||
pDocument.TemplateType = oTemplateType
|
||||
pDocument.Option = oOption
|
||||
pDocument.PrintVoucher = oPrintVoucher
|
||||
pDocument.Rows = oDocumentRows
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Public Function GetFieldValueFromColumn(pColumn As Template.Column, pSortKey As Integer) As DocumentRow.FieldValue
|
||||
Return New DocumentRow.FieldValue(LogConfig) With {
|
||||
.DataType = pColumn.DataType,
|
||||
.IsRequired = pColumn.IsRequired,
|
||||
.IsVirtual = pColumn.Config.IsVirtual,
|
||||
.PreferExternalValue = pColumn.Config.PreferExternalValue,
|
||||
.SortKey = pSortKey
|
||||
}
|
||||
End Function
|
||||
|
||||
|
||||
Private Async Function MatchDataFromWinLine(pDocument As Document, pMandators As List(Of Mandator), pMandator As Mandator, pTemplate As Template) As Task(Of Document)
|
||||
Dim oMandators As List(Of Mandator) = pMandators.
|
||||
Where(Function(m) m.IsWhitelisted = True).
|
||||
OrderBy(Function(m) m.Order).
|
||||
ToList()
|
||||
|
||||
Dim oInfo As New FileLoadProgressInfo(FilesTotal, FilesLoaded) With {.RunningFunction = "Mandant finden"}
|
||||
RaiseEvent FileLoadProgress(Me, oInfo)
|
||||
|
||||
Dim oMandator As Mandator = Nothing
|
||||
If pMandator IsNot Nothing Then
|
||||
oMandator = pMandator
|
||||
Else
|
||||
oMandator = Winline.FindMatchingMandatorFromOrder(pDocument)
|
||||
End If
|
||||
|
||||
If oMandator Is Nothing Then
|
||||
Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
|
||||
|
||||
' Without mandator, we just exit, life is meaningless.
|
||||
pDocument.AddDocumentError(DocumentErrorType.MandatorNotFound, "Mandant nicht gefunden. Verarbeitung wurde abgebrochen.")
|
||||
Else
|
||||
' Set mandator befor applying any functions that depend on a valid mandator
|
||||
pDocument.Mandator = oMandator
|
||||
|
||||
RaiseEvent FileLoadProgress(Me, New FileLoadProgressInfo(FilesTotal, FilesLoaded) With {.RunningFunction = "Winline-Funktionen"})
|
||||
|
||||
pDocument = Await ApplyDefinedItemFunctionsForImportAsync(pDocument, oMandator, pTemplate)
|
||||
pDocument = ApplyDynamicItemFunctionsForImport(pDocument, oMandator)
|
||||
|
||||
RaiseEvent FileLoadProgress(Me, New FileLoadProgressInfo(FilesTotal, FilesLoaded) With {.RunningFunction = "Preis-Funktionen"})
|
||||
|
||||
If ApplicationConfig.AutomaticPriceCalculation = True Then
|
||||
' These functions will only be applied if the document does not have errors
|
||||
pDocument = Await MaybeApplyPriceFunctions(pDocument, oMandator, pTemplate)
|
||||
End If
|
||||
|
||||
RaiseEvent FileLoadProgress(Me, New FileLoadProgressInfo(FilesTotal, FilesLoaded) With {.RunningFunction = "Feld-Funktionen"})
|
||||
|
||||
|
||||
pDocument = ApplySQLFunctionForImport(pDocument, TemplateConfig.SqlItems)
|
||||
|
||||
' This function needs to be the last one because
|
||||
' it can relate to any previously set value
|
||||
pDocument = ApplyFieldFunctionForImport(pDocument, oMandator, pTemplate)
|
||||
End If
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Private Function ApplySQLFunctionForImport(pDocument As Document, pSQLConfig As List(Of FieldConfig)) As Document
|
||||
For Each oSQLConfigItem In pSQLConfig
|
||||
For Each oFunction In oSQLConfigItem.Functions
|
||||
|
||||
If Not oFunction.Name = FUNCTION_SQL Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
' FieldList is a list of fields that will be changed
|
||||
' Example: Setting SQL for Article StorageLocation will invoke the sql for each row
|
||||
Dim oRowList = pDocument.Rows.
|
||||
Where(Function(row) row.Fields.Any(Function(field) field.Key = oSQLConfigItem.Name)).
|
||||
ToList()
|
||||
|
||||
For Each oRow As DocumentRow In oRowList
|
||||
|
||||
Dim oSQL = oFunction.Params
|
||||
Dim oField = oRow.Fields.
|
||||
Where(Function(field) field.Key = oSQLConfigItem.Name).
|
||||
SingleOrDefault()
|
||||
|
||||
oSQL = Patterns.ReplaceForImport(pDocument, oRow, oSQL)
|
||||
|
||||
Dim oValue = Database.GetScalarValue(oSQL)
|
||||
|
||||
If oValue IsNot Nothing Then
|
||||
oField.Value.SetExternalValue(oValue)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Apply price calculation to the documents products
|
||||
'''
|
||||
''' This needs to be strictly seperated from `ApplyDefinedItemFunctionsForImport`
|
||||
''' because prices can only be calculated if GLN and EAN functions were already (successfully) processed
|
||||
''' </summary>
|
||||
Public Async Function MaybeApplyPriceFunctions(pDocument As Document, pMandator As Mandator, pTemplate As Template) As Task(Of Document)
|
||||
If pDocument.HasErrors Then
|
||||
pDocument.AddDocumentError(DocumentErrorType.PriceNotCalculated, "Der Preis konnte für mindestens eine Zeile nicht ermittelt werden, weil es noch Fehler im Dokument gibt")
|
||||
Return pDocument
|
||||
End If
|
||||
|
||||
For Each oRow As DocumentRow In pDocument.Rows
|
||||
Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oRow.TableName).SingleOrDefault()
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
If oTable Is Nothing Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim oColumn = oTable.Columns.Where(Function(c) c.Name = oField.Key).SingleOrDefault()
|
||||
If oColumn Is Nothing Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
For Each oFunction As FieldConfig.ColumnFunction In oColumn.Config.Functions
|
||||
|
||||
Dim oFunctionName = oFunction.Name
|
||||
Dim oFunctionParams = oFunction.Params
|
||||
|
||||
|
||||
|
||||
If oFunctionName = String.Empty Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Logger.Debug("Running Function: [{0}]", oFunctionName)
|
||||
Logger.Debug("With Parameters: [{0}]", oFunctionParams)
|
||||
|
||||
|
||||
Dim oParamsDict = Parameters.Parse(oFunctionParams)
|
||||
|
||||
If oFunctionName = Constants.FUNCTION_PRICE Then
|
||||
Await SetPrice(oRow, oField.Key, oParamsDict, pDocument, pMandator, pTemplate)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Private Async Function ApplyDefinedItemFunctionsForImportAsync(pDocument As Document, pMandator As Mandator, pTemplate As Template) As Task(Of Document)
|
||||
For Each oRow As DocumentRow In pDocument.Rows
|
||||
Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oRow.TableName).SingleOrDefault()
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
If oTable Is Nothing Then
|
||||
Exit For
|
||||
End If
|
||||
|
||||
Dim oItemName As String = oField.Key
|
||||
|
||||
Dim oColumn = oTable.Columns.Where(Function(c) c.Name = oItemName).SingleOrDefault()
|
||||
If oColumn Is Nothing Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
For Each oFunction As FieldConfig.ColumnFunction In oColumn.Config.Functions
|
||||
|
||||
Dim oFunctionName = oFunction.Name
|
||||
Dim oFunctionParams = oFunction.Params
|
||||
|
||||
' The code below needs a defined function
|
||||
If oFunctionName = String.Empty Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oParamsDict = Parameters.Parse(oFunctionParams)
|
||||
|
||||
' The main identifier will be checked for String.empty and not required.
|
||||
' This makes sure that optional fields do not generate errors.
|
||||
Dim oIdentifier As DocumentRow.FieldValue = oRow.Fields.GetOrDefault(oItemName)
|
||||
If oIdentifier.Original = String.Empty And oIdentifier.IsRequired = False Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Select Case oFunctionName
|
||||
Case FUNCTION_GLN
|
||||
SetAccountByGLN(oRow, pMandator, oItemName, Nothing, oParamsDict)
|
||||
|
||||
Case FUNCTION_EAN
|
||||
SetArticleByEAN(oRow, pMandator, oItemName)
|
||||
|
||||
Case FUNCTION_RUNNINGNUMBER
|
||||
Await SetVersionedRunningNumber(pDocument, oRow, pMandator, oItemName, oParamsDict)
|
||||
|
||||
Case FUNCTION_ADDRESS
|
||||
Await SetAddressByAccountNumber(pDocument, oRow, pMandator, oItemName, oParamsDict)
|
||||
|
||||
End Select
|
||||
|
||||
Next
|
||||
|
||||
Next
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Private Function ApplyFieldFunctionForImport(pDocument As Document, pMandator As Mandator, pTemplate As Template) As Document
|
||||
For Each oRow As DocumentRow In pDocument.Rows
|
||||
Dim oTable = pDocument.Schema.Tables.Where(Function(table) table.Name = oRow.TableName).SingleOrDefault()
|
||||
|
||||
For Each oField In oRow.Fields
|
||||
If oTable Is Nothing Then
|
||||
Logger.Warn("Table [{0}] was not found in the Schema. Exiting.", oRow.TableName)
|
||||
Exit For
|
||||
|
||||
End If
|
||||
|
||||
Dim oColumn = oTable.Columns.Where(Function(c) c.Name = oField.Key).SingleOrDefault()
|
||||
If oColumn Is Nothing Then
|
||||
Logger.Warn("Column [{0}] was not found in Table [{0}]. Skipping.", oField.Key, oTable.Name)
|
||||
Continue For
|
||||
|
||||
End If
|
||||
|
||||
For Each oFunction As FieldConfig.ColumnFunction In oColumn.Config.Functions
|
||||
|
||||
Dim oFunctionName = oFunction.Name
|
||||
Dim oFunctionParams = oFunction.Params
|
||||
Dim oParamsDict = Parameters.Parse(oFunctionParams)
|
||||
|
||||
If oFunctionName = FUNCTION_FIELD Then
|
||||
Try
|
||||
Logger.Debug("Applying function FIELD to field [{0}]", oField.Key)
|
||||
|
||||
Dim oParam = oParamsDict.FirstOrDefault()
|
||||
|
||||
If IsNothing(oParam) Then
|
||||
Logger.Warn("Function FIELD needs exactly one parameter. Skipping")
|
||||
Continue For
|
||||
|
||||
End If
|
||||
|
||||
Dim oFieldName = oParam.Key
|
||||
Dim oSubKey = oParam.Value
|
||||
|
||||
Dim oReferencedField = oRow.Fields.
|
||||
Where(Function(field) field.Key = oFieldName).
|
||||
FirstOrDefault()
|
||||
|
||||
If IsNothing(oReferencedField) = False Then
|
||||
Dim oRawValue = oReferencedField.Value?.GetValue(oSubKey)
|
||||
Dim oValue As String = ObjectEx.NotNull(oRawValue, String.Empty)
|
||||
|
||||
If oValue <> String.Empty Then
|
||||
oField.Value.SetExternalValue(oValue)
|
||||
End If
|
||||
|
||||
Else
|
||||
Logger.Warn("Referenced Field [{0}] was not found. Skipping.", oFieldName)
|
||||
Continue For
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Function FIELD could not be applied to field [{0}]. Skipping.", oField.Key)
|
||||
Continue For
|
||||
|
||||
End Try
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Next
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Execute Mappings defined in TBMT_MAPPING_CONFIG,
|
||||
''' for example mapping Article Numbers to Winline Mandators
|
||||
''' </summary>
|
||||
Private Function ApplyDynamicItemFunctionsForImport(pDocument As Document, pMandator As Mandator) As Document
|
||||
' We only want the mapping config for things in the xml file.
|
||||
' that excludes things like setting the mandator.
|
||||
Dim oFilteredMappingConfig = MappingConfig.Items.
|
||||
Where(Function(item) item.DestinationItem <> String.Empty).
|
||||
ToList()
|
||||
|
||||
For Each oMapping As MappingConfigItem In oFilteredMappingConfig
|
||||
|
||||
' Get Source Value
|
||||
Dim oField As KeyValuePair(Of String, DocumentRow.FieldValue) = pDocument.Rows.
|
||||
SelectMany(Function(row) row.Fields).
|
||||
Where(Function(field) field.Key = oMapping.SourceItem).
|
||||
FirstOrDefault()
|
||||
|
||||
' Test on Regex
|
||||
Dim oRegex As New Regex(oMapping.SourceRegex)
|
||||
|
||||
If oRegex.IsMatch(oField.Value.Final) Then
|
||||
|
||||
pDocument.Rows.
|
||||
SelectMany(Function(row) row.Fields).
|
||||
Where(Function(field) field.Key = oMapping.DestinationItem).
|
||||
SetValue(Sub(field) field.Value.SetExternalValue(oMapping.DestinationValue))
|
||||
|
||||
Else
|
||||
' don't do anything
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Private Async Function SetPrice(pRow As DocumentRow, pPriceField As String, pParamMap As Dictionary(Of String, String), pDocument As Document, pMandator As Mandator, pTemplate As Template) As Task
|
||||
Dim oPriceItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pPriceField)
|
||||
|
||||
' These fields are fetched from the current row
|
||||
Const PARAMETER_ARTICLE = "Article"
|
||||
Dim oArticleNumberField As String = pParamMap.GetOrDefault(PARAMETER_ARTICLE, Nothing)
|
||||
If oArticleNumberField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function PRICE", PARAMETER_ARTICLE)
|
||||
End If
|
||||
|
||||
If pRow.Fields.ContainsKey(oArticleNumberField) = False Then
|
||||
Logger.Warn("Value '{0}' for Parameter '{1}' not found for Function PRICE", oArticleNumberField, PARAMETER_ARTICLE)
|
||||
End If
|
||||
Dim oArticleNumber As String = pRow.Fields.Item(oArticleNumberField).Final
|
||||
|
||||
Const PARAMETER_QUANTITY = "Quantity"
|
||||
Dim oQuantityField As String = pParamMap.GetOrDefault(PARAMETER_QUANTITY, Nothing)
|
||||
If oQuantityField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function PRICE", PARAMETER_QUANTITY)
|
||||
End If
|
||||
|
||||
Dim oQuantity As Integer = 1
|
||||
If Integer.TryParse(pRow.Fields.Item(oQuantityField).Final, oQuantity) = False Then
|
||||
Logger.Warn("Value for parameter '{0}' could not be parsed. Setting to 1.", PARAMETER_QUANTITY)
|
||||
End If
|
||||
|
||||
' These fields a fetched from the head row, ie. the first row
|
||||
Dim oAccountNumberField As String = pParamMap.GetOrDefault("Account", Nothing)
|
||||
Dim oAccountNumber = pDocument.GetFieldValue(oAccountNumberField)
|
||||
|
||||
Dim oDocumentDateField As String = pParamMap.GetOrDefault("DocumentDate", Nothing)
|
||||
Dim oDocumentDate = pDocument.GetFieldValue(oDocumentDateField)
|
||||
|
||||
Dim oDocumentKindField As String = pParamMap.GetOrDefault("DocumentKind", Nothing)
|
||||
Dim oDocumentKind As Integer = 0
|
||||
If Integer.TryParse(pDocument.GetFieldValue(oDocumentKindField), oDocumentKind) = False Then
|
||||
Logger.Warn("Value for parameter DocumentKind could not be parsed. Setting to 0.")
|
||||
End If
|
||||
|
||||
' TODO: Add Field Names as Constants
|
||||
' TODO: Check for missing values
|
||||
|
||||
' TODO: This function should not be hardcoded, but be replaced with virtual field or something..
|
||||
' It is related to customer SCHAUM and nothing general
|
||||
Dim oWaitingDays As Integer = Await Winline.TryGetWaitingDaysAsync(oDocumentKind, pMandator)
|
||||
' END TODO
|
||||
|
||||
Dim oArticlePrice As Double = Await Winline.TryGetArticlePriceAsync(oArticleNumber, oAccountNumber, oQuantity, oDocumentDate, pMandator, pTemplate, oWaitingDays)
|
||||
|
||||
If oArticlePrice > 0 Then
|
||||
oPriceItem.SetExternalValue(oArticlePrice)
|
||||
Logger.Info("Price for Item [{0}] set to [{1}]", pPriceField, oArticlePrice)
|
||||
Else
|
||||
Logger.Warn("Price for Item [{0}] could not be found!", pPriceField)
|
||||
oPriceItem.AddFieldError(FieldErrorType.PriceNotCalculated, "Der Preis für diese Position konnte nicht ermittelt werden.")
|
||||
End If
|
||||
End Function
|
||||
|
||||
Private Sub SetArticleByEAN(pRow As DocumentRow, pMandator As Mandator, pArticleField As String)
|
||||
Dim oNumberItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pArticleField)
|
||||
|
||||
If oNumberItem Is Nothing Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oArticleNumber = Winline.TryGetArticleNumber(oNumberItem.Original, pMandator)
|
||||
|
||||
If oArticleNumber IsNot Nothing Then
|
||||
oNumberItem.SetExternalValue(oArticleNumber)
|
||||
Logger.Info("EAN [{0}] resolved to ArticleNumber [{1}]", oNumberItem.Original, oArticleNumber)
|
||||
Else
|
||||
oNumberItem.AddFieldError(FieldErrorType.ArticleNotFound, $"EAN in Attribut '{pArticleField}' konnte nicht aufgelöst werden.")
|
||||
Logger.Warn("EAN [{0}] could not be resolved ArticleNumber", oNumberItem.Original)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SetAccountByGLN(oRow As DocumentRow, pMandator As Mandator, pNumberField As String, pNameField As String, pParams As Dictionary(Of String, String))
|
||||
Try
|
||||
' 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 oAlternateField As String = pParams.GetOrDefault("AltField", String.Empty)
|
||||
Dim oAccount As Account = Winline.TryGetAccount(oNumberItem.Original, pMandator, "c260", oAlternateField)
|
||||
|
||||
' If an account was found, set it for External and Final value
|
||||
If oAccount IsNot Nothing Then
|
||||
oNumberItem.SetExternalValue(oAccount.Id)
|
||||
|
||||
If oContainsAccountName Then
|
||||
oNameItem.SetExternalValue(oAccount.Name)
|
||||
Else
|
||||
' TODO: What to to if name field is missing or not set?
|
||||
'oRow.Fields.Add(pNameField, New DocumentRow.FieldValue() With {
|
||||
' .External = oAccount.Name,
|
||||
' .Final = oAccount.Name
|
||||
'})
|
||||
End If
|
||||
Else
|
||||
' If no account was found, mark it as error.
|
||||
oNumberItem.AddFieldError(FieldErrorType.AccountNotFound, $"GLN in Attribut '{pNumberField}' konnte nicht aufgelöst werden.")
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Async Function SetVersionedRunningNumber(pDocument As Document, pRow As DocumentRow, pMandator As Mandator, pNumberField As String, pParams As Dictionary(Of String, String)) As Task
|
||||
Try
|
||||
Const PARAMETER_ACCOUNT = "Account"
|
||||
Dim oAccountField As String = pParams.GetOrDefault(PARAMETER_ACCOUNT, Nothing)
|
||||
If oAccountField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function RUNNINGNUMBER", PARAMETER_ACCOUNT)
|
||||
End If
|
||||
|
||||
Dim oRunningNumberItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pNumberField)
|
||||
Dim oRunningNumber = oRunningNumberItem.Original
|
||||
|
||||
' We use the Final value to work with the actual account number, not the GLN
|
||||
Dim oAccountNumberItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(oAccountField)
|
||||
Dim oAccountNumber = oAccountNumberItem.Final
|
||||
|
||||
Dim oVersionedNumber = Await Winline.GetVersionedRunningNumberAsync(pDocument, pMandator, oAccountNumber, oRunningNumber)
|
||||
|
||||
If oVersionedNumber <> oRunningNumber Then
|
||||
oRunningNumberItem.SetExternalValue(oVersionedNumber)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function SetAddressByAccountNumber(pDocument As Document, pRow As DocumentRow, pMandator As Mandator, pAccountField As String, pParams As Dictionary(Of String, String)) As Task
|
||||
Try
|
||||
Const PARAMETER_NAME = "Name"
|
||||
Const PARAMETER_STREET = "Street"
|
||||
Const PARAMETER_ZIP = "Zip"
|
||||
Const PARAMETER_CITY = "City"
|
||||
|
||||
|
||||
Dim oAccountNumberItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(pAccountField)
|
||||
Dim oAccountNumber = oAccountNumberItem.Final
|
||||
|
||||
Dim oNameField As String = pParams.GetOrDefault(PARAMETER_NAME, Nothing)
|
||||
Dim oNameFieldItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(oNameField)
|
||||
If oNameField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function ADDRESS", PARAMETER_NAME)
|
||||
oAccountNumberItem.AddFieldError(FieldErrorType.MissingParameter, $"Parameter '{PARAMETER_NAME}' wurde nicht gefüllt.")
|
||||
End If
|
||||
|
||||
Dim oStreetField As String = pParams.GetOrDefault(PARAMETER_STREET, Nothing)
|
||||
Dim oStreetFieldItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(oStreetField)
|
||||
If oStreetField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function ADDRESS", PARAMETER_STREET)
|
||||
oAccountNumberItem.AddFieldError(FieldErrorType.MissingParameter, $"Parameter '{PARAMETER_STREET}' wurde nicht gefüllt.")
|
||||
|
||||
End If
|
||||
|
||||
Dim oZipField As String = pParams.GetOrDefault(PARAMETER_ZIP, Nothing)
|
||||
Dim oZipFieldItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(oZipField)
|
||||
If oZipField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function ADDRESS", PARAMETER_ZIP)
|
||||
oAccountNumberItem.AddFieldError(FieldErrorType.MissingParameter, $"Parameter '{PARAMETER_ZIP}' wurde nicht gefüllt.")
|
||||
|
||||
End If
|
||||
|
||||
Dim oCityField As String = pParams.GetOrDefault(PARAMETER_CITY, Nothing)
|
||||
Dim oCityFieldItem As DocumentRow.FieldValue = pRow.Fields.GetOrDefault(oCityField)
|
||||
If oCityField Is Nothing Then
|
||||
Logger.Warn("Parameter '{0}' not found for Function ADDRESS", PARAMETER_CITY)
|
||||
oAccountNumberItem.AddFieldError(FieldErrorType.MissingParameter, $"Parameter '{PARAMETER_CITY}' wurde nicht gefüllt.")
|
||||
|
||||
End If
|
||||
|
||||
Dim oAccount = Winline.Accounts.Where(Function(a) a.Id = oAccountNumber And a.Mandator.Equals(pMandator)).SingleOrDefault()
|
||||
If oAccount Is Nothing Then
|
||||
Logger.Warn("Account with Id [{0}] in Mandator [{1}] could not be found.", oAccountNumber, pMandator.Id)
|
||||
End If
|
||||
|
||||
oNameFieldItem.SetExternalValue(oAccount.Name)
|
||||
oStreetFieldItem.SetExternalValue(oAccount.StreetName)
|
||||
oZipFieldItem.SetExternalValue(oAccount.ZipCode)
|
||||
oCityFieldItem.SetExternalValue(oAccount.CityName)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
End Try
|
||||
|
||||
Return Task.CompletedTask
|
||||
End Function
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
208
MultiTool.Common/Documents/DocumentRow.vb
Normal file
208
MultiTool.Common/Documents/DocumentRow.vb
Normal file
@@ -0,0 +1,208 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Common.Constants
|
||||
|
||||
Namespace Documents
|
||||
Public Class DocumentRow
|
||||
Implements IComparable
|
||||
|
||||
''' <summary>
|
||||
''' GUID to match DocumentRow with Row from Grid/DataTable
|
||||
''' </summary>
|
||||
Public Property Id As New Guid
|
||||
''' <summary>
|
||||
''' Counter to ensure consistency and order when writing XML
|
||||
''' </summary>
|
||||
Public Property SortKey As Integer
|
||||
|
||||
''' <summary>
|
||||
''' Tabellen/Elementname aus XML
|
||||
''' </summary>
|
||||
Public Property TableName As String
|
||||
|
||||
''' <summary>
|
||||
''' List of Row Values
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Fields As Dictionary(Of String, FieldValue)
|
||||
|
||||
Public ReadOnly Property HasErrors As Boolean
|
||||
Get
|
||||
If Errors.Count > 0 Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Errors As List(Of FieldError)
|
||||
Get
|
||||
Return Fields.
|
||||
Where(Function(f) f.Value.HasError).
|
||||
SelectMany(Function(f) f.Value.Errors).ToList()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New()
|
||||
Id = Guid.NewGuid()
|
||||
End Sub
|
||||
|
||||
Public Function CompareTo(other As Object) As Integer Implements IComparable.CompareTo
|
||||
Return SortKey.CompareTo(DirectCast(other, DocumentRow).SortKey)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' TODO: Use this class to
|
||||
''' </summary>
|
||||
Public Class Field
|
||||
Public ReadOnly Property Name
|
||||
Public Property Value As FieldValue
|
||||
|
||||
Public Sub New(pName As String)
|
||||
Name = pName
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class FieldValue
|
||||
Private _Final As String = ""
|
||||
Private _External As String = ""
|
||||
Private _Original As String = ""
|
||||
Private Logger As Logger
|
||||
|
||||
Public Property DataType As ColumnType = ColumnType.String
|
||||
|
||||
Public Property Errors As New List(Of FieldError)
|
||||
|
||||
Public ReadOnly Property Original As String
|
||||
Get
|
||||
Return FormatValue(_Original, DataType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property External As String
|
||||
Get
|
||||
Return FormatValue(_External, DataType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Final As String
|
||||
Get
|
||||
Return FormatValue(_Final, DataType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property IsRequired As Boolean = False
|
||||
Public Property IsVirtual As Boolean = False
|
||||
Public Property PreferExternalValue As Boolean = True
|
||||
Public Property SortKey As Integer = 0
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
Logger = pLogConfig.GetLogger()
|
||||
End Sub
|
||||
|
||||
Public Function GetValue(pValueType As String) As String
|
||||
Select Case pValueType
|
||||
Case "Original"
|
||||
Return Original
|
||||
Case "External"
|
||||
Return External
|
||||
Case "Final"
|
||||
Return Final
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Sub SetValue(pValueType As String, pValue As String)
|
||||
Select Case pValueType
|
||||
Case "Original"
|
||||
_Original = pValue
|
||||
Case "External"
|
||||
_External = pValue
|
||||
Case "Final"
|
||||
_Final = pValue
|
||||
Case Else
|
||||
' Noop
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Public Sub AddFieldError(pType As FieldErrorType, pMessage As String)
|
||||
Errors.Add(New FieldError() With {
|
||||
.Type = pType,
|
||||
.Message = pMessage
|
||||
})
|
||||
End Sub
|
||||
|
||||
Public Sub SetExternalValue(pValue As String)
|
||||
_External = pValue
|
||||
|
||||
' Set the external value as the final value, overriding the original / previous external value
|
||||
' if the external value should be preferred
|
||||
If PreferExternalValue = True Then
|
||||
Logger.Debug("Setting Final value to [{0}] because PreferExternalValue is True", pValue)
|
||||
_Final = pValue
|
||||
End If
|
||||
|
||||
' If there is no Original value (because the field is virtual),
|
||||
' set the external value as the final value regardless of the PreferExternalValue setting
|
||||
If _Original = String.Empty Then
|
||||
Logger.Debug("Setting Final value to [{0}] because Original value is empty", pValue)
|
||||
_Final = pValue
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub SetOriginalValue(pValue As String)
|
||||
_Original = pValue
|
||||
_Final = pValue
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property HasError As Boolean
|
||||
Get
|
||||
' Required check was moved to DocumentLoader
|
||||
Return Errors.Count > 0 'Or (IsRequired And Final = String.Empty)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Final
|
||||
End Function
|
||||
|
||||
Private Function FormatValue(pValue As String, pType As ColumnType) As String
|
||||
Select Case pType
|
||||
Case ColumnType.Decimal
|
||||
Return FormatDecimalValue(pValue)
|
||||
|
||||
Case Else
|
||||
Return pValue
|
||||
End Select
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' This function will capture values like below and format them according to winline format values
|
||||
'''
|
||||
''' 1000
|
||||
''' 1.000
|
||||
''' 1.000,00
|
||||
''' </summary>
|
||||
''' <param name="pValue">A string value that represents a number</param>
|
||||
''' <returns>A string value which contains at dot (.) as the decimal divider, ex. 1000.00</returns>
|
||||
Private Function FormatDecimalValue(pValue As String) As String
|
||||
If Not pValue.Contains(","c) Then
|
||||
Return pValue
|
||||
End If
|
||||
|
||||
Dim oRegex = New Regex("(?<Value>\d+(?:\.\d+)*(?:,\d+)?)")
|
||||
Dim oMatch = oRegex.Match(pValue)
|
||||
|
||||
If oMatch.Success Then
|
||||
Dim oValue = oMatch.Groups.Item("Value").Value
|
||||
Return oValue.Replace(","c, "."c)
|
||||
Else
|
||||
Return pValue
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
70
MultiTool.Common/Exceptions.vb
Normal file
70
MultiTool.Common/Exceptions.vb
Normal file
@@ -0,0 +1,70 @@
|
||||
Public Class Exceptions
|
||||
''' <summary>
|
||||
''' Abstract class
|
||||
''' </summary>
|
||||
Public MustInherit Class MultiToolException
|
||||
Inherits ApplicationException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
''' -----------------------------------------------
|
||||
|
||||
Public Class DocumentLoaderException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class DatabaseException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class WebServiceException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class MissingAttributeException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(attributeName As String)
|
||||
MyBase.New(attributeName)
|
||||
End Sub
|
||||
End Class
|
||||
Public Class MultipleAccountsException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
Public Class NoAccountException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(message As String)
|
||||
MyBase.New(message)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Public Class LengthExceededException
|
||||
Inherits MultiToolException
|
||||
|
||||
Public Sub New(attribute As String)
|
||||
MyBase.New(attribute)
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
End Class
|
||||
@@ -4,6 +4,11 @@ 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
|
||||
|
||||
If pKey Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Return IIf(pDictionary.TryGetValue(pKey, oValue), oValue, pOnMissing)
|
||||
End Function
|
||||
|
||||
127
MultiTool.Common/Mapper.vb
Normal file
127
MultiTool.Common/Mapper.vb
Normal file
@@ -0,0 +1,127 @@
|
||||
Imports System.Globalization
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports AutoMapper
|
||||
Imports AutoMapper.Configuration
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Common.Documents.DocumentRow
|
||||
|
||||
Public Class Mapper
|
||||
Private MapperConfig As MapperConfiguration
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
Private ReadOnly Logger As Logger
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
LogConfig = pLogConfig
|
||||
Logger = pLogConfig.GetLogger
|
||||
End Sub
|
||||
|
||||
Public Function GetMapper(Of T)(pPropertyMap As Dictionary(Of String, String)) As IMapper
|
||||
MapperConfig = New MapperConfiguration(CreateMapperConfig(Of T)(pPropertyMap))
|
||||
MapperConfig.AssertConfigurationIsValid()
|
||||
Return MapperConfig.CreateMapper()
|
||||
End Function
|
||||
|
||||
Private Function CreateMapperConfig(Of T)(pPropertyMap As Dictionary(Of String, String)) As MapperConfigurationExpression
|
||||
Logger.Info("Creating mapper config for type [{0}]", GetType(T).Name)
|
||||
Dim oConfig As New MapperConfigurationExpression()
|
||||
oConfig.AddProfile(New MappingProfile(Of T)(LogConfig, pPropertyMap))
|
||||
Return oConfig
|
||||
End Function
|
||||
|
||||
Public Class MappingProfile(Of T)
|
||||
Inherits Profile
|
||||
|
||||
Private ReadOnly LogConfig As LogConfig
|
||||
|
||||
Public Overrides ReadOnly Property ProfileName As String
|
||||
Get
|
||||
Return "MappingProfile"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pPropertyMap As Dictionary(Of String, String))
|
||||
LogConfig = pLogConfig
|
||||
CreateMap(Of Dictionary(Of String, FieldValue), T).ConvertUsing(New ReportTypeConverter(Of T)(LogConfig, pPropertyMap))
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Private Class ReportTypeConverter(Of TDestination)
|
||||
Implements ITypeConverter(Of Dictionary(Of String, FieldValue), TDestination)
|
||||
|
||||
Private ReadOnly PropertyMap As Dictionary(Of String, String)
|
||||
Private ReadOnly KeyWithSubkey As New Regex("(?<Key>[\w\s-]+)(?:\[(?<Subkey>[\w]+)\])?")
|
||||
|
||||
Private ReadOnly Logger As Logger
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pPropertyMap As Dictionary(Of String, String))
|
||||
MyBase.New()
|
||||
Logger = pLogConfig.GetLogger()
|
||||
PropertyMap = pPropertyMap
|
||||
End Sub
|
||||
|
||||
Public Function Convert(pSource As Dictionary(Of String, FieldValue), pDestination As TDestination, pContext As ResolutionContext) As TDestination Implements ITypeConverter(Of Dictionary(Of String, FieldValue), TDestination).Convert
|
||||
If pSource Is Nothing Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oResult = Activator.CreateInstance(Of TDestination)
|
||||
|
||||
Logger.Info("Mapping object of Type [{0}]", GetType(TDestination).Name)
|
||||
|
||||
For Each oMapItem As KeyValuePair(Of String, String) In PropertyMap
|
||||
Try
|
||||
' SourceKey will be something like 'Fakt_Kontonummer[Final]'
|
||||
' DestinationKey will be something like 'Text1'
|
||||
Dim oSourceKeyCombined As String = oMapItem.Key
|
||||
Dim oDestinationKey As String = oMapItem.Value
|
||||
|
||||
' Resolve SourceKey into Key and Subkey
|
||||
Dim oMatch As Match = KeyWithSubkey.Match(oSourceKeyCombined)
|
||||
Dim oSourceKey As String = oMatch.Groups("Key")?.Value
|
||||
Dim oSourceSubkey As String = oMatch.Groups("Subkey")?.Value
|
||||
|
||||
' Set property value if property exists in source
|
||||
If pSource.ContainsKey(oSourceKey) Then
|
||||
' Try to get the value from 'source'
|
||||
Dim oFieldValue As FieldValue = pSource.Item(oSourceKey)
|
||||
|
||||
' Get the destination property by DestinationKey
|
||||
Dim oProperty = GetType(TDestination).
|
||||
GetProperties().
|
||||
SingleOrDefault(Function(p) p.Name = oDestinationKey)
|
||||
|
||||
' Set the property if it exists
|
||||
If oProperty IsNot Nothing Then
|
||||
Dim oValue = GetFieldValue(oFieldValue, oSourceSubkey)
|
||||
Logger.Info("Transferring value [{0}] from [{1}] -> [{2}]", oValue, oSourceKeyCombined, oDestinationKey)
|
||||
oProperty.SetValue(oResult, oValue)
|
||||
|
||||
Else
|
||||
Logger.Warn("Property [{0}] does not exist in destination object. Possible error in configuration.", oDestinationKey)
|
||||
|
||||
End If
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not transfer key [{0}] to destination object", oMapItem.Key)
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
Next
|
||||
|
||||
Return oResult
|
||||
End Function
|
||||
|
||||
Private Function GetFieldValue(pValue As FieldValue, pKey As String) As String
|
||||
If pKey = "Original" Then
|
||||
Return pValue.Original
|
||||
|
||||
ElseIf pKey = "External" Then
|
||||
Return pValue.External
|
||||
|
||||
Else
|
||||
Return pValue.Final
|
||||
|
||||
End If
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
@@ -6,12 +6,13 @@
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{DD1AC3B9-7595-4D3C-B9BB-97C46A480FA0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ImporterShared</RootNamespace>
|
||||
<AssemblyName>ImporterShared</AssemblyName>
|
||||
<RootNamespace>MultiTool.Common</RootNamespace>
|
||||
<AssemblyName>MultiTool.Common</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -19,7 +20,7 @@
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>ImporterShared.xml</DocumentationFile>
|
||||
<DocumentationFile>MultiTool.Common.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -28,7 +29,7 @@
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>ImporterShared.xml</DocumentationFile>
|
||||
<DocumentationFile>MultiTool.Common.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
@@ -47,25 +48,32 @@
|
||||
<Reference Include="AutoMapper, Version=10.0.0.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\AutoMapper.10.1.1\lib\net461\AutoMapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.DataAccess.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Modules.Database">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
<Reference Include="DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||
<Reference Include="DevExpress.DataAccess.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DevExpress.Printing.v21.2.Core, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
|
||||
<Reference Include="DigitalData.Modules.Base, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Filesystem">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
|
||||
<Reference Include="DigitalData.Modules.Config, Version=1.1.4.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Interfaces">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll</HintPath>
|
||||
<Reference Include="DigitalData.Modules.Database, Version=2.2.7.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Language">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Release\DigitalData.Modules.Language.dll</HintPath>
|
||||
<Reference Include="DigitalData.Modules.Interfaces, Version=1.7.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DigitalData.Modules.Logging">
|
||||
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Release\DigitalData.Modules.Logging.dll</HintPath>
|
||||
<Reference Include="DigitalData.Modules.Logging, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\DDModules\Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.7.10\lib\net45\NLog.dll</HintPath>
|
||||
<Reference Include="NLog, Version=5.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.5.1.0\lib\net46\NLog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
@@ -96,16 +104,18 @@
|
||||
<Compile Include="Config.vb" />
|
||||
<Compile Include="Constants.vb" />
|
||||
<Compile Include="Documents\Document.vb" />
|
||||
<Compile Include="Documents\DocumentMatch.vb" />
|
||||
<Compile Include="Documents\DocumentCleaner.vb" />
|
||||
<Compile Include="Documents\DocumentRow.vb" />
|
||||
<Compile Include="Documents\DocumentType.vb" />
|
||||
<Compile Include="Documents\DocumentLoader.vb" />
|
||||
<Compile Include="Exceptions.vb" />
|
||||
<Compile Include="IDictionaryEx.vb" />
|
||||
<Compile Include="IEnumerableEx.vb" />
|
||||
<Compile Include="Mapper.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -117,23 +127,34 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Mapper.vb" />
|
||||
<Compile Include="Schemas\BaseSchema.vb" />
|
||||
<Compile Include="Schemas\Orders\Helpers.vb" />
|
||||
<Compile Include="Schemas\Orders\Input.vb" />
|
||||
<Compile Include="Schemas\Orders\OrderSchema.vb" />
|
||||
<Compile Include="Schemas\Orders\ReportSource.vb" />
|
||||
<Compile Include="Schemas\Response.vb" />
|
||||
<Compile Include="Schemas\Schema.vb" />
|
||||
<Compile Include="Schemas\SchemaLoader.vb" />
|
||||
<Compile Include="Parameters.vb" />
|
||||
<Compile Include="Patterns.vb" />
|
||||
<Compile Include="Report\ReportGenerator.vb" />
|
||||
<Compile Include="Templates\FilterConfig.vb" />
|
||||
<Compile Include="Templates\FilterConfigItem.vb" />
|
||||
<Compile Include="Templates\GeneralConfig.vb" />
|
||||
<Compile Include="Templates\MandatorConfig.vb" />
|
||||
<Compile Include="Templates\MandatorConfigItem.vb" />
|
||||
<Compile Include="Templates\MappingConfig.vb" />
|
||||
<Compile Include="Templates\MappingConfigItem.vb" />
|
||||
<Compile Include="Report\ReportHead.vb" />
|
||||
<Compile Include="Report\ReportPosition.vb" />
|
||||
<Compile Include="Report\ReportSource.vb" />
|
||||
<Compile Include="Winline\Entities\ExportDocument.vb" />
|
||||
<Compile Include="Winline\Entities\PackingUnit.vb" />
|
||||
<Compile Include="Winline\Entities\Response.vb" />
|
||||
<Compile Include="Templates\Template.vb" />
|
||||
<Compile Include="Templates\TemplateLoader.vb" />
|
||||
<Compile Include="Serializer.vb" />
|
||||
<Compile Include="Templates\TemplateConfig.vb" />
|
||||
<Compile Include="Winline\Entities\Account.vb" />
|
||||
<Compile Include="Winline\Data.vb" />
|
||||
<Compile Include="Winline\WinlineData.vb" />
|
||||
<Compile Include="Winline\Entities\Article.vb" />
|
||||
<Compile Include="Winline\Entities\Contact.vb" />
|
||||
<Compile Include="Winline\Entities\DocumentKind.vb" />
|
||||
<Compile Include="Winline\Entities\Mandator.vb" />
|
||||
<Compile Include="Winline\Entities\TemplateColumn.vb" />
|
||||
<Compile Include="Winline\WebService.vb" />
|
||||
<Compile Include="Templates\FieldConfig.vb" />
|
||||
<Compile Include="Winline\WebServiceData.vb" />
|
||||
<Compile Include="XmlData.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -1,10 +1,10 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:4.0.30319.42000
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
@@ -8,12 +8,12 @@ Imports System.Runtime.InteropServices
|
||||
|
||||
' Werte der Assemblyattribute überprüfen
|
||||
|
||||
<Assembly: AssemblyTitle("ImporterShared")>
|
||||
<Assembly: AssemblyTitle("MultiTool.Common")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("ImporterShared")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2021")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: AssemblyProduct("MultiTool.Common")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024")>
|
||||
<Assembly: AssemblyTrademark("1.0.0.0")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
63
MultiTool.Common/My Project/Resources.Designer.vb
generated
Normal file
63
MultiTool.Common/My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' Dieser Code wurde von einem Tool generiert.
|
||||
' Laufzeitversion:4.0.30319.42000
|
||||
'
|
||||
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||
' der Code erneut generiert wird.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
|
||||
'-Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
|
||||
'Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
|
||||
'mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
|
||||
'''<summary>
|
||||
''' Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MultiTool.Common.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
|
||||
''' Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
@@ -15,7 +15,7 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0"), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
@@ -64,9 +64,9 @@ Namespace My
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.ImporterForm.My.MySettings
|
||||
Friend ReadOnly Property Settings() As Global.MultiTool.Common.My.MySettings
|
||||
Get
|
||||
Return Global.ImporterForm.My.MySettings.Default
|
||||
Return Global.MultiTool.Common.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
49
MultiTool.Common/Parameters.vb
Normal file
49
MultiTool.Common/Parameters.vb
Normal file
@@ -0,0 +1,49 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class Parameters
|
||||
''' <summary>
|
||||
''' Parse a list of parameters and return a directory of the parsed parameters.
|
||||
''' </summary>
|
||||
''' <remarks>The special case of SQL Parameters is NOT handled by this function.</remarks>
|
||||
Public Shared Function Parse(pParameters As String) As Dictionary(Of String, String)
|
||||
Try
|
||||
Dim oParamsDict As New Dictionary(Of String, String)
|
||||
|
||||
If pParameters <> String.Empty Then
|
||||
Dim oParamList = pParameters.Split("|").ToList()
|
||||
|
||||
For Each oParam In oParamList
|
||||
Dim oParamSplit = oParam.Split("=")
|
||||
|
||||
If oParamSplit.Count = 2 Then
|
||||
oParamsDict.Add(oParamSplit(0), oParamSplit(1))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
Return oParamsDict
|
||||
Catch ex As Exception
|
||||
Return New Dictionary(Of String, String)
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function TryGet(pParameters As String, pName As String) As Tuple(Of String, String)
|
||||
Try
|
||||
Dim pParamDict = Parse(pParameters)
|
||||
|
||||
If pParamDict.Count = 0 Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
If Not pParamDict.ContainsKey(pName) Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
Dim oValue = pParamDict.Item(pName)
|
||||
Return New Tuple(Of String, String)(pName, oValue)
|
||||
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
167
MultiTool.Common/Patterns.vb
Normal file
167
MultiTool.Common/Patterns.vb
Normal file
@@ -0,0 +1,167 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Common.Documents
|
||||
Imports MultiTool.Common.Templates
|
||||
Imports MultiTool.Common.Constants
|
||||
Imports MultiTool.Common.Winline.Entities
|
||||
|
||||
Public Class Patterns
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly GeneralConfig As GeneralConfig
|
||||
Private ReadOnly Regex As New Regex("{#(\w+)#([\w\s_-]+)}+")
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pGeneralConfig As GeneralConfig)
|
||||
MyBase.New(pLogConfig)
|
||||
GeneralConfig = pGeneralConfig
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Replaces placeholders in an sql marked as final sql in the template.
|
||||
''' </summary>
|
||||
''' <remarks>
|
||||
''' This SQL does not replace field-value placeholders!
|
||||
''' This is a globally applied function!
|
||||
''' </remarks>
|
||||
Public Function ReplaceForImportFinalSQL(pDocument As Document, pReportFileName As String, pString As String) As String
|
||||
Dim oMatches As MatchCollection = Regex.Matches(pString)
|
||||
|
||||
For Each oMatch As Match In oMatches
|
||||
Dim oPlaceholderString As String = oMatch.Groups.Item(0)?.Value
|
||||
Dim oPlaceholderType As String = oMatch.Groups.Item(1)?.Value
|
||||
Dim oPlaceholderValue As String = oMatch.Groups.Item(2)?.Value
|
||||
|
||||
Select Case oPlaceholderType.ToUpper
|
||||
Case PLACEHOLDER_CONST
|
||||
Dim oValue = ""
|
||||
|
||||
Select Case oPlaceholderValue.ToUpper
|
||||
Case "FILENAME"
|
||||
oValue = pDocument.FileName
|
||||
|
||||
Case "FILENAME_REPORT"
|
||||
oValue = pReportFileName
|
||||
|
||||
Case Else
|
||||
oValue = ReplaceBasicValues(oPlaceholderValue, pDocument.Mandator)
|
||||
|
||||
End Select
|
||||
|
||||
If oValue <> "" Then
|
||||
pString = pString.Replace(oPlaceholderString, oValue)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return pString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
'''
|
||||
''' </summary>
|
||||
''' <param name="pDocument"></param>
|
||||
''' <param name="pRow"></param>
|
||||
''' <param name="pString"></param>
|
||||
''' <returns></returns>
|
||||
Public Function ReplaceForImport(pDocument As Document, pRow As DocumentRow, pString As String)
|
||||
Dim oMatches As MatchCollection = Regex.Matches(pString)
|
||||
|
||||
For Each oMatch As Match In oMatches
|
||||
Dim oPlaceholderString As String = oMatch.Groups.Item(0)?.Value
|
||||
Dim oPlaceholderType As String = oMatch.Groups.Item(1)?.Value
|
||||
Dim oPlaceholderValue As String = oMatch.Groups.Item(2)?.Value
|
||||
|
||||
Select Case oPlaceholderType.ToUpper
|
||||
Case PLACEHOLDER_FIELD
|
||||
Dim oFieldName = oPlaceholderValue
|
||||
Dim oTargetField = pRow.Fields.
|
||||
Where(Function(field) field.Key = oFieldName).
|
||||
SingleOrDefault()
|
||||
|
||||
pString = pString.Replace(oPlaceholderString, oTargetField.Value.Final)
|
||||
|
||||
Case PLACEHOLDER_CONST
|
||||
Dim oValue = ""
|
||||
|
||||
Select Case oPlaceholderValue.ToUpper
|
||||
Case "FILENAME"
|
||||
oValue = pDocument.FileName
|
||||
|
||||
Case Else
|
||||
oValue = ReplaceBasicValues(oPlaceholderValue, pDocument.Mandator)
|
||||
|
||||
End Select
|
||||
|
||||
If oValue <> "" Then
|
||||
pString = pString.Replace(oPlaceholderString, oValue)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return pString
|
||||
End Function
|
||||
|
||||
Public Function ReplaceForExport(pDocument As ExportDocument, pMandator As Mandator, oString As String)
|
||||
Dim oMatches As MatchCollection = Regex.Matches(oString)
|
||||
|
||||
For Each oMatch As Match In oMatches
|
||||
Dim oPlaceholderString As String = oMatch.Groups.Item(0)?.Value
|
||||
Dim oPlaceholderType As String = oMatch.Groups.Item(1)?.Value
|
||||
Dim oPlaceholderValue As String = oMatch.Groups.Item(2)?.Value
|
||||
|
||||
Select Case oPlaceholderType.ToUpper
|
||||
Case PLACEHOLDER_CONST
|
||||
Dim oValue = ""
|
||||
|
||||
Select Case oPlaceholderValue.ToUpper
|
||||
Case "FILENAME"
|
||||
oValue = pDocument.FilenameExport
|
||||
|
||||
Case "ACCOUNTNUMBER"
|
||||
oValue = pDocument.Account.Id
|
||||
|
||||
Case "RUNNINGNUMBER"
|
||||
oValue = pDocument.RunningNumber
|
||||
|
||||
|
||||
Case Else
|
||||
oValue = ReplaceBasicValues(oPlaceholderValue, pMandator)
|
||||
|
||||
End Select
|
||||
|
||||
If oValue <> "" Then
|
||||
oString = oString.Replace(oPlaceholderString, oValue)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return oString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Replaces basic values in the CONST namespace that only depend on the current mandator
|
||||
''' </summary>
|
||||
''' <returns>Value that will be used to replaced the placeholder</returns>
|
||||
Public Function ReplaceBasicValues(pPlaceholderValue As String, pMandator As Mandator) As String
|
||||
Select Case pPlaceholderValue.ToUpper
|
||||
Case "MESOYEAR"
|
||||
Return GeneralConfig.GetWinLineYear()
|
||||
|
||||
Case "MESOCOMP"
|
||||
Return pMandator.Id
|
||||
|
||||
Case "USERNAME"
|
||||
Return Environment.UserName
|
||||
|
||||
Case "MANDATORDB"
|
||||
Return pMandator.Database
|
||||
|
||||
Case "CURRENTDATE"
|
||||
Return Now.ToString()
|
||||
|
||||
Case Else
|
||||
Return String.Empty
|
||||
|
||||
End Select
|
||||
End Function
|
||||
End Class
|
||||
141
MultiTool.Common/Report/ReportGenerator.vb
Normal file
141
MultiTool.Common/Report/ReportGenerator.vb
Normal file
@@ -0,0 +1,141 @@
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DevExpress.XtraReports
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Common.Documents
|
||||
Imports MultiTool.Common.Documents.DocumentRow
|
||||
Imports MultiTool.Common.Report
|
||||
Imports MultiTool.Common.Templates
|
||||
Imports MultiTool.Common.Winline.Entities
|
||||
|
||||
Public Class ReportGenerator(Of TReport As IReport)
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly TemplateConfig As TemplateConfig
|
||||
Private ReadOnly GeneralConfig As GeneralConfig
|
||||
Private ReadOnly Patterns As Patterns
|
||||
Private ReadOnly FileEx As FilesystemEx
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pTemplateConfig As TemplateConfig, pGeneralConfig As GeneralConfig)
|
||||
MyBase.New(pLogConfig)
|
||||
Database = pDatabase
|
||||
GeneralConfig = pGeneralConfig
|
||||
TemplateConfig = pTemplateConfig
|
||||
Patterns = New Patterns(pLogConfig, pGeneralConfig)
|
||||
FileEx = New FilesystemEx(LogConfig)
|
||||
End Sub
|
||||
|
||||
Public Function GetReportFilePath(pDocument As Document, pTemplate As Template)
|
||||
Dim oFinalDirectory = FileEx.CreateDateDirectory(pTemplate.OutputReportDirectory)
|
||||
Dim oFileName = FileEx.GetFilenameWithSuffix(IO.Path.GetFileNameWithoutExtension(pDocument.File.Name), FileEx.GetDateTimeString, "pdf")
|
||||
Dim oFilePath As String = IO.Path.Combine(oFinalDirectory, oFileName)
|
||||
Return oFilePath
|
||||
End Function
|
||||
|
||||
Public Function GenerateReport(pDocument As Document, pTemplate As Template) As ReportResult(Of TReport)
|
||||
Dim oFilePath = GetReportFilePath(pDocument, pTemplate)
|
||||
Dim oMapperConfig As New Mapper(LogConfig)
|
||||
Dim oHeadMapper = oMapperConfig.GetMapper(Of ReportHead)(New Dictionary(Of String, String) From {
|
||||
{"Fakt_Kontoname", "Text1"},
|
||||
{"Fakt_Kontonummer[Final]", "Text2"},
|
||||
{"Auftrags-Bestellnummer", "Text3"},
|
||||
{"Datum_Auftrag-Bestellung", "Text4"},
|
||||
{"Bestellt_von", "Text5"}
|
||||
})
|
||||
|
||||
Dim oPositionMapper = oMapperConfig.GetMapper(Of ReportPosition)(New Dictionary(Of String, String) From {
|
||||
{"Artikelnummer", "Text1"},
|
||||
{"Positionstext", "Text2"},
|
||||
{"Bezeichnung", "Text3"},
|
||||
{"Menge_bestellt", "Text4"},
|
||||
{"Menge_geliefert", "Text5"},
|
||||
{"Colli", "Text6"},
|
||||
{"Einzelpreis[Original]", "Text7"},
|
||||
{"Einzelpreis[Final]", "Text8"},
|
||||
{"EinheitProPalette", "Text9"},
|
||||
{"Lagerstand", "Text10"}
|
||||
})
|
||||
|
||||
pDocument = FillFieldValuesFromSQL(pDocument, TemplateConfig.SqlItems, oFilePath)
|
||||
|
||||
Dim oHeadRow = pDocument.Rows.
|
||||
Where(Function(r) r.TableName.EndsWith("T025")).
|
||||
Select(Function(r) r.Fields).
|
||||
FirstOrDefault()
|
||||
Dim oPositionRows = pDocument.Rows.
|
||||
Where(Function(r) r.TableName.EndsWith("T026")).
|
||||
ToList()
|
||||
|
||||
Dim oReportHead = oHeadMapper.Map(Of Dictionary(Of String, FieldValue), ReportHead)(oHeadRow)
|
||||
oReportHead.Title = pTemplate.Name
|
||||
oReportHead.Subtitle = "Schaum"
|
||||
oReportHead.Filename = pDocument.FileName
|
||||
|
||||
Dim oReportPositions As New List(Of ReportPosition)
|
||||
|
||||
Dim oCounter = 1
|
||||
|
||||
For Each oRow As DocumentRow In oPositionRows
|
||||
Dim oReportPosition As ReportPosition = oPositionMapper.Map(Of Dictionary(Of String, FieldValue), ReportPosition)(oRow.Fields)
|
||||
oReportPosition.Id = oCounter
|
||||
oReportPositions.Add(oReportPosition)
|
||||
|
||||
oCounter += 1
|
||||
Next
|
||||
|
||||
Dim oReportSource As New ReportSource With {
|
||||
.Head = oReportHead,
|
||||
.Positions = oReportPositions
|
||||
}
|
||||
|
||||
Dim oReport = Activator.CreateInstance(GetType(TReport))
|
||||
Dim oDataSource = New DevExpress.DataAccess.ObjectBinding.ObjectDataSource With {
|
||||
.DataSource = oReportSource
|
||||
}
|
||||
oDataSource.Fill()
|
||||
oReport.DataSource = oDataSource
|
||||
|
||||
Dim oResult = New ReportResult(Of TReport) With {
|
||||
.Report = oReport,
|
||||
.FileName = oFilePath
|
||||
}
|
||||
|
||||
Return oResult
|
||||
End Function
|
||||
|
||||
Private Function FillFieldValuesFromSQL(pDocument As Document, pSQLConfig As List(Of FieldConfig), pReportFileName As String) As Document
|
||||
For Each oSQLConfigItem In pSQLConfig
|
||||
' FieldList is a list of fields that will be changed
|
||||
' Example: Setting SQL for Article StorageLocation will invoke the sql for each row
|
||||
Dim oRowList = pDocument.Rows.
|
||||
Where(Function(row) row.Fields.Any(Function(field) field.Key = oSQLConfigItem.Name)).
|
||||
ToList()
|
||||
|
||||
For Each oRow As DocumentRow In oRowList
|
||||
For Each oFunction In oSQLConfigItem.Functions
|
||||
Dim oSQL = oFunction.Params
|
||||
Dim oField = oRow.Fields.
|
||||
Where(Function(field) field.Key = oSQLConfigItem.Name).
|
||||
SingleOrDefault()
|
||||
|
||||
oSQL = Patterns.ReplaceForImportFinalSQL(pDocument, pReportFileName, oSQL)
|
||||
|
||||
Dim oValue = Database.GetScalarValue(oSQL)
|
||||
|
||||
If oValue IsNot Nothing Then
|
||||
oField.Value.SetExternalValue(oValue)
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
|
||||
Return pDocument
|
||||
End Function
|
||||
|
||||
Public Structure ReportResult(Of T)
|
||||
Public Report As T
|
||||
Public FileName As String
|
||||
End Structure
|
||||
|
||||
End Class
|
||||
23
MultiTool.Common/Report/ReportHead.vb
Normal file
23
MultiTool.Common/Report/ReportHead.vb
Normal file
@@ -0,0 +1,23 @@
|
||||
Namespace Report
|
||||
Public Class ReportHead
|
||||
Public Property Title As String
|
||||
Public Property Subtitle As String
|
||||
Public Property Filename As String
|
||||
|
||||
Public Property DateCreated As Date
|
||||
Public Property Id As String
|
||||
|
||||
Public Property Text1 As String
|
||||
Public Property Text2 As String
|
||||
Public Property Text3 As String
|
||||
Public Property Text4 As String
|
||||
Public Property Text5 As String
|
||||
Public Property Text6 As String
|
||||
Public Property Text7 As String
|
||||
Public Property Text8 As String
|
||||
Public Property Text9 As String
|
||||
Public Property Text10 As String
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
|
||||
27
MultiTool.Common/Report/ReportPosition.vb
Normal file
27
MultiTool.Common/Report/ReportPosition.vb
Normal file
@@ -0,0 +1,27 @@
|
||||
Namespace Report
|
||||
Public Class ReportPosition
|
||||
Public Property Id As String
|
||||
|
||||
Public Property Text1 As String
|
||||
Public Property Text2 As String
|
||||
Public Property Text3 As String
|
||||
Public Property Text4 As String
|
||||
Public Property Text5 As String
|
||||
Public Property Text6 As String
|
||||
Public Property Text7 As String
|
||||
Public Property Text8 As String
|
||||
Public Property Text9 As String
|
||||
Public Property Text10 As String
|
||||
Public Property Text11 As String
|
||||
Public Property Text12 As String
|
||||
Public Property Text13 As String
|
||||
Public Property Text14 As String
|
||||
Public Property Text15 As String
|
||||
Public Property Text16 As String
|
||||
Public Property Text17 As String
|
||||
Public Property Text18 As String
|
||||
Public Property Text19 As String
|
||||
Public Property Text20 As String
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
18
MultiTool.Common/Report/ReportSource.vb
Normal file
18
MultiTool.Common/Report/ReportSource.vb
Normal file
@@ -0,0 +1,18 @@
|
||||
Imports System.ComponentModel
|
||||
Imports DevExpress.DataAccess.ObjectBinding
|
||||
|
||||
Namespace Report
|
||||
<HighlightedClass, DisplayName("ReportSource")>
|
||||
Public Class ReportSource
|
||||
<HighlightedMember>
|
||||
Public Property Head As ReportHead
|
||||
<HighlightedMember>
|
||||
Public Property Positions As IEnumerable(Of ReportPosition)
|
||||
<HighlightedMember>
|
||||
Public Iterator Function GetPositionList() As IEnumerable(Of ReportPosition)
|
||||
For Each oPosition In Positions
|
||||
Yield oPosition
|
||||
Next
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
@@ -4,7 +4,7 @@ Imports DigitalData.Modules.Logging
|
||||
Public Class Serializer
|
||||
Inherits BaseClass
|
||||
Public Sub New(pLogConfig As LogConfig)
|
||||
MyBase.New(pLogConfig, pLogConfig.GetLogger())
|
||||
MyBase.New(pLogConfig)
|
||||
End Sub
|
||||
|
||||
Public Function GetSerializer(pSchemaType As Type) As XmlSerializer
|
||||
49
MultiTool.Common/Templates/FieldConfig.vb
Normal file
49
MultiTool.Common/Templates/FieldConfig.vb
Normal file
@@ -0,0 +1,49 @@
|
||||
Imports MultiTool.Common.Constants
|
||||
Imports DigitalData.Modules.Language
|
||||
|
||||
Namespace Templates
|
||||
Public Class FieldConfig
|
||||
Public Property Id As Integer
|
||||
Public Property Name As String
|
||||
Public Property Table As String
|
||||
Public Property Type As ColumnType
|
||||
Public Property Template As String
|
||||
Public Property OrderKey As Integer
|
||||
|
||||
Public Property IsHead As Boolean
|
||||
Public Property IsReadOnly As Boolean
|
||||
Public Property IsVisible As Boolean
|
||||
Public Property IsRequired As Boolean
|
||||
Public Property IsVirtual As Boolean
|
||||
Public Property PreferExternalValue As Boolean
|
||||
|
||||
Public Property Functions As New List(Of ColumnFunction)
|
||||
|
||||
Public Class ColumnFunction
|
||||
Public Id As XmlFunction
|
||||
Public Name As String
|
||||
Public Params As String
|
||||
End Class
|
||||
|
||||
Public Shared Function ConvertType(pType As String) As ColumnType
|
||||
Select Case pType
|
||||
Case DB_TYPE_DATE
|
||||
Return ColumnType.Date
|
||||
|
||||
Case DB_TYPE_DECIMAL
|
||||
Return ColumnType.Date
|
||||
|
||||
Case DB_TYPE_BOOLEAN
|
||||
Return ColumnType.Boolean
|
||||
|
||||
Case DB_TYPE_INTEGER
|
||||
Return ColumnType.Integer
|
||||
|
||||
Case Else
|
||||
Return ColumnType.String
|
||||
End Select
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
5
MultiTool.Common/Templates/FilterConfig.vb
Normal file
5
MultiTool.Common/Templates/FilterConfig.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Namespace Templates
|
||||
Public Class FilterConfig
|
||||
Public Property Items As New List(Of FilterConfigItem)
|
||||
End Class
|
||||
End Namespace
|
||||
10
MultiTool.Common/Templates/FilterConfigItem.vb
Normal file
10
MultiTool.Common/Templates/FilterConfigItem.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Namespace Templates
|
||||
Public Class FilterConfigItem
|
||||
Public Property Guid As Integer
|
||||
Public Property SQLCommand As String
|
||||
Public Property TableId As Integer
|
||||
Public Property TableName As String
|
||||
Public Property ColumnId As Integer
|
||||
Public Property ColumnName As String
|
||||
End Class
|
||||
End Namespace
|
||||
35
MultiTool.Common/Templates/GeneralConfig.vb
Normal file
35
MultiTool.Common/Templates/GeneralConfig.vb
Normal file
@@ -0,0 +1,35 @@
|
||||
Namespace Templates
|
||||
Public Class GeneralConfig
|
||||
Public Property TemplateDirectory As String = ""
|
||||
|
||||
Public Property Webservice As New WebServiceConfig()
|
||||
Public Property DefaultYearOverride As Integer = 0
|
||||
|
||||
Public Class WebServiceConfig
|
||||
Public Property BaseUrl As String = "http://127.0.0.1/EWL"
|
||||
Public Property Username As String = "Username"
|
||||
Public Property Password As String = "Password"
|
||||
Public Property ImportBasePath As String = ""
|
||||
Public Property ImportRelativePath As String = ""
|
||||
End Class
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetYear() As Integer
|
||||
If DefaultYearOverride > 0 Then
|
||||
Return DefaultYearOverride
|
||||
End If
|
||||
|
||||
Return Now.Year
|
||||
End Function
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetWinLineYear()
|
||||
Return GetWinLineYear(GetYear)
|
||||
End Function
|
||||
|
||||
<DebuggerStepThrough>
|
||||
Public Function GetWinLineYear(pYear As Integer)
|
||||
Return (pYear - 1900) * 12
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
5
MultiTool.Common/Templates/MandatorConfig.vb
Normal file
5
MultiTool.Common/Templates/MandatorConfig.vb
Normal file
@@ -0,0 +1,5 @@
|
||||
Namespace Templates
|
||||
Public Class MandatorConfig
|
||||
Public Property Items As New List(Of MandatorConfigItem)
|
||||
End Class
|
||||
End Namespace
|
||||
7
MultiTool.Common/Templates/MandatorConfigItem.vb
Normal file
7
MultiTool.Common/Templates/MandatorConfigItem.vb
Normal file
@@ -0,0 +1,7 @@
|
||||
Namespace Templates
|
||||
Public Class MandatorConfigItem
|
||||
Public Property Name As String
|
||||
Public Property OrderKey As Integer
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
12
MultiTool.Common/Templates/MappingConfig.vb
Normal file
12
MultiTool.Common/Templates/MappingConfig.vb
Normal file
@@ -0,0 +1,12 @@
|
||||
Namespace Templates
|
||||
Public Class MappingConfig
|
||||
Public Class Entity
|
||||
Public Const MANDATOR = "MANDATOR"
|
||||
Public Const DOCUMENTTYPE = "DOCUMENTTYPE"
|
||||
Public Const ARTICLE = "ARTICLE"
|
||||
End Class
|
||||
|
||||
Public Property Items As New List(Of MappingConfigItem)
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
12
MultiTool.Common/Templates/MappingConfigItem.vb
Normal file
12
MultiTool.Common/Templates/MappingConfigItem.vb
Normal file
@@ -0,0 +1,12 @@
|
||||
Namespace Templates
|
||||
Public Class MappingConfigItem
|
||||
Public Property OrderKey As Integer
|
||||
Public Property SourceName As String
|
||||
Public Property SourceItem As String
|
||||
Public Property SourceRegex As String
|
||||
Public Property DestinationName As String
|
||||
Public Property DestinationItem As String
|
||||
Public Property DestinationValue As String
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
138
MultiTool.Common/Templates/Template.vb
Normal file
138
MultiTool.Common/Templates/Template.vb
Normal file
@@ -0,0 +1,138 @@
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports MultiTool.Common.Winline.WinlineData
|
||||
|
||||
Namespace Templates
|
||||
|
||||
Public Class Template
|
||||
Public Property Guid As Integer
|
||||
Public Property Name As String
|
||||
Public Property FileName As String
|
||||
Public Property Description As String
|
||||
Public Property IsImport As Boolean
|
||||
Public Property Parameter1 As String
|
||||
Public Property Parameter2 As String
|
||||
Public Property FinalSQL As String
|
||||
|
||||
''' <summary>
|
||||
''' Tabledata from XSD
|
||||
''' </summary>
|
||||
Public Property Tables As New List(Of Table)
|
||||
|
||||
Public Property InputDirectory As String
|
||||
Public Property OutputDirectory As String
|
||||
Public Property ArchiveDirectory As String
|
||||
|
||||
''' <summary>
|
||||
''' Last modified date of the template file
|
||||
''' </summary>
|
||||
Public Property LastModified As Date
|
||||
|
||||
Public ReadOnly Property DocType As DocumentType
|
||||
Get
|
||||
Dim oDocType As String = GetParameter("DOCTYPE")
|
||||
Dim oPreselectedDocType As Integer = 0
|
||||
|
||||
If oDocType IsNot Nothing Then
|
||||
Integer.TryParse(oDocType, oPreselectedDocType)
|
||||
End If
|
||||
|
||||
Return [Enum].Parse(GetType(DocumentType), oPreselectedDocType)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property PrintDocument As Boolean
|
||||
Get
|
||||
Dim oPrintDocument = GetParameter("PRINT")
|
||||
Dim oDefaultValue = True
|
||||
|
||||
If oPrintDocument IsNot Nothing Then
|
||||
oDefaultValue = IIf(oPrintDocument = "0", False, True)
|
||||
End If
|
||||
|
||||
Return oDefaultValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property DocTypeCategory As DocumentTypeCategory
|
||||
Get
|
||||
Select Case DocType
|
||||
Case DocumentType.IncomingOffer,
|
||||
DocumentType.IncomingOrder,
|
||||
DocumentType.IncomingDeliveryNote,
|
||||
DocumentType.IncomingInvoice
|
||||
Return DocumentTypeCategory.Outgoing
|
||||
|
||||
Case DocumentType.OutgoingOffer,
|
||||
DocumentType.OutgoingOrder,
|
||||
DocumentType.OutgoingDeliveryNote,
|
||||
DocumentType.OutgoingInvoice
|
||||
Return DocumentTypeCategory.Incoming
|
||||
|
||||
Case Else
|
||||
Return DocumentTypeCategory.Undefined
|
||||
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputReportDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "Reports")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputWebserviceDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "WebService")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property OutputXmlFileDirectory
|
||||
Get
|
||||
Return IO.Path.Combine(OutputDirectory, "XmlFiles")
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public Function GetParameter(pName As String) As String
|
||||
Dim oParam1 As String = ObjectEx.NotNull(Parameter1, String.Empty)
|
||||
Dim oParam2 As String = ObjectEx.NotNull(Parameter2, String.Empty)
|
||||
|
||||
Dim oParamValue1 = Parameters.TryGet(oParam1, pName)
|
||||
Dim oParamValue2 = Parameters.TryGet(oParam2, pName)
|
||||
|
||||
If oParamValue1 IsNot Nothing AndAlso oParamValue1.Item1 = pName Then
|
||||
Return oParamValue1.Item2
|
||||
End If
|
||||
|
||||
If oParamValue2 IsNot Nothing AndAlso oParamValue2.Item1 = pName Then
|
||||
Return oParamValue2.Item2
|
||||
End If
|
||||
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Table from XSD
|
||||
''' </summary>
|
||||
Class Table
|
||||
Public Property Name As String
|
||||
Public Property Columns As New List(Of Column)
|
||||
End Class
|
||||
|
||||
Class Column
|
||||
Public Property Name As String
|
||||
Public Property DataType As Constants.ColumnType
|
||||
''' <summary>
|
||||
''' Required value from Schema. This value will be written in the ColumnConfig and is not relevant from that point on.
|
||||
''' </summary>
|
||||
Public Property IsRequired As Boolean
|
||||
Public Property Config As FieldConfig
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Name
|
||||
End Function
|
||||
End Class
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
25
MultiTool.Common/Templates/TemplateConfig.vb
Normal file
25
MultiTool.Common/Templates/TemplateConfig.vb
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Imports MultiTool.Common.Winline
|
||||
|
||||
Namespace Templates
|
||||
''' <summary>
|
||||
''' Class for loading column/field config from database
|
||||
''' </summary>
|
||||
Public Class TemplateConfig
|
||||
Public Property Items As List(Of FieldConfig)
|
||||
|
||||
Public ReadOnly Property SqlItems As List(Of FieldConfig)
|
||||
Get
|
||||
Return Items.
|
||||
Where(Function(item) item.Functions.Any(Function(f) f.Name = Constants.FUNCTION_SQL)).
|
||||
ToList()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Function GetColumn(pName As String, pTable As String) As FieldConfig
|
||||
Return Items.
|
||||
Where(Function(c) c.Name = pName And c.Table = pTable).
|
||||
FirstOrDefault()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
422
MultiTool.Common/Templates/TemplateLoader.vb
Normal file
422
MultiTool.Common/Templates/TemplateLoader.vb
Normal file
@@ -0,0 +1,422 @@
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base
|
||||
|
||||
Namespace Templates
|
||||
Public Class TemplateLoader
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly ns As XNamespace = "http://www.w3.org/2001/XMLSchema"
|
||||
|
||||
Public Property TemplateList As List(Of Template)
|
||||
|
||||
Public Property TemplateConfiguration As New TemplateConfig
|
||||
Public Property MappingConfiguration As New MappingConfig
|
||||
Public Property MandatorConfiguration As New MandatorConfig
|
||||
Public Property GeneralConfiguration As New GeneralConfig
|
||||
Public Property FilterConfiguration As New FilterConfig
|
||||
|
||||
Private Const SQL_TBMT_FILTERS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_FILTERS]"
|
||||
Private Const SQL_VWMT_ITEMS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_ITEMS] ORDER BY TEMPLATE_NAME, TABLE_NAME"
|
||||
Private Const SQL_VWMT_FUNCTIONS = "SELECT * FROM [DD_ECM].[dbo].[VWMT_FUNCTIONS] ORDER BY ITEM_ID, SEQUENCE"
|
||||
Private Const SQL_VWMT_MAPPING = "SELECT * FROM [DD_ECM].[dbo].[VWMT_MAPPING]"
|
||||
Private Const SQL_TBMT_MANDATORS = "SELECT * FROM [DD_ECM].[dbo].[TBMT_MANDATORS] ORDER BY ORDER_KEY"
|
||||
Private Const SQL_TBMT_CONFIG = "SELECT * FROM [DD_ECM].[dbo].[TBMT_CONFIG]"
|
||||
Private Const SQL_TBMT_TEMPLATES = "SELECT * FROM [DD_ECM].[dbo].[TBMT_TEMPLATES] WHERE ACTIVE = 1"
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pMSSQL As MSSQLServer)
|
||||
MyBase.New(pLogConfig, pMSSQL)
|
||||
End Sub
|
||||
|
||||
Public Async Function LoadFilterConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_FILTERS)
|
||||
Dim oFilters As New List(Of FilterConfigItem)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oFilter As New FilterConfigItem With {
|
||||
.Guid = oRow.Item("GUID"),
|
||||
.SQLCommand = oRow.ItemEx("SQL_COMMAND", String.Empty),
|
||||
.TableId = oRow.ItemEx("TABLE_ID", 0),
|
||||
.TableName = oRow.ItemEx("TABLE_NAME", String.Empty),
|
||||
.ColumnId = oRow.ItemEx("ITEM_ID", 0),
|
||||
.ColumnName = oRow.ItemEx("ITEM_NAME", String.Empty)
|
||||
}
|
||||
|
||||
oFilters.Add(oFilter)
|
||||
Next
|
||||
|
||||
FilterConfiguration.Items = oFilters
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadTemplates() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_TEMPLATES)
|
||||
Dim oTemplates As New List(Of Template)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oTemplate As New Template With {
|
||||
.Guid = oRow.Item("GUID"),
|
||||
.Name = oRow.ItemEx("NAME", String.Empty),
|
||||
.Description = oRow.ItemEx("DESCRIPTION", String.Empty),
|
||||
.FileName = oRow.ItemEx("FILE_NAME", String.Empty),
|
||||
.IsImport = oRow.ItemEx("IS_IMPORT", True),
|
||||
.FinalSQL = oRow.ItemEx("FINAL_SQL", String.Empty),
|
||||
.Parameter1 = oRow.ItemEx("PARAMETER_1", String.Empty),
|
||||
.Parameter2 = oRow.ItemEx("PARAMETER_2", String.Empty)
|
||||
}
|
||||
|
||||
Logger.Debug("Loading Template [{0}]", oTemplate.Name)
|
||||
|
||||
oTemplates.Add(oTemplate)
|
||||
Next
|
||||
|
||||
TemplateList = oTemplates
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadGeneralConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_CONFIG)
|
||||
Dim oGeneralConfig As New GeneralConfig
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oValue As String = oRow.ItemEx("VALUE", String.Empty)
|
||||
|
||||
Select Case oRow.Item("KEY")
|
||||
Case "YEAR_OVERRIDE"
|
||||
oGeneralConfig.DefaultYearOverride = oRow.ItemEx("VALUE", 0)
|
||||
|
||||
Case "WEBSERVICE_BASEURL"
|
||||
oGeneralConfig.Webservice.BaseUrl = oValue
|
||||
|
||||
Case "WEBSERVICE_USERNAME"
|
||||
oGeneralConfig.Webservice.Username = oValue
|
||||
|
||||
Case "WEBSERIVCE_PASSWORD"
|
||||
oGeneralConfig.Webservice.Password = oValue
|
||||
|
||||
Case "WEBSERVICE_IMPORT_BASE_PATH"
|
||||
oGeneralConfig.Webservice.ImportBasePath = oValue
|
||||
|
||||
Case "WEBSERVICE_IMPORT_RELATIVE_PATH"
|
||||
oGeneralConfig.Webservice.ImportRelativePath = oValue
|
||||
|
||||
Case "TEMPLATE_DIRECTORY"
|
||||
oGeneralConfig.TemplateDirectory = oValue
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
GeneralConfiguration = oGeneralConfig
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadMappingConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_VWMT_MAPPING)
|
||||
Dim oMappingConfig As New MappingConfig
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oTemplate As New MappingConfigItem With {
|
||||
.OrderKey = oRow.ItemEx("ORDER_KEY", String.Empty),
|
||||
.SourceName = oRow.ItemEx("SOURCE_NAME", String.Empty),
|
||||
.SourceItem = oRow.ItemEx("SOURCE_ITEM", String.Empty),
|
||||
.SourceRegex = oRow.ItemEx("SOURCE_REGEX", String.Empty),
|
||||
.DestinationName = oRow.ItemEx("DESTINATION_NAME", String.Empty),
|
||||
.DestinationItem = oRow.ItemEx("DESTINATION_ITEM", String.Empty),
|
||||
.DestinationValue = oRow.ItemEx("DESTINATION_VALUE", String.Empty)
|
||||
}
|
||||
|
||||
oMappingConfig.Items.Add(oTemplate)
|
||||
Next
|
||||
|
||||
MappingConfiguration = oMappingConfig
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadMandatorConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_TBMT_MANDATORS)
|
||||
Dim oMandatorConfig As New MandatorConfig
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oMandator As New MandatorConfigItem With {
|
||||
.OrderKey = oRow.ItemEx("ORDER_KEY", String.Empty),
|
||||
.Name = oRow.ItemEx("NAME", String.Empty)
|
||||
}
|
||||
|
||||
oMandatorConfig.Items.Add(oMandator)
|
||||
Next
|
||||
|
||||
MandatorConfiguration = oMandatorConfig
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadTemplateConfiguration() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_VWMT_ITEMS)
|
||||
Dim oItems As New List(Of FieldConfig)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oColumn As New FieldConfig() With {
|
||||
.Id = oRow.ItemEx("ITEM_ID", 0),
|
||||
.Template = oRow.ItemEx("TEMPLATE_NAME", String.Empty),
|
||||
.Table = oRow.ItemEx("TABLE_NAME", String.Empty),
|
||||
.Name = oRow.ItemEx("ITEM_NAME", String.Empty),
|
||||
.Type = FieldConfig.ConvertType(ItemEx(oRow, "DATA_TYPE", String.Empty)),
|
||||
.OrderKey = oRow.ItemEx("ORDER_KEY", 0),
|
||||
.IsReadOnly = oRow.ItemEx("IS_READ_ONLY", False),
|
||||
.IsVisible = oRow.ItemEx("IS_VISIBLE", True),
|
||||
.IsRequired = oRow.ItemEx("IS_REQUIRED", False),
|
||||
.IsVirtual = oRow.ItemEx("IS_VIRTUAL", False),
|
||||
.IsHead = oRow.ItemEx("IS_HEAD", True),
|
||||
.PreferExternalValue = oRow.ItemEx("PREFER_EXTERNAL", True),
|
||||
.Functions = New List(Of FieldConfig.ColumnFunction)
|
||||
}
|
||||
|
||||
Logger.Debug("Creating Template Item for Table [{0}]: [{1}]", oColumn.Table, oColumn.Name)
|
||||
|
||||
oItems.Add(oColumn)
|
||||
Next
|
||||
|
||||
TemplateConfiguration = New TemplateConfig With {
|
||||
.Items = oItems
|
||||
}
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function LoadTemplateFunctions() As Task(Of Boolean)
|
||||
Try
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(SQL_VWMT_FUNCTIONS)
|
||||
Dim oItems As New List(Of FieldConfig)
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oTemplateItemId = oRow.ItemEx("ITEM_ID", 0)
|
||||
Dim oTemplateItem = TemplateConfiguration.Items.SingleOrDefault(Function(i) i.Id = oTemplateItemId)
|
||||
|
||||
If oTemplateItem Is Nothing Then
|
||||
Logger.Warn("Function configuration could not be assigned to an existing template item, item id was [{0}]", oTemplateItemId)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
oTemplateItem.Functions.Add(New FieldConfig.ColumnFunction With {
|
||||
.Id = oRow.ItemEx("FUNCTION_ID", 0),
|
||||
.Name = oRow.ItemEx("FUNCTION_NAME", String.Empty),
|
||||
.Params = oRow.ItemEx("FUNCTION_PARAMETERS", String.Empty)
|
||||
})
|
||||
Next
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Function UpdateTemplateFromFile(pTemplate As Template, pInputDirectory As String) As Template
|
||||
Dim oFullPath = Path.Combine(pInputDirectory, pTemplate.FileName)
|
||||
|
||||
If Not IO.File.Exists(oFullPath) Then
|
||||
Throw New FileNotFoundException(oFullPath)
|
||||
End If
|
||||
|
||||
Dim oElements = GetTemplateElements(oFullPath)
|
||||
|
||||
For Each oElement In oElements
|
||||
Dim oColumns = GetElementColumns(oElement)
|
||||
Dim oTemplateColumns As New List(Of Template.Column)
|
||||
|
||||
For Each oColumn As XElement In oColumns
|
||||
Dim oName = XmlData.GetElementAttribute(oColumn, "name")
|
||||
Dim oMinOccurs = XmlData.GetElementAttribute(oColumn, "minOccurs")
|
||||
Dim oMaxOccurs = XmlData.GetElementAttribute(oColumn, "maxOccurs")
|
||||
Dim oType = GetElementType(oColumn)
|
||||
Dim oRequired = False
|
||||
|
||||
If oMinOccurs = 1 And oMaxOccurs = 1 Then
|
||||
oRequired = True
|
||||
End If
|
||||
|
||||
Dim oTemplateColumn As New Template.Column With {
|
||||
.Name = oName,
|
||||
.DataType = oType,
|
||||
.IsRequired = oRequired
|
||||
}
|
||||
oTemplateColumns.Add(oTemplateColumn)
|
||||
Next
|
||||
|
||||
pTemplate.Tables.Add(New Template.Table With {
|
||||
.Name = XmlData.GetElementAttribute(oElement, "name"),
|
||||
.Columns = oTemplateColumns
|
||||
})
|
||||
|
||||
Next
|
||||
|
||||
Return pTemplate
|
||||
End Function
|
||||
|
||||
Public Function UpdateTemplateTablesFromDatabase(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template
|
||||
If pTemplateConfig Is Nothing Then
|
||||
Logger.Warn("Template config is empty. Skipping.")
|
||||
Return pTemplate
|
||||
End If
|
||||
|
||||
Dim oTemplate = CreateVirtualColumns(pTemplate, pTemplateConfig)
|
||||
|
||||
For Each oTable In oTemplate.Tables
|
||||
For Each oColumn As Template.Column In oTable.Columns
|
||||
Dim oConfig As FieldConfig = pTemplateConfig.GetColumn(oColumn.Name, oTable.Name)
|
||||
|
||||
If oConfig Is Nothing Then
|
||||
oConfig = New FieldConfig With {
|
||||
.IsRequired = oColumn.IsRequired,
|
||||
.Name = oColumn.Name
|
||||
}
|
||||
End If
|
||||
|
||||
oColumn.Config = oConfig
|
||||
Next
|
||||
Next
|
||||
|
||||
Return oTemplate
|
||||
End Function
|
||||
|
||||
Private Function CreateVirtualColumns(pTemplate As Template, pTemplateConfig As TemplateConfig) As Template
|
||||
Dim oTemplateItems = pTemplateConfig.Items.
|
||||
Where(Function(item) item.Template = pTemplate.Name).
|
||||
ToList()
|
||||
|
||||
For Each oItem In oTemplateItems
|
||||
' Find the table that relates to this config item
|
||||
Dim oTable = pTemplate.Tables.Where(Function(table) table.Name = oItem.Table).FirstOrDefault()
|
||||
|
||||
If oTable Is Nothing Then
|
||||
Logger.Warn("Table [{0}] for item [{1}] does not exist in this Template!", oItem.Table, oItem.Name)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oColumnExists = oTable.Columns.Any(Function(column) column.Name = oItem.Name)
|
||||
|
||||
If oColumnExists = False And oItem.IsVirtual = True Then
|
||||
oTable.Columns.Add(New Template.Column() With {
|
||||
.Name = oItem.Name,
|
||||
.Config = oItem,
|
||||
.DataType = Constants.ColumnType.String,
|
||||
.IsRequired = False
|
||||
})
|
||||
End If
|
||||
Next
|
||||
|
||||
Return pTemplate
|
||||
End Function
|
||||
|
||||
Public Function UpdateTemplateFromDatabase(pTemplate As Template) As Template
|
||||
Try
|
||||
Dim oTable As DataTable = Database.GetDatatable($"{SQL_TBMT_CONFIG} WHERE TEMPLATE_ID = {pTemplate.Guid}")
|
||||
Dim oGeneralConfig As New GeneralConfig
|
||||
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oValue As String = oRow.ItemEx("VALUE", String.Empty)
|
||||
|
||||
Select Case oRow.Item("KEY")
|
||||
Case "INPUT_DIRECTORY"
|
||||
pTemplate.InputDirectory = oValue
|
||||
|
||||
Case "OUTPUT_DIRECTORY"
|
||||
pTemplate.OutputDirectory = oValue
|
||||
|
||||
Case "ARCHIVE_DIRECTORY"
|
||||
pTemplate.ArchiveDirectory = oValue
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
Return pTemplate
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return pTemplate
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetElementType(pElement As XElement) As Constants.ColumnType
|
||||
Dim oTypeString = XmlData.GetElementAttribute(pElement, "type")
|
||||
|
||||
If oTypeString Is Nothing Then
|
||||
Dim oRestrictionElement As XElement = pElement.
|
||||
Descendants(ns + "restriction").
|
||||
FirstOrDefault()
|
||||
|
||||
oTypeString = XmlData.GetElementAttribute(oRestrictionElement, "base")
|
||||
End If
|
||||
|
||||
Select Case oTypeString
|
||||
Case Constants.TEMPLATE_TYPE_DATE
|
||||
Return Constants.ColumnType.Date
|
||||
Case Constants.TEMPLATE_TYPE_INTEGER
|
||||
Return Constants.ColumnType.Integer
|
||||
Case Constants.TEMPLATE_TYPE_DECIMAL
|
||||
Return Constants.ColumnType.Decimal
|
||||
Case Constants.TEMPLATE_TYPE_BOOLEAN
|
||||
Return Constants.ColumnType.Boolean
|
||||
Case Else
|
||||
Return Constants.ColumnType.String
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Public Function GetTemplateElements(pTemplateFilePath As String) As List(Of XElement)
|
||||
Dim oText As String = IO.File.ReadAllText(pTemplateFilePath)
|
||||
Dim oDoc = XDocument.Parse(oText)
|
||||
|
||||
Return XmlData.GetElementsFromElement(oDoc, "choice", ns)
|
||||
End Function
|
||||
|
||||
Public Function GetElementColumns(pElement As XElement) As List(Of XElement)
|
||||
Return XmlData.GetElementsFromElement(pElement, "sequence", ns)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,4 +1,4 @@
|
||||
Namespace Winline
|
||||
Namespace Winline.Entities
|
||||
Public Class Account
|
||||
Public Property Id As String
|
||||
Public Property Name As String
|
||||
@@ -6,8 +6,9 @@
|
||||
Public Property StreetName As String
|
||||
Public Property CityName As String
|
||||
Public Property ZipCode As String
|
||||
Public Property GLN As String
|
||||
|
||||
Public Property Mandator As String
|
||||
Public Property Mandator As Mandator
|
||||
|
||||
Public Overrides Function GetHashCode() As Integer
|
||||
Return Id.GetHashCode()
|
||||
21
MultiTool.Common/Winline/Entities/Article.vb
Normal file
21
MultiTool.Common/Winline/Entities/Article.vb
Normal file
@@ -0,0 +1,21 @@
|
||||
Namespace Winline.Entities
|
||||
Public Class Article
|
||||
Public Property Id As String
|
||||
Public Property Name As String
|
||||
Public Property EAN As String
|
||||
Public Property Mandator As Mandator
|
||||
|
||||
Public Overrides Function GetHashCode() As Integer
|
||||
Return Id.GetHashCode()
|
||||
End Function
|
||||
|
||||
Public Overrides Function Equals(obj As Object) As Boolean
|
||||
Return DirectCast(obj, Article).Id = Id
|
||||
End Function
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return $"{Name} ({Id})"
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,4 +1,4 @@
|
||||
Namespace Winline
|
||||
Namespace Winline.Entities
|
||||
Public Class Contact
|
||||
Public Property Id As Integer
|
||||
Public Property Number As String
|
||||
@@ -1,8 +1,8 @@
|
||||
Namespace Winline
|
||||
Namespace Winline.Entities
|
||||
Public Class DocumentKind
|
||||
Public Id As Integer
|
||||
Public Name As String
|
||||
Public Mandator As String
|
||||
Public Property Id As Integer
|
||||
Public Property Name As String
|
||||
Public Property Mandator As Mandator
|
||||
|
||||
Public Overrides Function GetHashCode() As Integer
|
||||
Return Id.GetHashCode()
|
||||
30
MultiTool.Common/Winline/Entities/ExportDocument.vb
Normal file
30
MultiTool.Common/Winline/Entities/ExportDocument.vb
Normal file
@@ -0,0 +1,30 @@
|
||||
Imports MultiTool.Common.Winline.WinlineData
|
||||
|
||||
Namespace Winline.Entities
|
||||
Public Class ExportDocument
|
||||
Public Property Schema As Templates.Template
|
||||
|
||||
Public Property Account As Account
|
||||
Public ReadOnly Property AccountName As String
|
||||
Get
|
||||
Return Account?.ToString()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property Kind As DocumentKind
|
||||
Public Property RunningNumber As String
|
||||
Public Property Number As String
|
||||
Public Property [Date] As Date
|
||||
Public Property DateColumn As String
|
||||
Public Property NetAmount As Double
|
||||
Public Property GrossAmount As Double
|
||||
|
||||
Public Property IsSelected As Boolean = False
|
||||
Public Property IsExported As Boolean
|
||||
|
||||
Public Property FilenameExport As String
|
||||
Public Property ExportedWhen As Date
|
||||
Public Property ExportedWho As String
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -1,4 +1,4 @@
|
||||
Namespace Winline
|
||||
Namespace Winline.Entities
|
||||
Public Class Mandator
|
||||
Public Property Id As String
|
||||
Public Property Name As String
|
||||
25
MultiTool.Common/Winline/Entities/PackingUnit.vb
Normal file
25
MultiTool.Common/Winline/Entities/PackingUnit.vb
Normal file
@@ -0,0 +1,25 @@
|
||||
Namespace Winline.Entities
|
||||
Public Class PackingUnit
|
||||
Public Property Name As String
|
||||
Public Property Description As String
|
||||
Public Property Description2 As String
|
||||
Public Property Unit As Integer
|
||||
Public Property Factor As Decimal
|
||||
Public Property Flag As Integer
|
||||
|
||||
Public Property Mandator As Mandator
|
||||
|
||||
Public Overrides Function GetHashCode() As Integer
|
||||
Return Name.GetHashCode()
|
||||
End Function
|
||||
|
||||
Public Overrides Function Equals(obj As Object) As Boolean
|
||||
Return DirectCast(obj, PackingUnit).Name = Name
|
||||
End Function
|
||||
|
||||
Public Overrides Function ToString() As String
|
||||
Return Name
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
@@ -11,20 +11,18 @@
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
Imports System.Xml.Serialization
|
||||
|
||||
'
|
||||
'This source code was auto-generated by xsd, Version=4.8.3928.0.
|
||||
'
|
||||
Namespace Schemas
|
||||
Namespace Templates.Entities
|
||||
|
||||
'''<remarks/>
|
||||
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0"), _
|
||||
System.SerializableAttribute(), _
|
||||
System.Diagnostics.DebuggerStepThroughAttribute(), _
|
||||
System.ComponentModel.DesignerCategoryAttribute("code"), _
|
||||
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true), _
|
||||
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=false)> _
|
||||
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.8.3928.0"),
|
||||
System.SerializableAttribute(),
|
||||
System.Diagnostics.DebuggerStepThroughAttribute(),
|
||||
System.ComponentModel.DesignerCategoryAttribute("code"),
|
||||
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True),
|
||||
System.Xml.Serialization.XmlRootAttribute([Namespace]:="", IsNullable:=False)>
|
||||
Partial Public Class MESOWebServiceResult
|
||||
|
||||
Private overallSuccessField As Boolean
|
||||
@@ -90,7 +88,7 @@ Namespace Schemas
|
||||
Return Me.errorCodeField
|
||||
End Get
|
||||
Set
|
||||
Me.errorCodeField = value
|
||||
Me.errorCodeField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -101,7 +99,7 @@ Namespace Schemas
|
||||
Return Me.errorTextField
|
||||
End Get
|
||||
Set
|
||||
Me.errorTextField = value
|
||||
Me.errorTextField = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
564
MultiTool.Common/Winline/WebServiceData.vb
Normal file
564
MultiTool.Common/Winline/WebServiceData.vb
Normal file
@@ -0,0 +1,564 @@
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.Net.Http
|
||||
Imports System.Text
|
||||
Imports System.Xml
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports MultiTool.Common.Documents
|
||||
Imports MultiTool.Common.Exceptions
|
||||
Imports MultiTool.Common.Templates
|
||||
Imports MultiTool.Common.Templates.GeneralConfig
|
||||
Imports MultiTool.Common.Winline.Entities
|
||||
|
||||
Namespace Winline
|
||||
Public Class WebServiceData
|
||||
Inherits BaseClass
|
||||
|
||||
Private ReadOnly Config As WebServiceConfig
|
||||
Private ReadOnly Filters As FilterConfig
|
||||
Private ReadOnly Serializer As Serializer
|
||||
Private ReadOnly Winline As WinlineData
|
||||
Private ReadOnly FileEx As FilesystemEx
|
||||
Private ReadOnly Patterns As Patterns
|
||||
|
||||
Public Event WebServiceProgress As EventHandler(Of String)
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pWinline As WinlineData, pWebserviceConfig As WebServiceConfig, pGeneralConfig As GeneralConfig, pFilterConfig As FilterConfig)
|
||||
MyBase.New(pLogConfig, pDatabase)
|
||||
Serializer = New Serializer(pLogConfig)
|
||||
Config = pWebserviceConfig
|
||||
Filters = pFilterConfig
|
||||
Patterns = New Patterns(pLogConfig, pGeneralConfig)
|
||||
FileEx = New FilesystemEx(LogConfig)
|
||||
Winline = pWinline
|
||||
End Sub
|
||||
|
||||
Public Sub RaiseWebServiceProgress(pMessage As String)
|
||||
RaiseEvent WebServiceProgress(Me, pMessage)
|
||||
End Sub
|
||||
|
||||
#Region "Import"
|
||||
''' <summary>
|
||||
''' Transfers a document to winline via Webservices
|
||||
''' </summary>
|
||||
''' <param name="pDocument"></param>
|
||||
''' <param name="pTemplate"></param>
|
||||
''' <param name="pMandator"></param>
|
||||
''' <param name="pIsTest"></param>
|
||||
''' <exception cref="HttpRequestException"></exception>
|
||||
''' <exception cref="WebServiceException"></exception>
|
||||
''' <exception cref="TaskCanceledException"></exception>
|
||||
''' <returns>True if request was successful.</returns>
|
||||
Public Async Function TransferDocumentToWinline(pDocument As Documents.Document, pTemplate As Template, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean)
|
||||
Dim oWS = Config
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Einstellungen laden")
|
||||
Logger.Debug("Loading setting and creating directories")
|
||||
|
||||
' --- Build all teh filenamez and pathz
|
||||
Dim oBaseFileName As String = FileEx.GetDateTimeString()
|
||||
Dim oFileName = $"{pTemplate.Name}-{oBaseFileName}-Request.xml"
|
||||
|
||||
' --- Get and create path for request/response files
|
||||
Dim oOutputDirectory = FileEx.CreateDateDirectory(pTemplate.OutputWebserviceDirectory)
|
||||
Dim oOutputFilePath = IO.Path.Combine(oOutputDirectory, oFileName)
|
||||
|
||||
' Generate absolute path to copy xml file to
|
||||
Dim oAbsolutePath = IO.Path.Combine(oWS.ImportBasePath, oWS.ImportRelativePath)
|
||||
oAbsolutePath = FileEx.CreateDateDirectory(oAbsolutePath)
|
||||
Dim oImportAbsoluteFilePath = IO.Path.Combine(oAbsolutePath, oFileName)
|
||||
|
||||
' Generate relative path to supply to winline
|
||||
Dim oRelativePath = IO.Path.Combine(oWS.ImportRelativePath)
|
||||
oRelativePath = FileEx.GetDateDirectory(oRelativePath)
|
||||
Dim oImportRelativeFilePath = IO.Path.Combine(oRelativePath, oFileName)
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Dateien schreiben")
|
||||
Logger.Debug("Writing request file to [{oOutputFilePath}]")
|
||||
|
||||
' If configured, prevent printing the document and instead create it as a draft in the "Nicht gedruckt" section
|
||||
If pTemplate.PrintDocument = False Then
|
||||
pDocument.PrintVoucher = 0
|
||||
End If
|
||||
|
||||
' --- Serialize Data into XML string
|
||||
Dim oBytes As Byte() = GetBytesFromDocument(pDocument)
|
||||
IO.File.WriteAllBytes(oOutputFilePath, oBytes)
|
||||
|
||||
' --- Copy file to Winline Import Directory
|
||||
Try
|
||||
Logger.Debug("Copying request file to [{oImportAbsoluteFilePath}]")
|
||||
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
|
||||
Logger.Debug("Using Template [{0}/{1}]", oTemplateName, oTemplateType)
|
||||
|
||||
' ActionCode: Should this be a test or not?
|
||||
' 0 = Test call
|
||||
' 1 = Real call
|
||||
Dim oActionCode = 1
|
||||
If pIsTest = True Then
|
||||
oActionCode = 0
|
||||
End If
|
||||
Logger.Debug("Using ActionCode [{0}]", oActionCode)
|
||||
|
||||
' 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 oParams As New NameValueCollection() From {
|
||||
{"User", oWS.Username},
|
||||
{"Password", oWS.Password},
|
||||
{"Company", pMandator.Id},
|
||||
{"Type", oTemplateType},
|
||||
{"Vorlage", oTemplateName},
|
||||
{"ActionCode", oActionCode},
|
||||
{"Byref", oByref},
|
||||
{"Data", oImportRelativeFilePath}
|
||||
}
|
||||
|
||||
Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/import{ToQueryString(oParams)}"
|
||||
'Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/import?User={oWS.Username}&Password={oWS.Password}&Company={pMandator.Id}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Byref={oByref}&Data={oImportRelativeFilePath}"
|
||||
Dim oClient As New HttpClient With {
|
||||
.Timeout = TimeSpan.FromSeconds(Constants.HTTP_REQUEST_TIMEOUT_IN_SECONDS)
|
||||
}
|
||||
|
||||
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Anfrage absenden")
|
||||
|
||||
' --- Bring the action!
|
||||
Try
|
||||
Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
|
||||
Logger.Debug("HTTP Response recevied!")
|
||||
|
||||
Await HandleImportResponse(oResponse, pTemplate, oBaseFileName)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
Finally
|
||||
oClient.Dispose()
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Async Function HandleImportResponse(pResponse As HttpResponseMessage, pTemplate As Template, pBaseFileName As String) As Task
|
||||
pResponse.EnsureSuccessStatusCode()
|
||||
Dim oResponseBody As String = Await pResponse.Content.ReadAsStringAsync()
|
||||
Dim oContentType = pResponse.Content.Headers.ContentType.MediaType
|
||||
Dim oSerializer = Serializer.GetSerializer(GetType(Templates.Entities.MESOWebServiceResult))
|
||||
Dim oOutputDirectory = FileEx.CreateDateDirectory(pTemplate.OutputWebserviceDirectory)
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Antwort verarbeiten")
|
||||
|
||||
Logger.Debug("Response ContentType: [{0}]", oContentType)
|
||||
|
||||
Select Case oContentType
|
||||
Case "text/xml"
|
||||
Logger.Debug("Got XML Response. Checking.")
|
||||
|
||||
WriteResponseFile(oOutputDirectory, oResponseBody, $"{pTemplate.Name}-{pBaseFileName}-Response.xml")
|
||||
|
||||
Dim oBytes As Byte() = Encoding.UTF8.GetBytes(oResponseBody)
|
||||
Using oStream As New IO.MemoryStream(oBytes)
|
||||
Dim oResponseObject As Templates.Entities.MESOWebServiceResult = oSerializer.Deserialize(oStream)
|
||||
Dim oErrorStrings As New List(Of String)
|
||||
|
||||
If oResponseObject.ResultDetails IsNot Nothing Then
|
||||
For Each oDetails As Templates.Entities.MESOWebServiceResultResultDetails In oResponseObject.ResultDetails
|
||||
|
||||
If oDetails.Success = True Then
|
||||
Logger.Debug("KeyValue: [{0}]", oDetails.KeyValue)
|
||||
Logger.Debug("VoucherNumber: [{0}]", oDetails.VoucherNumber)
|
||||
Else
|
||||
Logger.Warn("ErrorCode: [{0}]", oDetails.ErrorCode)
|
||||
Logger.Warn("ErrorText: [{0}]", oDetails.ErrorText)
|
||||
oErrorStrings.Add($"[{oDetails.ErrorCode}] {oDetails.ErrorText}")
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If oResponseObject.OverallSuccess = False Then
|
||||
Dim oMessage = $"Request to Webservice was unsuccessful:{vbNewLine}{vbNewLine}{String.Join(vbNewLine, oErrorStrings.ToArray)}"
|
||||
|
||||
Logger.Warn("Overall Success was [false]")
|
||||
|
||||
Throw New WebServiceException(oMessage)
|
||||
End If
|
||||
End Using
|
||||
|
||||
Case "text/html"
|
||||
Logger.Debug("Got TEXT/HTML Response. Throwing.")
|
||||
WriteResponseFile(oOutputDirectory, oResponseBody, $"{pTemplate.Name}-{pBaseFileName}-Response.xml")
|
||||
|
||||
Throw New WebServiceException(oResponseBody)
|
||||
|
||||
Case Else
|
||||
Logger.Debug("Unknown Response ContentType: [{0}]", oContentType)
|
||||
|
||||
Throw New WebServiceException(oResponseBody)
|
||||
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function GetBytesFromDocument(pDocument As Documents.Document) As Byte()
|
||||
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)
|
||||
|
||||
pDocument.Rows.Sort()
|
||||
|
||||
For Each oRow In pDocument.Rows
|
||||
w.WriteStartElement(oRow.TableName)
|
||||
|
||||
For Each oField As KeyValuePair(Of String, DocumentRow.FieldValue) In oRow.Fields
|
||||
If oField.Value.Final = String.Empty Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
If oField.Value.IsVirtual 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
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Export"
|
||||
Async Function ExportDocumentFromWinline(pDocument As ExportDocument, pTemplate As Template, pMandator As Mandator, Optional pIsTest As Boolean = False) As Task(Of Boolean)
|
||||
Dim oWS = Config
|
||||
|
||||
Logger.Info("Exporting document from Winline")
|
||||
|
||||
' --- Build all teh filenamez and pathz
|
||||
Dim oBaseFileName As String = FileEx.GetDateTimeString()
|
||||
Dim oFileName = $"{pTemplate.Name}-{oBaseFileName}.xml"
|
||||
'Dim oFileName = FileEx.GetFilenameWithPrefix(oBaseFileName, pTemplate.Name, "xml")
|
||||
|
||||
Logger.Info("Filename will be [{0}]", oFileName)
|
||||
|
||||
' Save the filename to the document
|
||||
pDocument.FilenameExport = oFileName
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Abfrage vorbereiten")
|
||||
|
||||
Logger.Debug("Preparing WebService call")
|
||||
|
||||
' --- Prepare URL and HTTP Client
|
||||
Dim oTemplateType = 30
|
||||
Dim oTemplateName = pDocument.Schema.Name
|
||||
Dim oKey = $"{pDocument.Account.Id}-{pDocument.RunningNumber}"
|
||||
|
||||
' ActionCode: Should this be a test or not?
|
||||
' 0 = Test call
|
||||
' 1 = Real call
|
||||
Dim oActionCode = 1
|
||||
If pIsTest = True Then
|
||||
oActionCode = 0
|
||||
End If
|
||||
|
||||
Logger.Debug("This is a test: [{0}]", pIsTest)
|
||||
|
||||
Dim oURL As String = $"{oWS.BaseUrl}/ewlservice/export?User={oWS.Username}&Password={oWS.Password}&Company={pMandator.Id}&Type={oTemplateType}&Vorlage={oTemplateName}&ActionCode={oActionCode}&Key={oKey}"
|
||||
Dim oClient As New HttpClient()
|
||||
|
||||
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Anfrage absenden")
|
||||
|
||||
' --- Bring the action!
|
||||
Try
|
||||
Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
|
||||
Logger.Info("Request ended with code: [{0}]", oResponse.StatusCode)
|
||||
|
||||
Await HandleExportResponse(oResponse, pDocument, pTemplate, pMandator, oBaseFileName)
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Throw ex
|
||||
|
||||
Finally
|
||||
oClient.Dispose()
|
||||
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Async Function HandleExportResponse(pResponse As HttpResponseMessage, pDocument As Entities.ExportDocument, pTemplate As Template, pMandator As Mandator, pBaseFileName As String) As Task
|
||||
pResponse.EnsureSuccessStatusCode()
|
||||
|
||||
Dim oResponseBody As String = Await pResponse.Content.ReadAsStringAsync()
|
||||
Dim oContentType = pResponse.Content.Headers.ContentType.MediaType
|
||||
Dim oSerializer = Serializer.GetSerializer(GetType(Templates.Entities.MESOWebServiceResult))
|
||||
|
||||
RaiseEvent WebServiceProgress(Me, "Antwort verarbeiten")
|
||||
|
||||
Logger.Debug("Processing response with type '{0}'", oContentType)
|
||||
|
||||
Select Case oContentType
|
||||
Case "text/xml"
|
||||
Dim oXmlResponse = oResponseBody
|
||||
Dim oDoc = ConvertStringToDocument(oXmlResponse)
|
||||
|
||||
Logger.Debug("Applying Item Filters")
|
||||
oDoc = ApplyItemFiltersForExport(pDocument, pTemplate, pMandator, oDoc)
|
||||
|
||||
Logger.Debug("Applying Item Functions")
|
||||
oDoc = ApplyItemFunctionsForExport(pDocument, pTemplate, pMandator, oDoc)
|
||||
|
||||
Dim oXml = ConvertDocumentToString(oDoc)
|
||||
|
||||
' Webservice
|
||||
WriteResponseFile(pTemplate.OutputWebserviceDirectory, oXml, $"{pTemplate.Name}-{pBaseFileName}-Response.xml")
|
||||
' XML
|
||||
WriteResponseFile(pTemplate.OutputXmlFileDirectory, oXml, $"{pTemplate.Name}-{pBaseFileName}.xml")
|
||||
' Archive
|
||||
WriteResponseFile(FileEx.CreateDateDirectory(pTemplate.ArchiveDirectory), oXml, $"{pTemplate.Name}-{pBaseFileName}.xml")
|
||||
|
||||
Case "text/html"
|
||||
WriteResponseFile(pTemplate.OutputWebserviceDirectory, oResponseBody, $"{pTemplate.Name}-{pBaseFileName}-Response.txt")
|
||||
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
|
||||
Case Else
|
||||
Throw New ApplicationException(oResponseBody)
|
||||
End Select
|
||||
End Function
|
||||
|
||||
Private Function ConvertStringToDocument(pXmlString As String) As XmlDocument
|
||||
Dim oDoc As New XmlDocument()
|
||||
oDoc.LoadXml(pXmlString)
|
||||
Return oDoc
|
||||
End Function
|
||||
|
||||
Private Function ConvertDocumentToString(pXmlDocument As XmlDocument) As String
|
||||
Dim oArray As Byte()
|
||||
Using oStream As New IO.MemoryStream
|
||||
pXmlDocument.Save(oStream)
|
||||
oArray = oStream.ToArray()
|
||||
End Using
|
||||
|
||||
Return System.Text.Encoding.UTF8.GetString(oArray)
|
||||
End Function
|
||||
|
||||
Private Function ApplyItemFunctionsForExport(pDocument As Entities.ExportDocument, pTemplate As Template, pMandator As Mandator, oXMLDocument As XmlDocument) As XmlDocument
|
||||
For Each oTable In pTemplate.Tables
|
||||
Logger.Debug("Processing Table [{0}]", oTable.Name)
|
||||
|
||||
For Each oColumn As Template.Column In oTable.Columns
|
||||
Dim oTableName As String = oTable.Name
|
||||
Dim oItemName As String = oColumn.Name
|
||||
|
||||
Logger.Debug("Processing item [{0}]", oItemName)
|
||||
|
||||
For Each oFunction As FieldConfig.ColumnFunction In oColumn.Config.Functions
|
||||
|
||||
Dim oFunctionName = oFunction.Name
|
||||
Dim oFunctionParams = oFunction.Params
|
||||
|
||||
Dim oPath = $"//MESOWebService/{oTableName}/{oItemName}"
|
||||
Dim oNodes As XmlNodeList = oXMLDocument.SelectNodes(oPath)
|
||||
|
||||
Logger.Debug("Calling function [{0}] on node [{1}]", oFunctionName, oPath)
|
||||
|
||||
For Each oNode As XmlNode In oNodes
|
||||
If oFunctionName = Constants.FUNCTION_GLN Then
|
||||
Dim oGLN = Winline.TryGetGLN(oNode.InnerText, pMandator)
|
||||
|
||||
If oGLN Is Nothing Then
|
||||
Throw New MissingAttributeException(Constants.FUNCTION_GLN)
|
||||
End If
|
||||
|
||||
oNode.InnerText = oGLN
|
||||
|
||||
ElseIf oFunctionName = Constants.FUNCTION_EAN Then
|
||||
Dim oEAN = Winline.TryGetEAN(oNode.InnerText, pMandator)
|
||||
|
||||
If oEAN Is Nothing Then
|
||||
' 21.04.2022: Relax the EAN Check
|
||||
' Since it is possible to have articles without a proper EAN in export,
|
||||
' we dont throw here, but leave the original value in case of a failure.
|
||||
' Throw New Exceptions.MissingAttributeException("EAN")
|
||||
Logger.Warn("EAN could not be retrieved for Node {0}. Skipping.", oNode.Name)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
oNode.InnerText = oEAN
|
||||
|
||||
ElseIf oFunctionName = Constants.FUNCTION_SQL Then
|
||||
Dim oSQL = Patterns.ReplaceForExport(pDocument, pMandator, oFunctionParams)
|
||||
Dim oValue = Database.GetScalarValue(oSQL)
|
||||
|
||||
If oValue Is Nothing Then
|
||||
Throw New MissingAttributeException(Constants.FUNCTION_SQL)
|
||||
End If
|
||||
|
||||
oNode.InnerText = oValue
|
||||
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
|
||||
Next
|
||||
Next
|
||||
|
||||
Return oXMLDocument
|
||||
End Function
|
||||
|
||||
Private Function ApplyItemFiltersForExport(pDocument As ExportDocument, pTemplate As Template, pMandator As Mandator, oXMLDocument As XmlDocument) As XmlDocument
|
||||
Dim oTableNames = pDocument.Schema.Tables.
|
||||
Select(Function(table) table.Name).
|
||||
ToList()
|
||||
Dim oFilters = Filters.Items.
|
||||
Where(Function(filter) oTableNames.Contains(filter.TableName)).
|
||||
ToList()
|
||||
|
||||
Logger.Info("Applying [{0}] filters before exporting.", oFilters.Count)
|
||||
|
||||
For Each oFilter As FilterConfigItem In oFilters
|
||||
Dim oTableName = oFilter.TableName
|
||||
|
||||
Logger.Debug("Applying filter for Table [{0}]", oTableName)
|
||||
|
||||
If String.IsNullOrEmpty(oFilter.SQLCommand) Then
|
||||
Logger.Warn("SQL Command for filter is empty. Continuing.")
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Logger.Debug("Executing SQL Command: [{0}]", oFilter.SQLCommand)
|
||||
|
||||
Dim oSQLResult = Database.GetDatatable(oFilter.SQLCommand)
|
||||
|
||||
If oSQLResult Is Nothing Then
|
||||
Logger.Warn("SQL Command for filter returned nothing: {0}. Continuing.", oFilter.SQLCommand)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oResultList = oSQLResult.AsEnumerable.
|
||||
Select(Function(row) row.ItemEx(0, String.Empty).Trim).
|
||||
ToList()
|
||||
|
||||
Logger.Debug("Filterlist contains [{0}] items", oResultList.Count)
|
||||
|
||||
Dim oTableNodes = oXMLDocument.SelectNodes($"//{oTableName}")
|
||||
|
||||
Logger.Debug("Table contains [{0}] elements", oTableNodes.Count)
|
||||
|
||||
For Each oElementNode As XmlNode In oTableNodes
|
||||
Dim oPath As String = $"./{oFilter.ColumnName}"
|
||||
Dim oSubNode = oElementNode.SelectSingleNode(oPath)
|
||||
|
||||
If oSubNode Is Nothing Then
|
||||
Logger.Warn("Column [{0}] was not found in element.", oFilter.ColumnName)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim oNodeValue = oSubNode.InnerText.Trim
|
||||
Logger.Debug("Element Value is [{0}]", oNodeValue)
|
||||
|
||||
If Not oResultList.Contains(oNodeValue) Then
|
||||
Logger.Warn("Element for Column [{0}] was not found in filterlist.", oFilter.ColumnName)
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Logger.Info("Removing node [{0}] containing value [{1}]", oPath, oNodeValue)
|
||||
oElementNode.ParentNode.RemoveChild(oElementNode)
|
||||
Next
|
||||
Next
|
||||
|
||||
Return oXMLDocument
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
Private Function WriteResponseFileWithSuffix(pPath As String, pBaseFileName As String, pResponseBody As String, pExtension As String, pSuffix As String) As Boolean
|
||||
Try
|
||||
Dim oRequestFileName As String = FileEx.GetFilenameWithSuffix(pBaseFileName, pSuffix, pExtension)
|
||||
Dim oFilePath As String = IO.Path.Combine(pPath, oRequestFileName)
|
||||
IO.File.WriteAllText(oFilePath, pResponseBody)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function WriteResponseFileWithPrefix(pPath As String, pBaseFileName As String, pResponseBody As String, pExtension As String, pPrefix As String) As Boolean
|
||||
Try
|
||||
Dim oRequestFileName As String = FileEx.GetFilenameWithPrefix(pBaseFileName, pPrefix, pExtension)
|
||||
Dim oFilePath As String = IO.Path.Combine(pPath, oRequestFileName)
|
||||
IO.File.WriteAllText(oFilePath, pResponseBody)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function WriteResponseFile(pPath As String, pResponseBody As String, pFileName As String) As Boolean
|
||||
Try
|
||||
Dim oFilePath As String = IO.Path.Combine(pPath, pFileName)
|
||||
IO.File.WriteAllText(oFilePath, pResponseBody)
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Function ToQueryString(ByVal nvc As NameValueCollection) As String
|
||||
Dim sb As StringBuilder = New StringBuilder("?")
|
||||
Dim first As Boolean = True
|
||||
|
||||
For Each key As String In nvc.AllKeys
|
||||
|
||||
For Each value As String In nvc.GetValues(key)
|
||||
|
||||
If Not first Then
|
||||
sb.Append("&")
|
||||
End If
|
||||
|
||||
sb.AppendFormat("{0}={1}", Uri.EscapeDataString(key), Uri.EscapeDataString(value))
|
||||
first = False
|
||||
Next
|
||||
Next
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
End Namespace
|
||||
1118
MultiTool.Common/Winline/WinlineData.vb
Normal file
1118
MultiTool.Common/Winline/WinlineData.vb
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
|
||||
Public Class XmlData
|
||||
|
||||
'<DebuggerStepThrough>
|
||||
<DebuggerStepThrough>
|
||||
Public Shared Function GetElementAttribute(pElement As XElement, pName As String) As String
|
||||
Try
|
||||
Dim oAttribute As XAttribute = pElement.Attribute(pName)
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="AutoMapper" version="10.1.1" targetFramework="net461" />
|
||||
<package id="NLog" version="4.7.10" targetFramework="net461" />
|
||||
<package id="NLog" version="5.1.0" targetFramework="net461" />
|
||||
</packages>
|
||||
62
MultiTool.Form/App.config
Normal file
62
MultiTool.Form/App.config
Normal file
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System">
|
||||
<section name="DevExpress.LookAndFeel.Design.AppSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<applicationSettings>
|
||||
<DevExpress.LookAndFeel.Design.AppSettings>
|
||||
<setting name="DefaultAppSkin" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="DefaultPalette" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="TouchUI" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="CompactUI" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="TouchScaleFactor" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="DirectX" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="RegisterUserSkins" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="RegisterBonusSkins" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="FontBehavior" serializeAs="String">
|
||||
<value>UseSegoeUI</value>
|
||||
</setting>
|
||||
<setting name="DefaultAppFont" serializeAs="String">
|
||||
<value></value>
|
||||
</setting>
|
||||
<setting name="DPIAwarenessMode" serializeAs="String">
|
||||
<value>PerMonitorV2</value>
|
||||
</setting>
|
||||
<setting name="CustomPaletteCollection" serializeAs="Xml">
|
||||
<value/>
|
||||
</setting>
|
||||
</DevExpress.LookAndFeel.Design.AppSettings>
|
||||
</applicationSettings>
|
||||
<connectionStrings>
|
||||
<add name="MultiTool.Form.My.MySettings.DD_ECMConnectionString" connectionString="Data Source=SDD-VMP04-SQL17\SCHAUM;Initial Catalog=DD_ECM;Persist Security Info=True;User ID=sa;Password=dd" providerName="System.Data.SqlClient"/>
|
||||
</connectionStrings>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
15
MultiTool.Form/ApplicationEvents.vb
Normal file
15
MultiTool.Form/ApplicationEvents.vb
Normal file
@@ -0,0 +1,15 @@
|
||||
Imports Microsoft.VisualBasic.ApplicationServices
|
||||
|
||||
Namespace My
|
||||
' Für MyApplication sind folgende Ereignisse verfügbar:
|
||||
' Startup: Wird beim Starten der Anwendung noch vor dem Erstellen des Startformulars ausgelöst.
|
||||
' Shutdown: Wird nach dem Schließen aller Anwendungsformulare ausgelöst. Dieses Ereignis wird nicht ausgelöst, wenn die Anwendung mit einem Fehler beendet wird.
|
||||
' UnhandledException: Wird bei einem Ausnahmefehler ausgelöst.
|
||||
' StartupNextInstance: Wird beim Starten einer Einzelinstanzanwendung ausgelöst, wenn die Anwendung bereits aktiv ist.
|
||||
' NetworkAvailabilityChanged: Wird beim Herstellen oder Trennen der Netzwerkverbindung ausgelöst.
|
||||
Partial Friend Class MyApplication
|
||||
Protected Overrides Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean
|
||||
Return MyBase.OnUnhandledException(e)
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
585
MultiTool.Form/CREATE_DATABASE.sql
Normal file
585
MultiTool.Form/CREATE_DATABASE.sql
Normal file
@@ -0,0 +1,585 @@
|
||||
USE [DD_ECM]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [FK_TBEDI_XML_TYPES]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [FK_TBEDI_XML_NODES]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] DROP CONSTRAINT [DF_TBEDI_XML_TYPES_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] DROP CONSTRAINT [DF_TBEDI_XML_TYPES_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] DROP CONSTRAINT [DF_TBEDI_XML_TYPES_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] DROP CONSTRAINT [DF_TBMT_TEMPLATES_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] DROP CONSTRAINT [DF_TBMT_TEMPLATES_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] DROP CONSTRAINT [DF_TBMT_TEMPLATES_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] DROP CONSTRAINT [DF_TBMT_TABLES_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] DROP CONSTRAINT [DF_TBMT_TABLES_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] DROP CONSTRAINT [DF_TBMT_TABLES_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] DROP CONSTRAINT [DF_TBEDI_XML_NODES_IS_HEAD]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] DROP CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] DROP CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] DROP CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] DROP CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] DROP CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] DROP CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] DROP CONSTRAINT [DF_TBEDI_XML_VALUE_MAPPING_ORDER_KEY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MANDATORS] DROP CONSTRAINT [DF_TBMT_MANDATORS_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_VIRTUAL]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_REQUIRED]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_VISIBLE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_READ_ONLY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] DROP CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ORDER_KEY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] DROP CONSTRAINT [DF_TBMT_FUNCTIONS_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] DROP CONSTRAINT [DF_TBMT_FUNCTIONS_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] DROP CONSTRAINT [DF_TBMT_FUNCTIONS_ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] DROP CONSTRAINT [DF_TBMT_CONFIG_ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] DROP CONSTRAINT [DF_TBMT_CONFIG_ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] DROP CONSTRAINT [DF_TBMT_CONFIG_ACTIVE]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBEDI_XML_TYPES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBEDI_XML_TYPES]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBEDI_XML_TYPES]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TEMPLATES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_TEMPLATES]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_TEMPLATES]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TABLES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_TABLES]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_TABLES]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MAPPING_ENTITIES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_MAPPING_ENTITIES]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_MAPPING_ENTITIES]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MAPPING_CONFIG] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_MAPPING_CONFIG]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_MAPPING_CONFIG]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MANDATORS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_MANDATORS]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_MANDATORS]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TEMPLATE_ITEMS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_TEMPLATE_ITEMS]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_TEMPLATE_ITEMS]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_FUNCTIONS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_FUNCTIONS]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_FUNCTIONS]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_CONFIG] Script Date: 26.11.2021 16:07:58 ******/
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TBMT_CONFIG]') AND type in (N'U'))
|
||||
DROP TABLE [dbo].[TBMT_CONFIG]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_CONFIG] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_CONFIG](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[KEY] [nvarchar](100) NOT NULL,
|
||||
[VALUE] [nvarchar](500) NOT NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK_TBMT_CONFIG] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_FUNCTIONS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_FUNCTIONS](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](max) NOT NULL,
|
||||
[DESCRIPTION] [nvarchar](max) NOT NULL,
|
||||
[PARAMETERS] [nvarchar](max) NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK__TBEDI_XM__15B69B8E0E5FF7EC] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TEMPLATE_ITEMS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_TEMPLATE_ITEMS](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[ORDER_KEY] [int] NOT NULL,
|
||||
[XML_NAME] [nvarchar](50) NOT NULL,
|
||||
[XML_TABLE_ID] [int] NOT NULL,
|
||||
[XML_TYPE_ID] [int] NOT NULL,
|
||||
[IS_READ_ONLY] [bit] NOT NULL,
|
||||
[IS_VISIBLE] [bit] NOT NULL,
|
||||
[IS_REQUIRED] [bit] NOT NULL,
|
||||
[IS_VIRTUAL] [bit] NOT NULL,
|
||||
[FUNCTION_ID] [int] NULL,
|
||||
[FUNCTION_PARAMETERS] [nvarchar](max) NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK__TBEDI_XM__15B69B8E6125D501] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MANDATORS] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_MANDATORS](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](50) NULL,
|
||||
[ORDER_KEY] [int] NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK_TBMT_MANDATORS] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MAPPING_CONFIG] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_MAPPING_CONFIG](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[ORDER_KEY] [int] NOT NULL,
|
||||
[SOURCE_ENTITY_ID] [int] NOT NULL,
|
||||
[SOURCE_REGEX] [nvarchar](100) NOT NULL,
|
||||
[DESTINATION_ENTITY_ID] [int] NOT NULL,
|
||||
[DESTINATION_VALUE] [nvarchar](100) NOT NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [nchar](10) NULL,
|
||||
CONSTRAINT [PK_TBMT_MAPPING_CONFIG] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_MAPPING_ENTITIES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_MAPPING_ENTITIES](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](100) NULL,
|
||||
[ITEM_ID] [int] NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK_TBMT_MAPPING_ENTITIES] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TABLES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_TABLES](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](max) NOT NULL,
|
||||
[TEMPLATE_ID] [int] NOT NULL,
|
||||
[IS_HEAD] [bit] NOT NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK__TBEDI_XM__15B69B8E6F74D014] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBMT_TEMPLATES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBMT_TEMPLATES](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](20) NOT NULL,
|
||||
[DESCRIPTION] [nvarchar](max) NULL,
|
||||
[FILE_NAME] [nvarchar](100) NULL,
|
||||
[IS_IMPORT] [bit] NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK__TBEDI_XM__15B69B8E8C482F3B] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
/****** Object: Table [dbo].[TBEDI_XML_TYPES] Script Date: 26.11.2021 16:07:58 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[TBEDI_XML_TYPES](
|
||||
[GUID] [int] IDENTITY(1,1) NOT NULL,
|
||||
[NAME] [nvarchar](20) NOT NULL,
|
||||
[ACTIVE] [bit] NOT NULL,
|
||||
[COMMENT] [nvarchar](100) NULL,
|
||||
[ADDED_WHO] [nvarchar](50) NOT NULL,
|
||||
[ADDED_WHEN] [datetime] NULL,
|
||||
[CHANGED_WHO] [nvarchar](50) NULL,
|
||||
[CHANGED_WHEN] [datetime] NULL,
|
||||
CONSTRAINT [PK__TBEDI_XM__15B69B8E5B32E7AF] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[GUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_CONFIG] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'YEAR_OVERRIDE', N'2020', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:33:12.413' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, N'WEBSERVICE_BASEURL', N'http://sDD-VMP05-VM01:8181', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:34:07.760' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (4, N'WEBSERVICE_USERNAME', N'DigitalData', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:34:22.930' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (5, N'WEBSERIVCE_PASSWORD', N'dd', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:34:45.617' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (6, N'WEBSERVICE_IMPORT_BASE_PATH', N'\\172.24.12.51\mesonic$\WinLine', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:35:09.290' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (8, N'WEBSERVICE_IMPORT_RELATIVE_PATH', N'', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:35:32.977' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (10, N'INPUT_DIRECTORY', N'P:\Projekte DIGITAL DATA\Schaum\mesonic Projekt\Werks EDI Import\Input', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:37:16.697' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (11, N'OUTPUT_DIRECTORY', N'', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:37:22.447' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_CONFIG] ([GUID], [KEY], [VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (12, N'TEMPLATE_DIRECTORY', N'P:\Projekte DIGITAL DATA\Schaum\mesonic Projekt\Werks EDI Import\Schemata', 1, NULL, N'DEFAULT', CAST(N'2021-11-22T10:37:48.697' AS DateTime), NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_CONFIG] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_FUNCTIONS] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_FUNCTIONS] ([GUID], [NAME], [DESCRIPTION], [PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'GLN', N'Finds an WinLine Account Number by GLN', NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_FUNCTIONS] ([GUID], [NAME], [DESCRIPTION], [PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'EAN', N'Finds an WinLine Article Number by EAN', NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_FUNCTIONS] ([GUID], [NAME], [DESCRIPTION], [PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, N'SQL', N'Finds a Value by SQL Query', N'Query', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_FUNCTIONS] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, 0, N'BELEGKEY', 1, 1, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, 0, N'Fakt_Kontonummer', 1, 1, 0, 1, 0, 0, 1, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, 0, N'Laufnummer', 1, 1, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (4, 0, N'Bestellt_von', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (5, 0, N'Lief_Kontonummer', 1, 1, 0, 1, 0, 0, 1, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (6, 0, N'Lief_Name', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (7, 0, N'Lief_Strasse', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (8, 0, N'Lief_PLZ', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (9, 0, N'Lief_Ort', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (10, 0, N'Belegart', 1, 2, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, CAST(N'2021-11-23T13:26:49.413' AS DateTime))
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (11, 0, N'Datum_Auftrag-Bestellung', 1, 3, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (12, 0, N'Auftrags-Bestellnummer', 1, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (13, 0, N'Leistungsdatum', 1, 3, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (14, 0, N'Infotext', 1, 1, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (15, 0, N'BELEGKEY', 2, 1, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (16, 1, N'Zeilennummer', 2, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (17, 0, N'Datentyp', 2, 2, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (18, 2, N'Artikelnummer', 2, 1, 0, 1, 0, 0, 2, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (19, 3, N'Bezeichnung', 2, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (20, 0, N'Lieferantenartikelnummer', 2, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (21, 0, N'Menge_bestellt', 2, 5, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (22, 0, N'Menge_geliefert', 2, 5, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (23, 0, N'Colli', 2, 1, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (24, 0, N'Einzelpreis', 2, 5, 0, 1, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (25, 0, N'Zeilenrabatt1', 2, 5, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (26, 0, N'Zeilenrabatt2', 2, 5, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (27, 0, N'Zeilenrabatt3', 2, 5, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (28, 0, N'Zeilenrabatt4', 2, 5, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (29, 0, N'Umsatzsteuerprozent_Zeile', 2, 2, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (30, 0, N'EDI_Infotext', 2, 1, 0, 0, 0, 0, NULL, NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (31, 0, N'Lagerstand', 2, 1, 0, 0, 0, 1, 3, N'SELECT (c008 - c009) FROM [CWLDATEN_SIVT].[dbo].[v021] WHERE c002 = ''{#FIELD#Artikelnummer}'' AND MESOCOMP = ''{#CONST#MESOCOMP}'' AND MESOYEAR = {#CONST#MESOYEAR}', 1, NULL, N'DEFAULT', CAST(N'2021-11-23T14:00:35.573' AS DateTime), NULL, CAST(N'2021-11-23T16:05:09.667' AS DateTime))
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID], [ORDER_KEY], [XML_NAME], [XML_TABLE_ID], [XML_TYPE_ID], [IS_READ_ONLY], [IS_VISIBLE], [IS_REQUIRED], [IS_VIRTUAL], [FUNCTION_ID], [FUNCTION_PARAMETERS], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (32, 0, N'EinheitProPalette', 2, 1, 0, 0, 0, 1, 3, N'SELECT TRY_CONVERT(float, ISNULL(c208, 0)) FROM [CWLDATEN_SIVT].[dbo].[v021] WHERE c002 = ''{#FIELD#Artikelnummer}'' AND MESOCOMP = ''{#CONST#MESOCOMP}'' AND MESOYEAR = {#CONST#MESOYEAR}', 1, NULL, N'DEFAULT', CAST(N'2021-11-23T15:41:26.263' AS DateTime), NULL, CAST(N'2021-11-23T15:42:23.123' AS DateTime))
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TEMPLATE_ITEMS] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MANDATORS] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MANDATORS] ([GUID], [NAME], [ORDER_KEY], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'SHGT', 1, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MANDATORS] ([GUID], [NAME], [ORDER_KEY], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'SIVT', 2, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MANDATORS] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MAPPING_CONFIG] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, 1, 2, N'^R[a-zA-Z0-9\-_\s]+$', 1, N'SHGT', 1, NULL, N'DigitalData', NULL, NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, 2, 2, N'^R[a-zA-Z0-9\-_\s]+$', 3, N'1', 1, NULL, N'DigitalData', NULL, NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (5, 3, 2, N'^ABN-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', NULL, NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (6, 4, 2, N'^ABN-[a-zA-Z0-9\-_\s]+$', 3, N'100', 1, NULL, N'DigitalData', CAST(N'2021-11-23T13:30:15.197' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (7, 5, 2, N'^HAU-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:40:10.130' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (8, 6, 2, N'^HAU-[a-zA-Z0-9\-_\s]+$', 3, N'101', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:40:23.803' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (11, 7, 2, N'^SCHI-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:41:22.587' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (12, 8, 2, N'^SCHI-[a-zA-Z0-9\-_\s]+$', 3, N'102', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:41:35.943' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (13, 9, 2, N'^FSC-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:42:05.040' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (15, 10, 2, N'^FSC-[a-zA-Z0-9\-_\s]+$', 3, N'103', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:42:18.227' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (16, 11, 2, N'^HEL-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:43:12.260' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (17, 12, 2, N'^HEL-[a-zA-Z0-9\-_\s]+$', 3, N'104', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:43:21.867' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (19, 13, 2, N'^NIE-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:43:54.493' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (20, 14, 2, N'^NIE-[a-zA-Z0-9\-_\s]+$', 3, N'106', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:44:07.993' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (21, 15, 2, N'^WAL-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:45:02.557' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (22, 16, 2, N'^WAL-[a-zA-Z0-9\-_\s]+$', 3, N'107', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:45:14.463' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (23, 17, 2, N'^HKL-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:45:36.150' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (24, 18, 2, N'^HKL-[a-zA-Z0-9\-_\s]+$', 3, N'108', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:45:46.430' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (25, 19, 2, N'^FIN-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:46:14.730' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (26, 20, 2, N'^FIN-[a-zA-Z0-9\-_\s]+$', 3, N'109', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:46:25.650' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (27, 21, 2, N'^ETH-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:47:34.057' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (28, 22, 2, N'^ETH-[a-zA-Z0-9\-_\s]+$', 3, N'110', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:47:46.963' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (29, 23, 2, N'^BRI-[a-zA-Z0-9\-_\s]+$', 1, N'SIVT', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:48:36.667' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_CONFIG] ([GUID], [ORDER_KEY], [SOURCE_ENTITY_ID], [SOURCE_REGEX], [DESTINATION_ENTITY_ID], [DESTINATION_VALUE], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (30, 24, 2, N'^BRI-[a-zA-Z0-9\-_\s]+$', 3, N'111', 1, NULL, N'DigitalData', CAST(N'2021-11-26T13:49:00.463' AS DateTime), NULL, N'Nov 26 202')
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MAPPING_CONFIG] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MAPPING_ENTITIES] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_ENTITIES] ([GUID], [NAME], [ITEM_ID], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'MANDATOR', NULL, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_ENTITIES] ([GUID], [NAME], [ITEM_ID], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'ARTICLE', 18, 1, NULL, N'DEFAULT', NULL, NULL, CAST(N'2021-11-19T12:27:02.443' AS DateTime))
|
||||
GO
|
||||
INSERT [dbo].[TBMT_MAPPING_ENTITIES] ([GUID], [NAME], [ITEM_ID], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, N'DOCUMENTTYPE', 10, 1, NULL, N'DEFAULT', NULL, NULL, CAST(N'2021-11-19T12:26:06.693' AS DateTime))
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_MAPPING_ENTITIES] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TABLES] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TABLES] ([GUID], [NAME], [TEMPLATE_ID], [IS_HEAD], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'EXIM-VRG_ordersT025', 1, 1, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TABLES] ([GUID], [NAME], [TEMPLATE_ID], [IS_HEAD], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'EXIM-VRG_ordersT026', 1, 0, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TABLES] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TEMPLATES] ON
|
||||
GO
|
||||
INSERT [dbo].[TBMT_TEMPLATES] ([GUID], [NAME], [DESCRIPTION], [FILE_NAME], [IS_IMPORT], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'EXIM-VRG_orders', N'Schaum EDI Aufträge', N'MESOBelegeEXIM-VRG_orders.xsd', 1, 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBMT_TEMPLATES] OFF
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBEDI_XML_TYPES] ON
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (1, N'STRING', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (2, N'INTEGER', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (3, N'DATE', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (4, N'BOOLEAN', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (5, N'DECIMAL', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (6, N'ACCOUNT', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
INSERT [dbo].[TBEDI_XML_TYPES] ([GUID], [NAME], [ACTIVE], [COMMENT], [ADDED_WHO], [ADDED_WHEN], [CHANGED_WHO], [CHANGED_WHEN]) VALUES (7, N'ARTICLE', 1, NULL, N'DEFAULT', NULL, NULL, NULL)
|
||||
GO
|
||||
SET IDENTITY_INSERT [dbo].[TBEDI_XML_TYPES] OFF
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] ADD CONSTRAINT [DF_TBMT_CONFIG_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] ADD CONSTRAINT [DF_TBMT_CONFIG_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_CONFIG] ADD CONSTRAINT [DF_TBMT_CONFIG_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] ADD CONSTRAINT [DF_TBMT_FUNCTIONS_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] ADD CONSTRAINT [DF_TBMT_FUNCTIONS_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_FUNCTIONS] ADD CONSTRAINT [DF_TBMT_FUNCTIONS_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ORDER_KEY] DEFAULT ((0)) FOR [ORDER_KEY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_READ_ONLY] DEFAULT ((0)) FOR [IS_READ_ONLY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_VISIBLE] DEFAULT ((0)) FOR [IS_VISIBLE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_REQUIRED] DEFAULT ((0)) FOR [IS_REQUIRED]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_IS_VIRTUAL] DEFAULT ((0)) FOR [IS_VIRTUAL]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] ADD CONSTRAINT [DF_TBMT_TEMPLATE_ITEMS_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MANDATORS] ADD CONSTRAINT [DF_TBMT_MANDATORS_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] ADD CONSTRAINT [DF_TBEDI_XML_VALUE_MAPPING_ORDER_KEY] DEFAULT ((0)) FOR [ORDER_KEY]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] ADD CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] ADD CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_CONFIG] ADD CONSTRAINT [DF_TBMT_MAPPING_CONFIG_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] ADD CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] ADD CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_MAPPING_ENTITIES] ADD CONSTRAINT [DF_TBMT_MAPPING_ENTITIES_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] ADD CONSTRAINT [DF_TBEDI_XML_NODES_IS_HEAD] DEFAULT ((0)) FOR [IS_HEAD]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] ADD CONSTRAINT [DF_TBMT_TABLES_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] ADD CONSTRAINT [DF_TBMT_TABLES_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TABLES] ADD CONSTRAINT [DF_TBMT_TABLES_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] ADD CONSTRAINT [DF_TBMT_TEMPLATES_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] ADD CONSTRAINT [DF_TBMT_TEMPLATES_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATES] ADD CONSTRAINT [DF_TBMT_TEMPLATES_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] ADD CONSTRAINT [DF_TBEDI_XML_TYPES_ACTIVE] DEFAULT ((1)) FOR [ACTIVE]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] ADD CONSTRAINT [DF_TBEDI_XML_TYPES_ADDED_WHO] DEFAULT (N'DEFAULT') FOR [ADDED_WHO]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBEDI_XML_TYPES] ADD CONSTRAINT [DF_TBEDI_XML_TYPES_ADDED_WHEN] DEFAULT (getdate()) FOR [ADDED_WHEN]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] WITH CHECK ADD CONSTRAINT [FK_TBEDI_XML_NODES] FOREIGN KEY([XML_TABLE_ID])
|
||||
REFERENCES [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID])
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] CHECK CONSTRAINT [FK_TBEDI_XML_NODES]
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] WITH CHECK ADD CONSTRAINT [FK_TBEDI_XML_TYPES] FOREIGN KEY([XML_TYPE_ID])
|
||||
REFERENCES [dbo].[TBMT_TEMPLATE_ITEMS] ([GUID])
|
||||
GO
|
||||
ALTER TABLE [dbo].[TBMT_TEMPLATE_ITEMS] CHECK CONSTRAINT [FK_TBEDI_XML_TYPES]
|
||||
GO
|
||||
7734
MultiTool.Form/DS_DD_ECM.Designer.vb
generated
Normal file
7734
MultiTool.Form/DS_DD_ECM.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user