diff --git a/MultiTool.Form/MultiTool.Form.vbproj b/MultiTool.Form/MultiTool.Form.vbproj
index a033635..e9db2e2 100644
--- a/MultiTool.Form/MultiTool.Form.vbproj
+++ b/MultiTool.Form/MultiTool.Form.vbproj
@@ -315,6 +315,7 @@
+
diff --git a/MultiTool.Form/My Project/Application.Designer.vb b/MultiTool.Form/My Project/Application.Designer.vb
index 30d66b2..3bf596e 100644
--- a/MultiTool.Form/My Project/Application.Designer.vb
+++ b/MultiTool.Form/My Project/Application.Designer.vb
@@ -32,7 +32,7 @@ Namespace My
_
Protected Overrides Sub OnCreateMainForm()
- Me.MainForm = Global.MultiTool.Form.frmImportMain
+ Me.MainForm = Global.MultiTool.Form.frmMain
End Sub
End Class
End Namespace
diff --git a/MultiTool.Form/My Project/Application.myapp b/MultiTool.Form/My Project/Application.myapp
index 3fd3a6f..739ea6f 100644
--- a/MultiTool.Form/My Project/Application.myapp
+++ b/MultiTool.Form/My Project/Application.myapp
@@ -1,7 +1,7 @@
true
- frmImportMain
+ frmMain
false
0
true
diff --git a/MultiTool.Form/My Project/Resources.Designer.vb b/MultiTool.Form/My Project/Resources.Designer.vb
index 92dabba..95bf422 100644
--- a/MultiTool.Form/My Project/Resources.Designer.vb
+++ b/MultiTool.Form/My Project/Resources.Designer.vb
@@ -90,6 +90,16 @@ Namespace My.Resources
End Get
End Property
+ '''
+ ''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
+ '''
+ Friend ReadOnly Property actions_checkcircled1() As DevExpress.Utils.Svg.SvgImage
+ Get
+ Dim obj As Object = ResourceManager.GetObject("actions_checkcircled1", resourceCulture)
+ Return CType(obj,DevExpress.Utils.Svg.SvgImage)
+ End Get
+ End Property
+
'''
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''
diff --git a/MultiTool.Form/My Project/Resources.resx b/MultiTool.Form/My Project/Resources.resx
index 05f29f8..bf6028f 100644
--- a/MultiTool.Form/My Project/Resources.resx
+++ b/MultiTool.Form/My Project/Resources.resx
@@ -121,6 +121,9 @@
..\Resources\logical.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
+ ..\Resources\bo_country.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
..\Resources\redo.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -163,9 +166,6 @@
..\Resources\paymentrefund.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-
- ..\Resources\actions_deletecircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-
..\Resources\open1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -199,8 +199,8 @@
..\Resources\rotatecounterclockwise.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-
- ..\Resources\bo_country.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
+ ..\Resources\actions_deletecircled.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
..\Resources\actions_arrow4down.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -211,6 +211,9 @@
..\Resources\actions_send1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
+ ..\Resources\followupall.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
..\Resources\actions_send.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
@@ -235,7 +238,7 @@
..\Resources\itemtypechecked.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-
- ..\Resources\followupall.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
+
+ ..\Resources\actions_checkcircled1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
\ No newline at end of file
diff --git a/MultiTool.Form/Resources/actions_checkcircled1.svg b/MultiTool.Form/Resources/actions_checkcircled1.svg
new file mode 100644
index 0000000..b1b6aa9
--- /dev/null
+++ b/MultiTool.Form/Resources/actions_checkcircled1.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/MultiTool.Form/Strings/frmShared.Designer.vb b/MultiTool.Form/Strings/frmShared.Designer.vb
index 994412b..e539f01 100644
--- a/MultiTool.Form/Strings/frmShared.Designer.vb
+++ b/MultiTool.Form/Strings/frmShared.Designer.vb
@@ -64,6 +64,24 @@ Namespace My.Resources
End Set
End Property
+ '''
+ ''' Sucht eine lokalisierte Zeichenfolge, die {0} - WebService Multitool für WinLine ähnelt.
+ '''
+ Friend Shared ReadOnly Property _0____WebService_Multitool_für_WinLine() As String
+ Get
+ Return ResourceManager.GetString("{0} - WebService Multitool für WinLine", resourceCulture)
+ End Get
+ End Property
+
+ '''
+ ''' Sucht eine lokalisierte Zeichenfolge, die Auswahl der Vorlage ähnelt.
+ '''
+ Friend Shared ReadOnly Property Auswahl_der_Vorlage() As String
+ Get
+ Return ResourceManager.GetString("Auswahl der Vorlage", resourceCulture)
+ End Get
+ End Property
+
'''
''' Sucht eine lokalisierte Zeichenfolge, die In der Funktion '{0}' ist folgender Fehler aufgetreten: {1} ähnelt.
'''
diff --git a/MultiTool.Form/Strings/frmShared.resx b/MultiTool.Form/Strings/frmShared.resx
index b3a780f..fcb56b7 100644
--- a/MultiTool.Form/Strings/frmShared.resx
+++ b/MultiTool.Form/Strings/frmShared.resx
@@ -117,7 +117,13 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Auswahl der Vorlage
+
In der Funktion '{0}' ist folgender Fehler aufgetreten: {1}
+
+ {0} - WebService Multitool für WinLine
+
\ No newline at end of file
diff --git a/MultiTool.Form/frmImportMain.Designer.vb b/MultiTool.Form/frmImportMain.Designer.vb
index 7c3f04f..a978a39 100644
--- a/MultiTool.Form/frmImportMain.Designer.vb
+++ b/MultiTool.Form/frmImportMain.Designer.vb
@@ -343,6 +343,7 @@ Partial Class frmImportMain
Me.txtCulture.Id = 26
Me.txtCulture.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.followupall
Me.txtCulture.Name = "txtCulture"
+ Me.txtCulture.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph
Me.txtCulture.Tag = "Culture: {0}"
'
'btnRemoveRow
diff --git a/MultiTool.Form/frmImportMain.resx b/MultiTool.Form/frmImportMain.resx
index 76530d2..4e750d6 100644
--- a/MultiTool.Form/frmImportMain.resx
+++ b/MultiTool.Form/frmImportMain.resx
@@ -303,7 +303,7 @@
- WebService Multitool für WinLine
+ {0} - WebService Multitool für WinLine
GridViewFiles
diff --git a/MultiTool.Form/frmImportMain.vb b/MultiTool.Form/frmImportMain.vb
index c80d64b..b8e0cab 100644
--- a/MultiTool.Form/frmImportMain.vb
+++ b/MultiTool.Form/frmImportMain.vb
@@ -1,11 +1,9 @@
-Imports System.ComponentModel
-Imports System.IO
+Imports System.IO
Imports System.Net.Http
Imports System.Xml
Imports DevExpress.Utils.Behaviors.Common
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid
-Imports DigitalData.Controls.SQLConfig
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
@@ -18,31 +16,36 @@ Imports MultiTool.Shared.Constants
Imports MultiTool.Shared.Exceptions
Imports DevExpress.XtraReports.UI
Imports MultiTool.Shared.Documents.DocumentRow
-Imports DevExpress.XtraGrid.Columns
Public Class frmImportMain
- Private LogConfig As LogConfig
+ Public LogConfig As LogConfig
+ Public ConfigManager As ConfigManager(Of Config)
+
Private Logger As Logger
- Private ConfigManager As ConfigManager(Of Config)
Private Database As MSSQLServer
Private Winline As WinlineData
Private FileEx As DigitalData.Modules.Filesystem.File
Private WebService As WebService
Private DocumentLoader As DocumentLoader
- Private SchemaLoader As SchemaLoader
Private FormHelper As FormHelper
Private Grids As List(Of GridControl)
Private GridLoader As GridLoader
Private GridBuilder As GridBuilder
- Private CurrentSchemaName As String = Nothing
- Private CurrentSchema As Schema = Nothing
+ Private ReadOnly CurrentSchema As Schema = Nothing
+
+ ' Runtime variables
Private CurrentGrid As GridControl = Nothing
Private CurrentDocument As Document = Nothing
- Public Sub New()
+ Public Sub New(pLogConfig As LogConfig, pConfigManager As ConfigManager(Of Config), pSchema As Schema)
InitializeComponent()
+
+ LogConfig = pLogConfig
+ ConfigManager = pConfigManager
+ CurrentSchema = pSchema
+
BehaviorManager.Attach(Of PersistenceBehavior)(Me, AddressOf LoadPersistenceSettings)
End Sub
@@ -59,42 +62,18 @@ Public Class frmImportMain
Private Sub frmImportMain_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, Application.CompanyName, Application.ProductName)
Logger = LogConfig.GetLogger()
- Logger.Info("Starting {0}, Version [{1}]", Application.ProductName, Application.ProductVersion)
-
- ConfigManager = New ConfigManager(Of Config)(LogConfig,
- Application.UserAppDataPath,
- Application.CommonAppDataPath,
- Application.StartupPath
- )
-
FormHelper = New FormHelper(LogConfig)
- GridBuilder = New GridBuilder(GridViewFiles)
- GridBuilder.WithDefaults.WithClipboardHandler()
- GridViewFiles.OptionsView.ShowAutoFilterRow = False
-
- 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 = Application.ProductName
- }
- 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)
+
+ GridBuilder = New GridBuilder(GridViewFiles)
+ GridBuilder.WithDefaults.WithReadOnlyOptions.WithClipboardHandler()
+ GridViewFiles.OptionsView.ShowAutoFilterRow = False
+
+ FileEx = New DigitalData.Modules.Filesystem.File(LogConfig)
Winline = New WinlineData(LogConfig, Database, ConfigManager.Config)
WebService = New WebService(LogConfig, ConfigManager.Config, Application.UserAppDataPath)
AddHandler WebService.WebServiceProgress, AddressOf WebService_Progress
@@ -106,6 +85,7 @@ Public Class frmImportMain
txtVersion.Caption = String.Format(My.Resources.frmImportMainExtra.Version__0_, My.Application.Info.Version.ToString)
txtCulture.Caption = String.Format(My.Resources.frmImportMainExtra.Culture___0_, My.Application.UICulture.ToString)
+ Text = String.Format(My.Resources.frmShared._0____WebService_Multitool_für_WinLine, CurrentSchema.Name)
End Sub
Private Async Sub frmImportMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
@@ -119,13 +99,6 @@ Public Class frmImportMain
Winline.LoadEconomicYears()
Await Winline.LoadMandators()
- ' TODO: Comment in when we finally use the database for additional configuration
- SplashScreenManager.SetWaitFormDescription("Lade Schema Informationen")
- If Await Winline.LoadTemplateConfiguration() = False Then
- Logger.Warn("Template Configuration was not loaded!")
- Winline.TemplateConfiguration = Nothing
- End If
-
For Each oMandator As Mandator In Winline.Mandators
SplashScreenManager.SetWaitFormDescription(String.Format(My.Resources.frmImportMainExtra.Lade__0__Konten, oMandator.Id))
Await Winline.LoadAccounts(oMandator)
@@ -142,18 +115,14 @@ Public Class frmImportMain
lookupMandator.Properties.View.BestFitColumns()
DocumentLoader = New DocumentLoader(LogConfig, Winline)
- SchemaLoader = New SchemaLoader(LogConfig)
GridLoader = New GridLoader(LogConfig)
SplashScreenManager.SetWaitFormDescription(My.Resources.frmImportMainExtra.Lade_Vorlagen)
- SchemaLoader.LoadFiles(ConfigManager.Config.SchemaDirectory)
- CurrentSchemaName = SchemaLoader.SchemaList.First().FullName
-
- CurrentSchema = SchemaLoader.GetSchemaFromFile(CurrentSchemaName)
- CurrentSchema = SchemaLoader.UpdateSchemaWithDatabaseConfiguration(CurrentSchema, Winline.TemplateConfiguration)
-
-
+ 'SchemaLoader.LoadFiles(ConfigManager.Config.SchemaDirectory)
+ 'CurrentSchemaName = SchemaLoader.SchemaList.First().FullName
+ 'CurrentSchema = SchemaLoader.GetSchemaFromFile(CurrentSchemaName)
+ 'CurrentSchema = SchemaLoader.UpdateSchemaWithDatabaseConfiguration(CurrentSchema, SchemaLoader.TemplateConfiguration)
Grids = CreateGridsAndColumns(CurrentSchema)
diff --git a/MultiTool.Form/frmMain.Designer.vb b/MultiTool.Form/frmMain.Designer.vb
index 2d5be82..258bc25 100644
--- a/MultiTool.Form/frmMain.Designer.vb
+++ b/MultiTool.Form/frmMain.Designer.vb
@@ -1,6 +1,6 @@
_
Partial Class frmMain
- Inherits DevExpress.XtraEditors.XtraForm
+ Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'Form overrides dispose to clean up the component list.
_
@@ -19,75 +19,143 @@ Partial Class frmMain
'Do not modify it using the code editor.
_
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.components = New System.ComponentModel.Container()
+ Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl()
+ Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem()
+ Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage()
+ Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup()
+ Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
+ Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
+ Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components)
+ Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
+ Me.GridViewTemplates = New DevExpress.XtraGrid.Views.Grid.GridView()
+ Me.colName = New DevExpress.XtraGrid.Columns.GridColumn()
+ Me.colDescription = New DevExpress.XtraGrid.Columns.GridColumn()
+ Me.colFileName = New DevExpress.XtraGrid.Columns.GridColumn()
+ CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
+ CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).BeginInit()
+ CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).BeginInit()
+ CType(Me.GridViewTemplates, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
- 'LabelControl1
+ 'RibbonControl1
'
- 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"
+ Me.RibbonControl1.ExpandCollapseItem.Id = 0
+ Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.BarButtonItem1})
+ Me.RibbonControl1.Location = New System.Drawing.Point(0, 0)
+ Me.RibbonControl1.MaxItemId = 2
+ Me.RibbonControl1.Name = "RibbonControl1"
+ Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
+ Me.RibbonControl1.Size = New System.Drawing.Size(757, 158)
+ Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
'
- 'LabelControl2
+ 'BarButtonItem1
'
- 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"
+ Me.BarButtonItem1.Caption = "Vorlage verwenden"
+ Me.BarButtonItem1.Id = 1
+ Me.BarButtonItem1.ImageOptions.SvgImage = Global.MultiTool.Form.My.Resources.Resources.actions_checkcircled1
+ Me.BarButtonItem1.Name = "BarButtonItem1"
'
- 'ListBoxControl1
+ 'RibbonPage1
'
- 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
+ Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1})
+ Me.RibbonPage1.Name = "RibbonPage1"
+ Me.RibbonPage1.Text = "RibbonPage1"
'
- 'ListBoxControl2
+ 'RibbonPageGroup1
'
- 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
+ Me.RibbonPageGroup1.ItemLinks.Add(Me.BarButtonItem1)
+ Me.RibbonPageGroup1.Name = "RibbonPageGroup1"
+ Me.RibbonPageGroup1.Text = "RibbonPageGroup1"
'
- 'SimpleButton1
+ 'RibbonStatusBar1
'
- 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"
+ Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 513)
+ Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
+ Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
+ Me.RibbonStatusBar1.Size = New System.Drawing.Size(757, 24)
+ '
+ 'RibbonPage2
+ '
+ Me.RibbonPage2.Name = "RibbonPage2"
+ Me.RibbonPage2.Text = "RibbonPage2"
+ '
+ 'SvgImageCollection1
+ '
+ Me.SvgImageCollection1.Add("import", "image://svgimages/scheduling/import.svg")
+ Me.SvgImageCollection1.Add("export", "image://svgimages/export/export.svg")
+ '
+ 'GridControl1
+ '
+ Me.GridControl1.Dock = System.Windows.Forms.DockStyle.Fill
+ Me.GridControl1.Location = New System.Drawing.Point(0, 158)
+ Me.GridControl1.MainView = Me.GridViewTemplates
+ Me.GridControl1.MenuManager = Me.RibbonControl1
+ Me.GridControl1.Name = "GridControl1"
+ Me.GridControl1.Size = New System.Drawing.Size(757, 355)
+ Me.GridControl1.TabIndex = 9
+ Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridViewTemplates})
+ '
+ 'GridView1
+ '
+ Me.GridViewTemplates.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.colName, Me.colDescription, Me.colFileName})
+ Me.GridViewTemplates.GridControl = Me.GridControl1
+ Me.GridViewTemplates.Name = "GridView1"
+ '
+ 'colName
+ '
+ Me.colName.Caption = "Name"
+ Me.colName.FieldName = "Name"
+ Me.colName.Name = "colName"
+ Me.colName.Visible = True
+ Me.colName.VisibleIndex = 0
+ '
+ 'colDescription
+ '
+ Me.colDescription.Caption = "Beschreibung"
+ Me.colDescription.FieldName = "Description"
+ Me.colDescription.Name = "colDescription"
+ Me.colDescription.Visible = True
+ Me.colDescription.VisibleIndex = 1
+ '
+ 'colFileName
+ '
+ Me.colFileName.Caption = "Dateiname"
+ Me.colFileName.FieldName = "FileName"
+ Me.colFileName.Name = "colFileName"
+ Me.colFileName.Visible = True
+ Me.colFileName.VisibleIndex = 2
'
'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.Controls.Add(Me.GridControl1)
+ Me.Controls.Add(Me.RibbonStatusBar1)
+ Me.Controls.Add(Me.RibbonControl1)
Me.Name = "frmMain"
+ Me.Ribbon = Me.RibbonControl1
+ Me.StatusBar = Me.RibbonStatusBar1
Me.Text = "frmMain"
- CType(Me.ListBoxControl1, System.ComponentModel.ISupportInitialize).EndInit()
- CType(Me.ListBoxControl2, System.ComponentModel.ISupportInitialize).EndInit()
+ CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit()
+ CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).EndInit()
+ CType(Me.GridControl1, System.ComponentModel.ISupportInitialize).EndInit()
+ CType(Me.GridViewTemplates, 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
+ Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl
+ Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage
+ Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
+ Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
+ Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
+ Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
+ Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection
+ Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
+ Friend WithEvents GridViewTemplates As DevExpress.XtraGrid.Views.Grid.GridView
+ Friend WithEvents colName As DevExpress.XtraGrid.Columns.GridColumn
+ Friend WithEvents colDescription As DevExpress.XtraGrid.Columns.GridColumn
+ Friend WithEvents colFileName As DevExpress.XtraGrid.Columns.GridColumn
End Class
diff --git a/MultiTool.Form/frmMain.resx b/MultiTool.Form/frmMain.resx
index 1af7de1..f722219 100644
--- a/MultiTool.Form/frmMain.resx
+++ b/MultiTool.Form/frmMain.resx
@@ -117,4 +117,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 17, 17
+
\ No newline at end of file
diff --git a/MultiTool.Form/frmMain.vb b/MultiTool.Form/frmMain.vb
index 13a8003..bc6d120 100644
--- a/MultiTool.Form/frmMain.vb
+++ b/MultiTool.Form/frmMain.vb
@@ -1,3 +1,83 @@
-Public Class frmMain
+Imports System.ComponentModel
+Imports System.IO
+Imports DigitalData.Controls.SQLConfig
+Imports DigitalData.GUIs.Common
+Imports DigitalData.Modules.Config
+Imports DigitalData.Modules.Database
+Imports DigitalData.Modules.Logging
+Imports MultiTool.Shared.Schemas
+Public Class frmMain
+ Private LogConfig As LogConfig
+ Private Logger As Logger
+ Private ConfigManager As ConfigManager(Of [Shared].Config)
+ Private Database As MSSQLServer
+ Private SchemaLoader As SchemaLoader
+ Private GridBuilder As GridBuilder
+
+ Private Async Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, Application.CompanyName, Application.ProductName)
+ Logger = LogConfig.GetLogger()
+ Logger.Info("Starting {0}, Version [{1}]", Application.ProductName, Application.ProductVersion)
+
+ Text = String.Format(My.Resources.frmShared._0____WebService_Multitool_für_WinLine, My.Resources.frmShared.Auswahl_der_Vorlage)
+
+ ConfigManager = New ConfigManager(Of [Shared].Config)(LogConfig,
+ Application.UserAppDataPath,
+ Application.CommonAppDataPath,
+ Application.StartupPath
+ )
+
+ GridBuilder = New GridBuilder(GridViewTemplates)
+ GridBuilder.WithDefaults.WithReadOnlyOptions.WithClipboardHandler()
+ GridViewTemplates.OptionsView.ShowAutoFilterRow = False
+
+ ' If ConnectionString does not exist, show SQL Config Form
+ If ConfigManager.Config.ConnectionString = String.Empty Then
+ Dim oForm As New frmSQLConfig(LogConfig) With {
+ .FormTitle = Application.ProductName
+ }
+ 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)
+
+ ' Initialize Schemas
+ SchemaLoader = New SchemaLoader(LogConfig, Database, ConfigManager.Config.SchemaDirectory)
+ Await SchemaLoader.LoadTemplates()
+ Await SchemaLoader.LoadTemplateConfiguration()
+
+ Dim oBindingSource = New BindingList(Of Schema)
+ For Each oSchema As Schema In SchemaLoader.SchemaList
+ oBindingSource.Add(oSchema)
+ Next
+
+ GridControl1.DataSource = oBindingSource
+ End Sub
+
+ Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
+ Dim oSchema = GridViewTemplates.GetRow(GridViewTemplates.FocusedRowHandle)
+
+ If oSchema Is Nothing Then
+ MsgBox("Keine Vorlage ausgewählt! Bitte wählen Sie eine Vorlage aus!", MsgBoxStyle.Exclamation, Text)
+ Exit Sub
+ End If
+
+ oSchema = SchemaLoader.UpdateSchemaFromFile(oSchema, ConfigManager.Config.SchemaDirectory)
+ oSchema = SchemaLoader.UpdateSchemaFromDatabase(oSchema, SchemaLoader.TemplateConfiguration)
+
+ Dim oForm As New frmImportMain(LogConfig, ConfigManager, oSchema)
+ oForm.ShowDialog()
+ End Sub
+
+ Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click
+
+ End Sub
End Class
\ No newline at end of file
diff --git a/MultiTool.Shared/Helpers.vb b/MultiTool.Shared/Helpers.vb
new file mode 100644
index 0000000..cf05499
--- /dev/null
+++ b/MultiTool.Shared/Helpers.vb
@@ -0,0 +1,11 @@
+Imports DigitalData.Modules.Language
+
+Public Class Helpers
+ Public Shared Function GetRowItem(Of T)(pRow As DataRow, pFieldName As String, Optional pDefaultValue As T = Nothing) As T
+ Try
+ Return Utils.NotNull(pRow.Item(pFieldName), pDefaultValue)
+ Catch ex As Exception
+ Return Nothing
+ End Try
+ End Function
+End Class
diff --git a/MultiTool.Shared/MultiTool.Shared.vbproj b/MultiTool.Shared/MultiTool.Shared.vbproj
index 9ee43a9..5255e76 100644
--- a/MultiTool.Shared/MultiTool.Shared.vbproj
+++ b/MultiTool.Shared/MultiTool.Shared.vbproj
@@ -104,6 +104,7 @@
+
@@ -134,14 +135,14 @@
-
+
-
+
diff --git a/MultiTool.Shared/Winline/Entities/ColumnConfig.vb b/MultiTool.Shared/Schemas/ColumnConfig.vb
similarity index 97%
rename from MultiTool.Shared/Winline/Entities/ColumnConfig.vb
rename to MultiTool.Shared/Schemas/ColumnConfig.vb
index 72c642e..0c0eec9 100644
--- a/MultiTool.Shared/Winline/Entities/ColumnConfig.vb
+++ b/MultiTool.Shared/Schemas/ColumnConfig.vb
@@ -1,6 +1,6 @@
Imports MultiTool.Shared.Constants
-Namespace Winline
+Namespace Schemas
Public Class ColumnConfig
Public Property Name As String
Public Property Table As String
diff --git a/MultiTool.Shared/Winline/Configuration.vb b/MultiTool.Shared/Schemas/Configuration.vb
similarity index 78%
rename from MultiTool.Shared/Winline/Configuration.vb
rename to MultiTool.Shared/Schemas/Configuration.vb
index 0c122c1..b0cb2cd 100644
--- a/MultiTool.Shared/Winline/Configuration.vb
+++ b/MultiTool.Shared/Schemas/Configuration.vb
@@ -1,10 +1,12 @@
-Namespace Winline
+Imports MultiTool.Shared.Winline
+
+Namespace Schemas
'''
''' Class for loading column/field config from database
'''
Public Class Configuration
- Public Columns As List(Of Winline.ColumnConfig)
+ Public Columns As List(Of ColumnConfig)
Public Function GetColumn(pName As String) As ColumnConfig
Return Columns.
diff --git a/MultiTool.Shared/Schemas/Schema.vb b/MultiTool.Shared/Schemas/Schema.vb
index 24da6c7..7ce0a8f 100644
--- a/MultiTool.Shared/Schemas/Schema.vb
+++ b/MultiTool.Shared/Schemas/Schema.vb
@@ -1,9 +1,14 @@
-Imports MultiTool.Shared.Winline
+Imports System.IO
+Imports MultiTool.Shared.Winline
Namespace Schemas
Public Class Schema
- Public Property Tables As New List(Of Table)
Public Property Name As String
+ Public Property FileName As String
+ Public Property Description As String
+ Public Property IsImport As Boolean
+
+ Public Property Tables As New List(Of Table)
Class Table
Public Property Name As String
diff --git a/MultiTool.Shared/Schemas/SchemaLoader.vb b/MultiTool.Shared/Schemas/SchemaLoader.vb
index 891a227..976c52d 100644
--- a/MultiTool.Shared/Schemas/SchemaLoader.vb
+++ b/MultiTool.Shared/Schemas/SchemaLoader.vb
@@ -1,7 +1,8 @@
Imports System.IO
-Imports System.Xml
-Imports System.Xml.XPath
+Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
+Imports MultiTool.Shared.Winline
+Imports MultiTool.Shared.Helpers
Namespace Schemas
Public Class SchemaLoader
@@ -9,42 +10,95 @@ Namespace Schemas
Private ReadOnly ns As XNamespace = "http://www.w3.org/2001/XMLSchema"
- Public SchemaList As List(Of FileInfo)
+ Public SchemaList As List(Of Schema)
+ Public TemplateConfiguration As New Configuration
- Public Sub New(pLogConfig As LogConfig)
+ Private Database As MSSQLServer
+ Private InputDirectory As String
+
+ Private Const VWEDI_XML_ITEMS = "VWEDI_XML_ITEMS"
+
+ Public Sub New(pLogConfig As LogConfig, pMSSQL As MSSQLServer, pInputDirectory As String)
MyBase.New(pLogConfig, pLogConfig.GetLogger)
+ Database = pMSSQL
+ InputDirectory = pInputDirectory
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)
-
+ Public Async Function LoadTemplates() As Task(Of Boolean)
Try
- Dim oDirectory As New DirectoryInfo(pSchemaDirectory)
- Dim oFiles = oDirectory.GetFiles()
+ Dim oSql = $"SELECT * FROM [DD_ECM].[dbo].[TBEDI_XML_TEMPLATES]"
+ Dim oTable As DataTable = Await Database.GetDatatableAsync(oSql)
+ Dim oTemplates As New List(Of Schema)
- Logger.Debug("Found [{0}] files in directory [{1}]", oFiles.Count, oDirectory)
+ For Each oRow As DataRow In oTable.Rows
+ Dim oTemplate As New Schema With {
+ .Name = GetRowItem(oRow, "NAME", String.Empty),
+ .Description = GetRowItem(oRow, "DESCRIPTION", String.Empty),
+ .FileName = GetRowItem(oRow, "FILE_NAME", String.Empty),
+ .IsImport = GetRowItem(oRow, "IS_IMPORT", True)
+ }
- SchemaList = oFiles.ToList()
+ oTemplates.Add(oTemplate)
+ Next
+
+ SchemaList = oTemplates
+
+ 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 oSql = $"SELECT * FROM [DD_ECM].[dbo].[{VWEDI_XML_ITEMS}]"
+ Dim oTable As DataTable = Await Database.GetDatatableAsync(oSql)
+ Dim oItems As New List(Of ColumnConfig)
+
+ For Each oRow As DataRow In oTable.Rows
+ Dim oColumn As New ColumnConfig() With {
+ .Template = GetRowItem(oRow, "TEMPLATE_NAME", String.Empty),
+ .Table = GetRowItem(oRow, "XML_TABLE", String.Empty),
+ .Name = GetRowItem(oRow, "XML_ITEM", String.Empty),
+ .Type = ColumnConfig.ConvertType(GetRowItem(oRow, "DATA_TYPE", String.Empty)),
+ .OrderKey = GetRowItem(oRow, "ORDER_KEY", 0),
+ .IsReadOnly = GetRowItem(oRow, "IS_READ_ONLY", False),
+ .IsVisible = GetRowItem(oRow, "IS_VISIBLE", True),
+ .IsRequired = GetRowItem(oRow, "IS_REQUIRED", False),
+ .IsHead = GetRowItem(oRow, "IS_HEAD", True),
+ .[Function] = New ColumnConfig.ColumnFunction With {
+ .Id = GetRowItem(oRow, "FUNCTION_ID", 0),
+ .Name = GetRowItem(oRow, "FUNCTION_NAME", String.Empty),
+ .Params = GetRowItem(oRow, "FUNCTION_PARAMETERS", String.Empty)
+ }
+ }
+
+ oItems.Add(oColumn)
+ Next
+
+ TemplateConfiguration = New Configuration With {
+ .Columns = oItems
+ }
Return True
Catch ex As Exception
Logger.Error(ex)
- Throw New IO.IOException($"Could not load files from directory {pSchemaDirectory}", ex)
+ Return False
End Try
End Function
- Public Function GetSchemaFromFile(pSchemaFilePath As String) As Schema
- Dim oSchema As New Schema
- Dim oFileInfo As New FileInfo(pSchemaFilePath)
- Dim oElements = GetSchemaElements(pSchemaFilePath)
+ Public Function UpdateSchemaFromFile(pSchema As Schema, pInputDirectory As String) As Schema
+ Dim oFullPath = Path.Combine(pInputDirectory, pSchema.FileName)
- oSchema.Name = oFileInfo.Name
+ If Not IO.File.Exists(oFullPath) Then
+ Throw New FileNotFoundException(oFullPath)
+ End If
+
+ Dim oElements = GetSchemaElements(oFullPath)
For Each oElement In oElements
Dim oColumns = GetElementColumns(oElement)
@@ -69,17 +123,17 @@ Namespace Schemas
oSchemaColumns.Add(oSchemaColumn)
Next
- oSchema.Tables.Add(New Schema.Table With {
+ pSchema.Tables.Add(New Schema.Table With {
.Name = XmlData.GetElementAttribute(oElement, "name"),
.Columns = oSchemaColumns
})
Next
- Return oSchema
+ Return pSchema
End Function
- Public Function UpdateSchemaWithDatabaseConfiguration(pSchema As Schema, pTemplateConfig As Winline.Configuration) As Schema
+ Public Function UpdateSchemaFromDatabase(pSchema As Schema, pTemplateConfig As Configuration) As Schema
If pTemplateConfig Is Nothing Then
Return pSchema
End If
@@ -89,7 +143,7 @@ Namespace Schemas
Dim oConfig = pTemplateConfig.GetColumn(oColumn.Name)
If oConfig Is Nothing Then
- oConfig = New Winline.ColumnConfig With {
+ oConfig = New ColumnConfig With {
.IsRequired = oColumn.IsRequired,
.Name = oColumn.Name
}
diff --git a/MultiTool.Shared/Winline/WinlineData.vb b/MultiTool.Shared/Winline/WinlineData.vb
index 1eed0c5..744d61b 100644
--- a/MultiTool.Shared/Winline/WinlineData.vb
+++ b/MultiTool.Shared/Winline/WinlineData.vb
@@ -1,6 +1,7 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Database
+Imports MultiTool.Shared.Helpers
Imports System.Text.RegularExpressions
Namespace Winline
@@ -16,12 +17,9 @@ Namespace Winline
Public DocumentKinds As New List(Of DocumentKind)
Public Years As List(Of Integer)
- Public TemplateConfiguration As New Configuration
Public Const ALL_MESOCOMP = "mesocomp"
- Public Const VWEDI_XML_ITEMS = "VWEDI_XML_ITEMS"
-
Public Const V21_ARTICLENUMBER = "c002"
Public Const V21_ARTICLEDESCRIPTION = "c003"
Public Const V21_MAINARTICLENUMBER = "c011"
@@ -487,47 +485,6 @@ Namespace Winline
End If
End Function
- Public Async Function LoadTemplateConfiguration() As Task(Of Boolean)
- Try
- Dim oSql = $"SELECT * FROM [DD_ECM].[dbo].[{VWEDI_XML_ITEMS}]"
- Dim oTable As DataTable = Await Database.GetDatatableAsync(oSql)
- Dim oItems As New List(Of ColumnConfig)
-
- For Each oRow As DataRow In oTable.Rows
- Dim oColumn As New ColumnConfig() With {
- .Template = GetRowItem(oRow, "TEMPLATE_NAME", String.Empty),
- .Table = GetRowItem(oRow, "XML_TABLE", String.Empty),
- .Name = GetRowItem(oRow, "XML_ITEM", String.Empty),
- .Type = ColumnConfig.ConvertType(GetRowItem(oRow, "DATA_TYPE", String.Empty)),
- .OrderKey = GetRowItem(oRow, "ORDER_KEY", 0),
- .IsReadOnly = GetRowItem(oRow, "IS_READ_ONLY", False),
- .IsVisible = GetRowItem(oRow, "IS_VISIBLE", True),
- .IsRequired = GetRowItem(oRow, "IS_REQUIRED", False),
- .IsHead = GetRowItem(oRow, "IS_HEAD", True),
- .[Function] = New ColumnConfig.ColumnFunction With {
- .Id = GetRowItem(oRow, "FUNCTION_ID", 0),
- .Name = GetRowItem(oRow, "FUNCTION_NAME", String.Empty),
- .Params = GetRowItem(oRow, "FUNCTION_PARAMETERS", String.Empty)
- }
- }
-
- oItems.Add(oColumn)
- Next
-
- Dim oColumns = oItems
- TemplateConfiguration = New Configuration With {
- .Columns = oColumns
- }
-
- Return True
-
- Catch ex As Exception
- Logger.Error(ex)
- Return False
-
- End Try
- End Function
-
'''
''' Turns a database info like "SQLCWLDATEN on SERVER\INSTANCE" into a Tuple of two strings
'''
@@ -552,14 +509,5 @@ Namespace Winline
Split(oDelimiter, StringSplitOptions.None).
ToList()
End Function
-
-
- Private Function GetRowItem(Of T)(pRow As DataRow, pFieldName As String, Optional pDefaultValue As T = Nothing) As T
- Try
- Return Utils.NotNull(pRow.Item(pFieldName), pDefaultValue)
- Catch ex As Exception
- Return Nothing
- End Try
- End Function
End Class
End Namespace