wip
This commit is contained in:
@@ -31,11 +31,13 @@ Public Class frmMain
|
||||
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)
|
||||
Logger = LogConfig.GetLogger()
|
||||
|
||||
' If ConnectionString does not exist, show SQL Config Form
|
||||
If ConfigManager.Config.ConnectionString = String.Empty Then
|
||||
@@ -76,12 +78,16 @@ Public Class frmMain
|
||||
' 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)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden der Anwendung")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
@@ -90,6 +96,10 @@ Public Class frmMain
|
||||
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())
|
||||
@@ -174,17 +184,17 @@ Public Class frmMain
|
||||
End Select
|
||||
|
||||
Catch ex As Xml.XmlException
|
||||
Dim oMessage As String = $"Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}"
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exceptions.NoMandatorException
|
||||
Dim oMessage As String = $"Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}"
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exception
|
||||
Dim oMessage As String = $"Unerwarteter Fehler beim Laden des Dokuments {pDocument.Name}:{vbNewLine}{ex.Message}"
|
||||
Dim oMessage = GetErrorMessage(ex, "Fehler beim Laden des Dokuments")
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, Text)
|
||||
Logger.Error(ex)
|
||||
|
||||
@@ -211,7 +221,10 @@ Public Class frmMain
|
||||
txtRunningNumber.Text = oHead.Laufnummer
|
||||
txtOrderIssuer.Text = oHead.Fakt_Ansprechpartner
|
||||
txtOrderNumber.Text = oHead.AuftragsBestellnummer
|
||||
txtDocumentKind.Text = oHead.Belegart
|
||||
|
||||
' TODO: Get Doc Kind from Winline Class
|
||||
cmdDocumentKind.Text = oHead.Belegart
|
||||
|
||||
txtDocumentReference.Text = oHead.Auftragsreferenz
|
||||
dateOrderDate.EditValue = oHead.Datum_AuftragBestellung
|
||||
|
||||
@@ -267,9 +280,6 @@ Public Class frmMain
|
||||
|
||||
End If
|
||||
|
||||
|
||||
PositionGrid.LoadPositionViewAndColumns(GridViewPositions, DocumentType.Order)
|
||||
|
||||
Dim oPositionList = PositionData.Load(oData, oDataOriginal)
|
||||
GridControlPositions.DataSource = oPositionList
|
||||
GridViewPositions.BestFitColumns()
|
||||
|
||||
Reference in New Issue
Block a user