add clipboard handler for all grids

This commit is contained in:
Jonathan Jenne 2022-05-13 13:54:11 +02:00
parent ddaacfe75c
commit cd1cdfe19a
2 changed files with 14 additions and 12 deletions

View File

@ -44,13 +44,7 @@ Public Class frmExportMain
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
Database = New MSSQLServer(LogConfig, oConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString)
Dim oViews As New List(Of GridView) From { GridBuilder = New GridBuilder(GridViewDocuments, lookupMandator.Properties.View, lookupAccount.Properties.View).
GridViewDocuments,
lookupMandator.Properties.View,
lookupAccount.Properties.View
}
GridBuilder = New GridBuilder(oViews)
GridBuilder.
WithDefaults(). WithDefaults().
WithReadOnlyOptions(). WithReadOnlyOptions().
WithClipboardHandler() WithClipboardHandler()

View File

@ -64,8 +64,10 @@ Public Class frmImportMain
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString) Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
Database = New MSSQLServer(LogConfig, oConnectionString) Database = New MSSQLServer(LogConfig, oConnectionString)
GridBuilder = New GridBuilder(GridViewFiles) GridBuilder = New GridBuilder(GridViewFiles, GridView1, GridView2, GridView3, GridView4).
GridBuilder.WithDefaults.WithReadOnlyOptions.WithClipboardHandler() WithDefaults().
WithReadOnlyOptions().
WithClipboardHandler()
GridViewFiles.OptionsView.ShowAutoFilterRow = False GridViewFiles.OptionsView.ShowAutoFilterRow = False
Winline = My.Winline Winline = My.Winline
@ -413,7 +415,8 @@ Public Class frmImportMain
If oFailedDocuments.Count > 0 Then If oFailedDocuments.Count > 0 Then
Dim oErrorMessages = String.Join(vbNewLine, oFailedDocuments) 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) MsgBox(oMessage, MsgBoxStyle.Exclamation, Text)
End If End If
@ -441,8 +444,6 @@ Public Class frmImportMain
End If End If
End Sub End Sub
Private Async Function btnLoadFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Task Handles btnLoadFiles.ItemClick Private Async Function btnLoadFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Task Handles btnLoadFiles.ItemClick
Await LoadFiles() Await LoadFiles()
End Function End Function
@ -753,24 +754,31 @@ Public Class frmImportMain
Return False Return False
End If End If
Logger.Info("Transferring file [{0}] to Winline", pDocument.FileName)
Dim oResult = Await WebService.TransferDocumentToWinline(pDocument, CurrentTemplate, lookupMandator.EditValue, pIsTest) Dim oResult = Await WebService.TransferDocumentToWinline(pDocument, CurrentTemplate, lookupMandator.EditValue, pIsTest)
Logger.Debug("Transfer successful: [{0}]", oResult)
If oResult = True Then If oResult = True Then
' If this was only a test, we are done. ' If this was only a test, we are done.
If pIsTest = True Then If pIsTest = True Then
Logger.Debug("This was a Test Transfer. Exiting.")
Return True Return True
End If End If
' Generate the report ' Generate the report
WebService.RaiseWebServiceProgress("Bericht erzeugen") WebService.RaiseWebServiceProgress("Bericht erzeugen")
Logger.Debug("Creating report for file [{0}]", pDocument.FileName)
Dim oReportResult = ReportGenerator.GenerateReport(pDocument, CurrentTemplate) Dim oReportResult = ReportGenerator.GenerateReport(pDocument, CurrentTemplate)
' Export it to pdf ' Export it to pdf
WebService.RaiseWebServiceProgress("Bericht exportieren") WebService.RaiseWebServiceProgress("Bericht exportieren")
Logger.Debug("Exporting report to [{0}]", oReportResult.FileName)
oReportResult.Report.ExportToPdf(oReportResult.FileName) oReportResult.Report.ExportToPdf(oReportResult.FileName)
' Mark Document as Imported, will be moved on Form Close or File Reload ' 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 pDocument.Imported = True
Return True Return True