Compare commits

...

2 Commits

Author SHA1 Message Date
Jonathan Jenne
8692dc595e add progress box for webservice calls 2021-11-01 12:37:48 +01:00
Jonathan Jenne
63d61c0e22 set Layout of Xml Editor to simple 2021-11-01 11:25:39 +01:00
3 changed files with 23 additions and 7 deletions

View File

@@ -92,6 +92,7 @@ Public Class frmImportMain
Database = New MSSQLServer(LogConfig, oConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString)
Winline = New Data(LogConfig, Database, ConfigManager.Config) Winline = New Data(LogConfig, Database, ConfigManager.Config)
WebService = New WebService(LogConfig, ConfigManager.Config, Application.UserAppDataPath) WebService = New WebService(LogConfig, ConfigManager.Config, Application.UserAppDataPath)
AddHandler WebService.WebServiceProgress, AddressOf WebService_Progress
Catch ex As Exception Catch ex As Exception
FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Initialisieren_der_Anwendungs_Daten) FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Initialisieren_der_Anwendungs_Daten)
End Try End Try
@@ -145,8 +146,6 @@ Public Class frmImportMain
SplashScreenManager.CloseWaitForm() SplashScreenManager.CloseWaitForm()
btnLoadFiles.Enabled = True btnLoadFiles.Enabled = True
End Try End Try
End Sub End Sub
@@ -353,8 +352,9 @@ Public Class frmImportMain
Private Async Sub btnTransferFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnTransferFile.ItemClick Private Async Sub btnTransferFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnTransferFile.ItemClick
Try Try
GridViewFiles.ShowLoadingPanel() SplashScreenManager.ShowWaitForm()
SetDocumentButtonsEnabled(False) SetDocumentButtonsEnabled(False)
GridControlFiles.Enabled = False
btnLoadFiles.Enabled = False btnLoadFiles.Enabled = False
SplitContainerGrids.Enabled = False SplitContainerGrids.Enabled = False
@@ -371,12 +371,16 @@ Public Class frmImportMain
Finally Finally
SplitContainerGrids.Enabled = True SplitContainerGrids.Enabled = True
btnLoadFiles.Enabled = True btnLoadFiles.Enabled = True
SetDocumentButtonsEnabled(False) GridControlFiles.Enabled = True
GridViewFiles.HideLoadingPanel() SetDocumentButtonsEnabled(True)
SplashScreenManager.CloseWaitForm()
End Try End Try
End Sub End Sub
Private Sub WebService_Progress(sender As Object, e As String)
SplashScreenManager.SetWaitFormDescription(e)
End Sub
Private Sub btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick Private Sub btnOpenInputDirectory_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnOpenInputDirectory.ItemClick
TryOpenDirectory(ConfigManager.Config.InputDirectory, My.Resources.frmImportMainExtra.Eingangsverzeichnis) TryOpenDirectory(ConfigManager.Config.InputDirectory, My.Resources.frmImportMainExtra.Eingangsverzeichnis)
End Sub End Sub

View File

@@ -24,10 +24,12 @@ Partial Class frmXmlEditor
' '
'RichEditControl1 'RichEditControl1
' '
Me.RichEditControl1.ActiveViewType = DevExpress.XtraRichEdit.RichEditViewType.Simple
Me.RichEditControl1.Appearance.Text.Font = New System.Drawing.Font("Consolas", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RichEditControl1.Appearance.Text.Font = New System.Drawing.Font("Consolas", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.RichEditControl1.Appearance.Text.Options.UseFont = True Me.RichEditControl1.Appearance.Text.Options.UseFont = True
Me.RichEditControl1.Cursor = System.Windows.Forms.Cursors.Default Me.RichEditControl1.Cursor = System.Windows.Forms.Cursors.Default
Me.RichEditControl1.Dock = System.Windows.Forms.DockStyle.Fill Me.RichEditControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.RichEditControl1.LayoutUnit = DevExpress.XtraRichEdit.DocumentLayoutUnit.Pixel
Me.RichEditControl1.Location = New System.Drawing.Point(0, 0) Me.RichEditControl1.Location = New System.Drawing.Point(0, 0)
Me.RichEditControl1.Name = "RichEditControl1" Me.RichEditControl1.Name = "RichEditControl1"
Me.RichEditControl1.Options.HorizontalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden Me.RichEditControl1.Options.HorizontalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden
@@ -46,7 +48,7 @@ Partial Class frmXmlEditor
Me.Controls.Add(Me.RichEditControl1) Me.Controls.Add(Me.RichEditControl1)
Me.Font = New System.Drawing.Font("Consolas", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Font = New System.Drawing.Font("Consolas", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "frmXmlEditor" Me.Name = "frmXmlEditor"
Me.Text = "frmXmlEditor" Me.Text = "Xml Editor"
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub

View File

@@ -13,6 +13,8 @@ Namespace Winline
Private ReadOnly Serializer As Serializer Private ReadOnly Serializer As Serializer
Private ReadOnly AppDataPath As String Private ReadOnly AppDataPath As String
Public Event WebServiceProgress As EventHandler(Of String)
Public Sub New(pLogConfig As LogConfig, pConfig As Config, pAppDataPath As String) Public Sub New(pLogConfig As LogConfig, pConfig As Config, pAppDataPath As String)
MyBase.New(pLogConfig, pLogConfig.GetLogger()) MyBase.New(pLogConfig, pLogConfig.GetLogger())
Serializer = New Serializer(pLogConfig) Serializer = New Serializer(pLogConfig)
@@ -32,6 +34,8 @@ Namespace Winline
IO.Directory.CreateDirectory(oPath) IO.Directory.CreateDirectory(oPath)
End If End If
RaiseEvent WebServiceProgress(Me, "Einstellungen laden")
' --- Build all teh filenamez and pathz ' --- Build all teh filenamez and pathz
Dim oBaseFileName As String = GetBaseFilenameForRequest() Dim oBaseFileName As String = GetBaseFilenameForRequest()
@@ -46,6 +50,8 @@ Namespace Winline
' --- Serialize Data into XML string ' --- Serialize Data into XML string
RaiseEvent WebServiceProgress(Me, "Dateien schreiben")
Dim oOutputFilePath = IO.Path.Combine(GetBaseWebServicePath(), oFileName) Dim oOutputFilePath = IO.Path.Combine(GetBaseWebServicePath(), oFileName)
IO.File.WriteAllBytes(oOutputFilePath, oBytes) IO.File.WriteAllBytes(oOutputFilePath, oBytes)
@@ -77,6 +83,8 @@ Namespace Winline
Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl) Logger.Info("Creating HTTP Request to [{0}]", oWS.BaseUrl)
RaiseEvent WebServiceProgress(Me, "Anfrage absenden")
' --- Bring the action! ' --- Bring the action!
Try Try
Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL) Dim oResponse As HttpResponseMessage = Await oClient.GetAsync(oURL)
@@ -97,6 +105,8 @@ Namespace Winline
Dim oContentType = pResponse.Content.Headers.ContentType.MediaType Dim oContentType = pResponse.Content.Headers.ContentType.MediaType
Dim oSerializer = Serializer.GetSerializer(GetType(Schemas.MESOWebServiceResult)) Dim oSerializer = Serializer.GetSerializer(GetType(Schemas.MESOWebServiceResult))
RaiseEvent WebServiceProgress(Me, "Antwort verarbeiten")
Select Case oContentType Select Case oContentType
Case "text/xml" Case "text/xml"
WriteResponseFile(pPath, pBaseFileNAme, oResponseBody, "xml") WriteResponseFile(pPath, pBaseFileNAme, oResponseBody, "xml")