From cd1cdfe19a7a7bc48b7e2394bc257ce2a6e24dba Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Fri, 13 May 2022 13:54:11 +0200 Subject: [PATCH] add clipboard handler for all grids --- MultiTool.Form/frmExportMain.vb | 8 +------- MultiTool.Form/frmImportMain.vb | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/MultiTool.Form/frmExportMain.vb b/MultiTool.Form/frmExportMain.vb index b65bc80..fddb9d1 100644 --- a/MultiTool.Form/frmExportMain.vb +++ b/MultiTool.Form/frmExportMain.vb @@ -44,13 +44,7 @@ Public Class frmExportMain Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString) - Dim oViews As New List(Of GridView) From { - GridViewDocuments, - lookupMandator.Properties.View, - lookupAccount.Properties.View - } - GridBuilder = New GridBuilder(oViews) - GridBuilder. + GridBuilder = New GridBuilder(GridViewDocuments, lookupMandator.Properties.View, lookupAccount.Properties.View). WithDefaults(). WithReadOnlyOptions(). WithClipboardHandler() diff --git a/MultiTool.Form/frmImportMain.vb b/MultiTool.Form/frmImportMain.vb index c22a727..eafa994 100644 --- a/MultiTool.Form/frmImportMain.vb +++ b/MultiTool.Form/frmImportMain.vb @@ -64,8 +64,10 @@ Public Class frmImportMain Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString) - GridBuilder = New GridBuilder(GridViewFiles) - GridBuilder.WithDefaults.WithReadOnlyOptions.WithClipboardHandler() + GridBuilder = New GridBuilder(GridViewFiles, GridView1, GridView2, GridView3, GridView4). + WithDefaults(). + WithReadOnlyOptions(). + WithClipboardHandler() GridViewFiles.OptionsView.ShowAutoFilterRow = False Winline = My.Winline @@ -413,7 +415,8 @@ Public Class frmImportMain If oFailedDocuments.Count > 0 Then Dim oErrorMessages = String.Join(vbNewLine, oFailedDocuments) - Dim oMessage = String.Format("Für {0} Dateien ist die Übertragung in die Winline fehlgeschlagen. Folgende Fehler sind aufgetreten: {2}{1}", oFailedDocuments.Count, oErrorMessages, vbNewLine) + Dim oFailedCount = oFailedDocuments.Count + Dim oMessage = $"Für {oFailedCount} Dateien ist die Übertragung in die Winline fehlgeschlagen. Folgende Fehler sind aufgetreten: {oErrorMessages}{vbNewLine}" MsgBox(oMessage, MsgBoxStyle.Exclamation, Text) End If @@ -441,8 +444,6 @@ Public Class frmImportMain End If End Sub - - Private Async Function btnLoadFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Task Handles btnLoadFiles.ItemClick Await LoadFiles() End Function @@ -753,24 +754,31 @@ Public Class frmImportMain Return False End If + Logger.Info("Transferring file [{0}] to Winline", pDocument.FileName) Dim oResult = Await WebService.TransferDocumentToWinline(pDocument, CurrentTemplate, lookupMandator.EditValue, pIsTest) + Logger.Debug("Transfer successful: [{0}]", oResult) + If oResult = True Then ' If this was only a test, we are done. If pIsTest = True Then + Logger.Debug("This was a Test Transfer. Exiting.") Return True End If ' Generate the report WebService.RaiseWebServiceProgress("Bericht erzeugen") + Logger.Debug("Creating report for file [{0}]", pDocument.FileName) Dim oReportResult = ReportGenerator.GenerateReport(pDocument, CurrentTemplate) ' Export it to pdf WebService.RaiseWebServiceProgress("Bericht exportieren") + Logger.Debug("Exporting report to [{0}]", oReportResult.FileName) oReportResult.Report.ExportToPdf(oReportResult.FileName) ' Mark Document as Imported, will be moved on Form Close or File Reload + Logger.Debug("Setting file [{0}] to Imported", pDocument.FileName) pDocument.Imported = True Return True