From 5abc1d9779548e18480b7374a55ae7079b47d8b8 Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Tue, 19 Mar 2024 15:10:51 +0100 Subject: [PATCH 1/3] MS Common Verzeichnisstruktur --- EnvelopeGenerator.Common/Entities/DbConfig.vb | 1 + .../FinalizeDocument/FinalizeDocumentJob.vb | 77 ++++++++++++++----- .../Models/ConfigModel.vb | 1 + .../My Project/Settings.Designer.vb | 7 +- .../My Project/Settings.settings | 2 +- EnvelopeGenerator.Common/app.config | 9 +-- EnvelopeGenerator.Form/frmEnvelopeEditor.vb | 3 +- 7 files changed, 67 insertions(+), 33 deletions(-) diff --git a/EnvelopeGenerator.Common/Entities/DbConfig.vb b/EnvelopeGenerator.Common/Entities/DbConfig.vb index fc94f3d9..6089dfc8 100644 --- a/EnvelopeGenerator.Common/Entities/DbConfig.vb +++ b/EnvelopeGenerator.Common/Entities/DbConfig.vb @@ -1,5 +1,6 @@ Public Class DbConfig Public Property ExternalProgramName As String = "Sign Flow" + Public Property DocumentPathOrigin As String = "" Public Property DocumentPath As String = "" Public Property ExportPath As String = "" Public Property DocumentPath_DMZ As String = "" diff --git a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb index 0e6fe232..65f46cc9 100644 --- a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb +++ b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb @@ -12,6 +12,7 @@ Imports EnvelopeGenerator.Common.Constants Imports DevExpress.XtraBars.Docking Imports System.ServiceModel Imports DevExpress.XtraRichEdit.Export +Imports DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms Namespace Jobs Public Class FinalizeDocumentJob @@ -35,7 +36,7 @@ Namespace Jobs Private PDFMerger As PDFMerger Private ReportCreator As ReportCreator - Private ReadOnly CompleteWaitTimeInMinutes As Integer = 5 + Private ReadOnly CompleteWaitTime As Integer = 5 Private Class EnvelopeData Public EnvelopeId As Integer @@ -78,7 +79,8 @@ Namespace Jobs Logger.Debug("Loading ReportCreator..") ReportCreator = New ReportCreator(LogConfig, oState) - + Logger.Debug("My.Settings.RuninDMZ: [{0}]", My.Settings.RuninDMZ.ToString) + Logger.Debug("My.Settings.NetUse_Usr: [{0}]", My.Settings.NetUse_Usr) If My.Settings.RuninDMZ = True Then If Config.DocumentPath_DMZ <> String.Empty Then @@ -90,14 +92,16 @@ Namespace Jobs End If Else If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - Logger.Debug("Using DMZRemotePath: [{0}] - Overwrite Document-Path", Config.DOCUMENT_PATH_MOVE_AFTSEND) + Logger.Debug("Using DMZRemotePath: [{0}] - Overwrite Document-Path...", Config.DOCUMENT_PATH_MOVE_AFTSEND) Config.DocumentPath = Config.DOCUMENT_PATH_MOVE_AFTSEND - Config.NetUse_necessary = True + Config.NetUse_Finish = True + Else Config.DocumentPath = Config.DocumentPath End If End If Logger.Debug("DocumentPath: [{0}]", Config.DocumentPath) + If My.Settings.RuninDMZ = True Then If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then Logger.Debug("RuninDMZ - FINISHED_PATH_EX_DMZ configured: [{0}]", Config.FINISHED_PATH_EX_DMZ) @@ -109,20 +113,21 @@ Namespace Jobs Else Config.ExportPath = Config.ExportPath End If - - ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - Logger.Debug("DOCUMENT_PATH_MOVE_AFTSEND configured: [{0}] - Overwrite ExportPath", Config.DOCUMENT_PATH_MOVE_AFTSEND) - Config.ExportPath = Config.DOCUMENT_PATH_MOVE_AFTSEND - Config.NetUse_Finish = True Else Config.ExportPath = Config.ExportPath End If - Logger.Debug("ExportPath: [{0}]", Config.ExportPath) + If Config.NetUse_Finish = True Then + Logger.Debug("NetUse_Finish = true, Now executing NetUse....") + If NetUse_Command(Config.DocumentPath, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) = True Then + Logger.Debug("NetUse_Finish = successful!") + End If + End If + Dim oCompleteStatus As Integer = Constants.EnvelopeStatus.EnvelopeCompletelySigned - Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTimeInMinutes}" + Dim oSql = $"SELECT * FROM TBSIG_ENVELOPE WHERE STATUS = {oCompleteStatus} AND DATEDIFF(minute, CHANGED_WHEN, GETDATE()) >= {CompleteWaitTime}" Dim oTable = Database.GetDatatable(oSql) Dim oEnvelopeIds As List(Of Integer) = oTable.Rows.Cast(Of DataRow). @@ -149,6 +154,11 @@ Namespace Jobs Logger.Debug("Loading Envelope Data..") Dim oEnvelopeData = GetEnvelopeData(oId) + If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then + oEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) + Logger.Debug("Replaced Path in oEnvelopeData.DocumentPath!") + End If + If oEnvelopeData Is Nothing Then Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId) Throw New ArgumentNullException("EnvelopeData") @@ -187,7 +197,7 @@ Namespace Jobs Throw New ExportDocumentException("Could not export final document to disk!", ex) End Try - Logger.Info("Sending final Emails..") + Logger.Info("Sending finalized report-mails..") If Config.NetUse_Finish = True Then If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then @@ -196,7 +206,10 @@ Namespace Jobs If oReturnPath <> String.Empty Then oOutputFilePath = oReturnPath If Config.EML_PATH_EX_DMZ <> String.Empty Then + Logger.Debug($"Now replacing [{Config.FINISHED_PATH_EX_DMZ}] with ") + Logger.Debug($"............. [{Config.EML_PATH_EX_DMZ}] ") oOutputFilePath = oOutputFilePath.Replace(Config.FINISHED_PATH_EX_DMZ, Config.EML_PATH_EX_DMZ) + Logger.Debug($"oOutputFilePath [{oOutputFilePath}] ") End If End If End If @@ -238,7 +251,26 @@ Namespace Jobs Return Task.FromResult(True) End Function + Private Function NetUse_Command(pDestinationPath As String, pUsername As String, pPassword As String) + Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW) + Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" + + Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") + processInfo.RedirectStandardOutput = True + processInfo.UseShellExecute = False + processInfo.CreateNoWindow = True + + Using process As Process = Process.Start(processInfo) + process.WaitForExit() + ' Prüfe den Rückgabewert des net use Befehls + If process.ExitCode = 0 Then + Return True + Else + Return False + End If + End Using + End Function Private Function MoveFileWithNetUse(pSourcePath As String, pDestinationPath As String, pUsername As String, pPassword As String) As String Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW) Dim oFilename = System.IO.Path.GetFileName(pSourcePath) @@ -250,15 +282,15 @@ Namespace Jobs processInfo.UseShellExecute = False processInfo.CreateNoWindow = True - Using process As Process = Process.Start(processInfo) - process.WaitForExit() + Using oProcess As Process = Process.Start(processInfo) + oProcess.WaitForExit() ' Prüfe den Rückgabewert des net use Befehls - If process.ExitCode = 0 Then + If oProcess.ExitCode = 0 Then ' Verschiebe die Datei Try Dim oFilePath As String = pSourcePath - + Dim oDirectory As String = Path.GetDirectoryName(oFilePath) Dim split As String() = oFilePath.Split("\") Dim parentFolder As String = split(split.Length - 2) pDestinationPath &= "\" + parentFolder @@ -271,6 +303,7 @@ Namespace Jobs End If Logger.Info($"MoveFileWithNetUse To {pDestinationPath} ...") System.IO.File.Move(pSourcePath, pDestinationPath) + Directory.Delete(oDirectory) Return pDestinationPath Catch ex As Exception Logger.Error(ex) @@ -352,8 +385,16 @@ Namespace Jobs Logger.Info("Burning [{0}] signatures", pData.AnnotationData.Count) Dim oAnnotations = pData.AnnotationData - Dim oInputPath = pData.DocumentPath - + Dim oInputPath = "" + + If My.Settings.RuninDMZ Then + oInputPath = pData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath) + Logger.Debug("Replaced Path in pData.DocumentPath!") + ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then + oInputPath = pData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) + Logger.Debug("Replaced Path in pData.DocumentPath!") + End If + Logger.Info("Input path: [{0}]", oInputPath) Dim oInputDocumentBuffer As Byte() Try diff --git a/EnvelopeGenerator.Common/Models/ConfigModel.vb b/EnvelopeGenerator.Common/Models/ConfigModel.vb index 4769fc38..01e89f8b 100644 --- a/EnvelopeGenerator.Common/Models/ConfigModel.vb +++ b/EnvelopeGenerator.Common/Models/ConfigModel.vb @@ -17,6 +17,7 @@ Public Class ConfigModel Return New DbConfig() With { .DocumentPath = oRow.ItemEx("DOCUMENT_PATH", ""), + .DocumentPathOrigin = oRow.ItemEx("DOCUMENT_PATH", ""), .DocumentPath_DMZ = oRow.ItemEx("DOCUMENT_PATH_DMZ", ""), .ExportPath = oRow.ItemEx("EXPORT_PATH", ""), .ExportPath_DMZ = oRow.ItemEx("EXPORT_PATH_DMZ", ""), diff --git a/EnvelopeGenerator.Common/My Project/Settings.Designer.vb b/EnvelopeGenerator.Common/My Project/Settings.Designer.vb index 576fa5a0..aad32a06 100644 --- a/EnvelopeGenerator.Common/My Project/Settings.Designer.vb +++ b/EnvelopeGenerator.Common/My Project/Settings.Designer.vb @@ -72,16 +72,13 @@ Namespace My End Get End Property - _ - Public Property NetUse_PW() As String + Public ReadOnly Property NetUse_PW() As String Get Return CType(Me("NetUse_PW"),String) End Get - Set - Me("NetUse_PW") = value - End Set End Property End Class End Namespace diff --git a/EnvelopeGenerator.Common/My Project/Settings.settings b/EnvelopeGenerator.Common/My Project/Settings.settings index daa425de..f06f716e 100644 --- a/EnvelopeGenerator.Common/My Project/Settings.settings +++ b/EnvelopeGenerator.Common/My Project/Settings.settings @@ -8,7 +8,7 @@ dd-gan\Administrator - + sY4vnATDXwosbTJGip6SqA== diff --git a/EnvelopeGenerator.Common/app.config b/EnvelopeGenerator.Common/app.config index 19b61a68..63222b2e 100644 --- a/EnvelopeGenerator.Common/app.config +++ b/EnvelopeGenerator.Common/app.config @@ -5,9 +5,6 @@
- -
- @@ -40,13 +37,9 @@ dd-gan\Administrator - - - - sY4vnATDXwosbTJGip6SqA== - + diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index 679d27e0..bf3b9bea 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -364,7 +364,7 @@ Partial Public Class frmEnvelopeEditor ' Verschiebe die Datei Try Dim oFilePath As String = pSourcePath - + Dim oDirectory As String = Path.GetDirectoryName(oFilePath) Dim split As String() = oFilePath.Split("\") Dim parentFolder As String = split(split.Length - 2) pDestinationPath &= "\" + parentFolder @@ -376,6 +376,7 @@ Partial Public Class frmEnvelopeEditor File.Delete(pDestinationPath) End If System.IO.File.Move(pSourcePath, pDestinationPath) + System.IO.Directory.Delete(oDirectory) Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in MoveFileWithNetUse") End Try From c14ed861819677ec6ec41f92ccd380125fc28a90 Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Thu, 28 Mar 2024 11:26:32 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Ms=20=C3=84nderungen=20FileCopy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinalizeDocument/FinalizeDocumentJob.vb | 111 +++++++-------- .../Controllers/BaseController.vb | 3 + EnvelopeGenerator.Form/Helper/TempFiles.vb | 4 +- EnvelopeGenerator.Form/ModuleSettings.vb | 6 +- EnvelopeGenerator.Form/frmEnvelopeEditor.vb | 126 ++++++++++++----- EnvelopeGenerator.Form/frmMain.Designer.vb | 26 +++- EnvelopeGenerator.Form/frmMain.resx | 128 +++++++++++++++++- EnvelopeGenerator.Form/frmMain.vb | 21 +++ EnvelopeGenerator.Form/frmSplashScreen.vb | 12 +- EnvelopeGenerator.Service/Service.vb | 2 +- 10 files changed, 331 insertions(+), 108 deletions(-) diff --git a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb index 65f46cc9..a3bba2b3 100644 --- a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb +++ b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb @@ -13,6 +13,9 @@ Imports DevExpress.XtraBars.Docking Imports System.ServiceModel Imports DevExpress.XtraRichEdit.Export Imports DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms +Imports DevExpress.DataAccess.Sql +Imports DevExpress.DataProcessing +Imports Quartz.Logging.OperationName Namespace Jobs Public Class FinalizeDocumentJob @@ -37,6 +40,7 @@ Namespace Jobs Private ReportCreator As ReportCreator Private ReadOnly CompleteWaitTime As Integer = 5 + Private ParentFolderUID As String = "" Private Class EnvelopeData Public EnvelopeId As Integer @@ -92,7 +96,7 @@ Namespace Jobs End If Else If Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - Logger.Debug("Using DMZRemotePath: [{0}] - Overwrite Document-Path...", Config.DOCUMENT_PATH_MOVE_AFTSEND) + Logger.Debug("Using DMZRemotePath: [{0}] - Overwrite Document-Path ...", Config.DOCUMENT_PATH_MOVE_AFTSEND) Config.DocumentPath = Config.DOCUMENT_PATH_MOVE_AFTSEND Config.NetUse_Finish = True @@ -120,7 +124,6 @@ Namespace Jobs Logger.Debug("ExportPath: [{0}]", Config.ExportPath) If Config.NetUse_Finish = True Then - Logger.Debug("NetUse_Finish = true, Now executing NetUse....") If NetUse_Command(Config.DocumentPath, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) = True Then Logger.Debug("NetUse_Finish = successful!") End If @@ -164,7 +167,7 @@ Namespace Jobs Throw New ArgumentNullException("EnvelopeData") End If - Logger.Debug("Burning Annotations to pdf") + Logger.Debug("Burning Annotations to pdf ...") Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData) If oBurnedDocument Is Nothing Then Logger.Warn("Document could not be finalized!") @@ -178,14 +181,16 @@ Namespace Jobs Logger.Debug("Creating report..") Dim oReport As Byte() = ReportCreator.CreateReport(oEnvelope) - Logger.Debug("Report created.") + Logger.Debug("Report created!") - Logger.Debug("Merging documents..") + Logger.Debug("Merging documents ...") Dim oMergedDocument As Byte() = PDFMerger.MergeDocuments(oBurnedDocument, oReport) - Logger.Debug("Documents merged.") - - Dim oOutputDirectoryPath = Config.ExportPath + Logger.Debug("Documents merged!") + Dim oOutputDirectoryPath = Path.Combine(Config.ExportPath, ParentFolderUID) + If Not Directory.Exists(oOutputDirectoryPath) Then + Directory.CreateDirectory(oOutputDirectoryPath) + End If Dim oOutputFilePath = Path.Combine(oOutputDirectoryPath, $"{oEnvelope.Uuid}.pdf") Logger.Info("Writing finalized Pdf to disk..") Logger.Info("Output path is [{0}]", oOutputFilePath) @@ -197,26 +202,30 @@ Namespace Jobs Throw New ExportDocumentException("Could not export final document to disk!", ex) End Try - Logger.Info("Sending finalized report-mails..") + If Config.NetUse_Finish = True Then If Config.FINISHED_PATH_EX_DMZ <> String.Empty Then If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then - Dim oReturnPath = MoveFileWithNetUse(oOutputFilePath, Config.FINISHED_PATH_EX_DMZ, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) - If oReturnPath <> String.Empty Then - oOutputFilePath = oReturnPath - If Config.EML_PATH_EX_DMZ <> String.Empty Then - Logger.Debug($"Now replacing [{Config.FINISHED_PATH_EX_DMZ}] with ") - Logger.Debug($"............. [{Config.EML_PATH_EX_DMZ}] ") - oOutputFilePath = oOutputFilePath.Replace(Config.FINISHED_PATH_EX_DMZ, Config.EML_PATH_EX_DMZ) - Logger.Debug($"oOutputFilePath [{oOutputFilePath}] ") - End If - End If + Clean_DNZ_PAth(Config.FINISHED_PATH_EX_DMZ) + 'Dim oReturnPath = MoveFileWithNetUse(Config.FINISHED_PATH_EX_DMZ, oOutputFilePath, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) + 'If oReturnPath <> String.Empty Then + ' oOutputFilePath = oReturnPath + ' If Config.EML_PATH_EX_DMZ <> String.Empty Then + ' Logger.Debug($"Now replacing [{Config.FINISHED_PATH_EX_DMZ}] with ") + ' Logger.Debug($"............. [{Config.EML_PATH_EX_DMZ}] ") + ' oOutputFilePath = oOutputFilePath.Replace(Config.FINISHED_PATH_EX_DMZ, Config.EML_PATH_EX_DMZ) + ' Logger.Debug($"oOutputFilePath [{oOutputFilePath}] ") + ' End If + 'Else + ' Logger.Info($"Exiting/Aborting FinalizeDocuments!") + ' Return Task.FromResult(False) + 'End If End If End If End If - + Logger.Info("Sending finalized report-mails..") If SendFinalEmails(oEnvelope, oOutputFilePath) = False Then Throw New ApplicationException("Final emails could not be sent!") @@ -254,7 +263,7 @@ Namespace Jobs Private Function NetUse_Command(pDestinationPath As String, pUsername As String, pPassword As String) Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW) Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" - + Logger.Debug("EXECUTING NetUse_Command for " & pDestinationPath) Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") processInfo.RedirectStandardOutput = True processInfo.UseShellExecute = False @@ -271,57 +280,34 @@ Namespace Jobs End If End Using End Function - Private Function MoveFileWithNetUse(pSourcePath As String, pDestinationPath As String, pUsername As String, pPassword As String) As String - Dim oDectryptedPW = Helpers.Decrypt(My.Settings.NetUse_PW) + + Private Function Clean_DNZ_PAth(pSourcePath As String) As Boolean Dim oFilename = System.IO.Path.GetFileName(pSourcePath) - Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" + Logger.Debug("## Starting Clean_DNZ_PAth ...") + Logger.Debug("## pSourcePath {0}", pSourcePath) - Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") - processInfo.RedirectStandardOutput = True - processInfo.UseShellExecute = False - processInfo.CreateNoWindow = True + Dim oDirectorySource = Path.Combine(pSourcePath, ParentFolderUID) - Using oProcess As Process = Process.Start(processInfo) - oProcess.WaitForExit() + Try + Logger.Debug($"Deleting oDirectorySource {oDirectorySource} ...") + Directory.Delete(oDirectorySource, True) + Console.WriteLine($"Folder successfully deleted!") + Logger.Debug($"...Deleted!") + Return True + Catch ex As Exception + Logger.Error(ex) + Return False + End Try - ' Prüfe den Rückgabewert des net use Befehls - If oProcess.ExitCode = 0 Then - ' Verschiebe die Datei - Try - Dim oFilePath As String = pSourcePath - Dim oDirectory As String = Path.GetDirectoryName(oFilePath) - Dim split As String() = oFilePath.Split("\") - Dim parentFolder As String = split(split.Length - 2) - pDestinationPath &= "\" + parentFolder - If Not System.IO.Directory.Exists(pDestinationPath) Then - System.IO.Directory.CreateDirectory(pDestinationPath) - End If - pDestinationPath &= "\" + oFilename - If File.Exists(pDestinationPath) Then - File.Delete(pDestinationPath) - End If - Logger.Info($"MoveFileWithNetUse To {pDestinationPath} ...") - System.IO.File.Move(pSourcePath, pDestinationPath) - Directory.Delete(oDirectory) - Return pDestinationPath - Catch ex As Exception - Logger.Error(ex) - Return "" - End Try - Else - Logger.Warn("Error while connecting to network-path " & pDestinationPath) - Return "" - End If - End Using End Function Private Function SendFinalEmails(pEnvelope As Envelope, pAttachment As String) As Boolean Dim oMailToCreator = pEnvelope.FinalEmailToCreator Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers If oMailToCreator <> FinalEmailType.No Then - Logger.Debug("Sending email to creator..") + Logger.Debug("Sending email to creator ...") SendFinalEmailToCreator(pEnvelope, pAttachment) End If @@ -396,6 +382,11 @@ Namespace Jobs End If Logger.Info("Input path: [{0}]", oInputPath) + Dim oDirectorySource As String = Path.GetDirectoryName(oInputPath) + Dim split As String() = oDirectorySource.Split("\") + ParentFolderUID = split(split.Length - 1) + + Logger.Info("ParentFolderUID: [{0}]", ParentFolderUID) Dim oInputDocumentBuffer As Byte() Try oInputDocumentBuffer = File.ReadAllBytes(oInputPath) diff --git a/EnvelopeGenerator.Form/Controllers/BaseController.vb b/EnvelopeGenerator.Form/Controllers/BaseController.vb index a4c4abea..c0d5675c 100644 --- a/EnvelopeGenerator.Form/Controllers/BaseController.vb +++ b/EnvelopeGenerator.Form/Controllers/BaseController.vb @@ -4,6 +4,7 @@ Imports EnvelopeGenerator.Common Imports System.Data.SqlClient Imports DevExpress.DocumentView Imports System.Transactions +Imports System.IO Public MustInherit Class BaseController Inherits BaseClass @@ -143,6 +144,8 @@ Public MustInherit Class BaseController If IO.File.Exists(pDocument.Filepath) Then IO.File.Delete(pDocument.Filepath) End If + Dim oFolder As String = Path.GetDirectoryName(pDocument.Filepath) + Directory.Delete(oFolder) Return True Catch ex As Exception diff --git a/EnvelopeGenerator.Form/Helper/TempFiles.vb b/EnvelopeGenerator.Form/Helper/TempFiles.vb index 0fec7af1..3ae0eff7 100644 --- a/EnvelopeGenerator.Form/Helper/TempFiles.vb +++ b/EnvelopeGenerator.Form/Helper/TempFiles.vb @@ -33,6 +33,7 @@ Public Class TempFiles Private Function CleanUpFiles() As Boolean Try For Each fileItem As String In Directory.GetFiles(TempPath) + Logger.Debug("Deleting tempPath-file: {0} ...", fileItem) File.Delete(fileItem) Next @@ -46,7 +47,8 @@ Public Class TempFiles Public Function CleanUp() As Boolean Try - Directory.Delete(TempPath) + Logger.Debug("Deleting tempPath-Data: {0} ...", TempPath) + Directory.Delete(TempPath, True) Return True Catch ex As Exception diff --git a/EnvelopeGenerator.Form/ModuleSettings.vb b/EnvelopeGenerator.Form/ModuleSettings.vb index 900e66eb..7159fd81 100644 --- a/EnvelopeGenerator.Form/ModuleSettings.vb +++ b/EnvelopeGenerator.Form/ModuleSettings.vb @@ -1,3 +1,7 @@ -Module ModuleSettings +Imports DigitalData.Modules.Logging + +Module ModuleSettings Public DOCUMENT_PATH_MOVE_AFTSEND As String = "" + Public CurrLogConfig As LogConfig + Public Directory2Delete As String = "" End Module diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index bf3b9bea..2b83f201 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -334,7 +334,19 @@ Partial Public Class frmEnvelopeEditor If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then Dim oDecrypted = Decryption.Decrypt(My.Settings.NetUse_PW) For Each odoc In Controller.Envelope.Documents 'envelope ist leer! - MoveFileWithNetUse(odoc.Filepath, DOCUMENT_PATH_MOVE_AFTSEND, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) + Directory2Delete = "" + CopyFileWithNetUse(odoc.Filepath, DOCUMENT_PATH_MOVE_AFTSEND, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) + If Directory2Delete <> String.Empty Then + Logger.Debug("Now Deleting SourcePath: {0} ...", Directory2Delete) + Try + System.IO.Directory.Delete(Directory2Delete, True) + Logger.Debug("Successfully deleted Sourcepath!") + Catch ex As Exception + Logger.Warn("Unexpected Error while deleting SourcePath {0}", Directory2Delete) + Logger.Warn("ErrorMessage: {0}", ex.Message) + End Try + + End If Next End If @@ -345,47 +357,86 @@ Partial Public Class frmEnvelopeEditor End Sub - Sub MoveFileWithNetUse(pSourcePath As String, pDestinationPath As String, pUsername As String, pPassword As String) - Dim oDectryptedPW = Decryption.Decrypt(pPassword) - Dim oFilename = System.IO.Path.GetFileName(pSourcePath) + Function CopyFileWithNetUse(pSourcePath As String, pDestinationPath As String, pUsername As String, pPassword As String) As Boolean + Logger.Debug("EXECUTING CopyFileWithNetUse for " & pDestinationPath) + Dim oDirectoryExists As Boolean = False + Try + If Directory.Exists(pDestinationPath) Then + oDirectoryExists = True + End If + Catch ex As Exception + Logger.Warn("CopyFileWithNetUse - path not accessible or existing: {0}", ex.Message) + End Try + Logger.Debug("CopyFileWithNetUse - Folder accessible [{0}]", oDirectoryExists.ToString) + + If oDirectoryExists = False Then + Dim oDectryptedPW = Decryption.Decrypt(pPassword) + Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" + Logger.Debug("netUseCommand " & netUseCommand) + Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") + processInfo.RedirectStandardOutput = True + processInfo.RedirectStandardInput = True + processInfo.UseShellExecute = False + processInfo.CreateNoWindow = True + Using oProcess As Process = Process.Start(processInfo) + oProcess.WaitForExit() + ' Prüfe den Rückgabewert des net use Befehls + If oProcess.ExitCode = 0 Then + ' Verschiebe die Datei + Try + Dim oReturn = COPY_TO_DMZ(pSourcePath, pDestinationPath) + oProcess.Close() + Return oReturn + Catch ex As Exception + oProcess.Close() + Logger.Warn("Unexpected error in CopyFileWithNetUse " & pDestinationPath) + MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") + + Return False + End Try - Dim netUseCommand As String = $"net use {pDestinationPath} /user:{pUsername} {oDectryptedPW}" + Else + Logger.Warn("Error while connecting to network-path: " & pDestinationPath) + MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") + Return False + End If + End Using + Else + Return COPY_TO_DMZ(pSourcePath, pDestinationPath) + End If - Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") - processInfo.RedirectStandardOutput = True - processInfo.UseShellExecute = False - processInfo.CreateNoWindow = True - Using process As Process = Process.Start(processInfo) - process.WaitForExit() - ' Prüfe den Rückgabewert des net use Befehls - If process.ExitCode = 0 Then - ' Verschiebe die Datei - Try - Dim oFilePath As String = pSourcePath - Dim oDirectory As String = Path.GetDirectoryName(oFilePath) - Dim split As String() = oFilePath.Split("\") - Dim parentFolder As String = split(split.Length - 2) - pDestinationPath &= "\" + parentFolder - If Not System.IO.Directory.Exists(pDestinationPath) Then - System.IO.Directory.CreateDirectory(pDestinationPath) - End If - pDestinationPath &= "\" + oFilename - If File.Exists(pDestinationPath) Then - File.Delete(pDestinationPath) - End If - System.IO.File.Move(pSourcePath, pDestinationPath) - System.IO.Directory.Delete(oDirectory) - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in MoveFileWithNetUse") - End Try - Else - MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in MoveFileWithNetUse") + End Function + Private Function COPY_TO_DMZ(pSourcePath As String, pDestinationPath As String) As Boolean + Try + Dim oFilename = System.IO.Path.GetFileName(pSourcePath) + Dim oFilePath As String = pSourcePath + Dim oSourceDirectory As String = Path.GetDirectoryName(oFilePath) + Dim split As String() = oFilePath.Split("\") + Dim parentFolder As String = split(split.Length - 2) + pDestinationPath &= "\" + parentFolder + If Not System.IO.Directory.Exists(pDestinationPath) Then + System.IO.Directory.CreateDirectory(pDestinationPath) End If - End Using - End Sub + pDestinationPath &= "\" + oFilename + If File.Exists(pDestinationPath) Then + File.Delete(pDestinationPath) + End If + Logger.Debug("Now copying file ...") + Logger.Debug("from [{0}] ", pSourcePath) + Logger.Debug("to [{0}]... ", pDestinationPath) + System.IO.File.Copy(pSourcePath, pDestinationPath) + Logger.Debug("Successfully Copied!") + Directory2Delete = oSourceDirectory + Return True + Catch ex As Exception + Logger.Warn("COPY_TO_DMZ - Unexpected error {0}", ex.Message) + Return False + End Try + + End Function Private Sub btnCancel_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnCancel.ItemClick ' Speichern? Dim oMessage = Resources.Envelope.Should_The_Envelope_Be_Saved @@ -524,4 +575,7 @@ Partial Public Class frmEnvelopeEditor End If End Sub + Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click + + End Sub End Class diff --git a/EnvelopeGenerator.Form/frmMain.Designer.vb b/EnvelopeGenerator.Form/frmMain.Designer.vb index caf7c706..036dc241 100644 --- a/EnvelopeGenerator.Form/frmMain.Designer.vb +++ b/EnvelopeGenerator.Form/frmMain.Designer.vb @@ -57,6 +57,7 @@ Partial Class frmMain Me.btnContactReceiver = New DevExpress.XtraBars.BarButtonItem() Me.txtEnvelopeIdLabel = New DevExpress.XtraBars.BarStaticItem() Me.btnOpenLogDirectory = New DevExpress.XtraBars.BarButtonItem() + Me.BarCheckItem1 = New DevExpress.XtraBars.BarCheckItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageEnvelopeActions = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -81,6 +82,7 @@ Partial Class frmMain Me.GridColumn5 = New DevExpress.XtraGrid.Columns.GridColumn() Me.GridColumn7 = New DevExpress.XtraGrid.Columns.GridColumn() Me.RefreshTimer = New System.Windows.Forms.Timer(Me.components) + Me.bsitmInfo = New DevExpress.XtraBars.BarStaticItem() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1.Panel1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SplitContainerControl1.Panel1.SuspendLayout() @@ -286,9 +288,9 @@ Partial Class frmMain Me.RibbonControl.ExpandCollapseItem.Id = 0 Me.RibbonControl.ExpandCollapseItem.ImageOptions.ImageIndex = CType(resources.GetObject("RibbonControl.ExpandCollapseItem.ImageOptions.ImageIndex"), Integer) Me.RibbonControl.ExpandCollapseItem.ImageOptions.LargeImageIndex = CType(resources.GetObject("RibbonControl.ExpandCollapseItem.ImageOptions.LargeImageIndex"), Integer) - Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.btnCreateEnvelope, Me.btnEditEnvelope, Me.btnDeleteEnvelope, Me.BarButtonItem1, Me.txtRefreshLabel, Me.btnShowDocument, Me.btnContactReceiver, Me.txtEnvelopeIdLabel, Me.btnOpenLogDirectory}) + Me.RibbonControl.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl.ExpandCollapseItem, Me.RibbonControl.SearchEditItem, Me.btnCreateEnvelope, Me.btnEditEnvelope, Me.btnDeleteEnvelope, Me.BarButtonItem1, Me.txtRefreshLabel, Me.btnShowDocument, Me.btnContactReceiver, Me.txtEnvelopeIdLabel, Me.btnOpenLogDirectory, Me.BarCheckItem1, Me.bsitmInfo}) resources.ApplyResources(Me.RibbonControl, "RibbonControl") - Me.RibbonControl.MaxItemId = 12 + Me.RibbonControl.MaxItemId = 14 Me.RibbonControl.Name = "RibbonControl" Me.RibbonControl.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1, Me.RibbonPage2}) Me.RibbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] @@ -380,6 +382,14 @@ Partial Class frmMain Me.btnOpenLogDirectory.ImageOptions.SvgImage = CType(resources.GetObject("btnOpenLogDirectory.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage) Me.btnOpenLogDirectory.Name = "btnOpenLogDirectory" ' + 'BarCheckItem1 + ' + resources.ApplyResources(Me.BarCheckItem1, "BarCheckItem1") + Me.BarCheckItem1.Id = 12 + Me.BarCheckItem1.ImageOptions.Image = CType(resources.GetObject("BarCheckItem1.ImageOptions.Image"), System.Drawing.Image) + Me.BarCheckItem1.ImageOptions.LargeImage = CType(resources.GetObject("BarCheckItem1.ImageOptions.LargeImage"), System.Drawing.Image) + Me.BarCheckItem1.Name = "BarCheckItem1" + ' 'RibbonPage1 ' Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageEnvelopeActions, Me.RibbonPageGroup1, Me.RibbonPageGroup2}) @@ -417,6 +427,7 @@ Partial Class frmMain 'RibbonPageGroup3 ' Me.RibbonPageGroup3.ItemLinks.Add(Me.btnOpenLogDirectory) + Me.RibbonPageGroup3.ItemLinks.Add(Me.BarCheckItem1) Me.RibbonPageGroup3.Name = "RibbonPageGroup3" resources.ApplyResources(Me.RibbonPageGroup3, "RibbonPageGroup3") ' @@ -424,6 +435,7 @@ Partial Class frmMain ' Me.RibbonStatusBar.ItemLinks.Add(Me.txtRefreshLabel) Me.RibbonStatusBar.ItemLinks.Add(Me.txtEnvelopeIdLabel) + Me.RibbonStatusBar.ItemLinks.Add(Me.bsitmInfo) resources.ApplyResources(Me.RibbonStatusBar, "RibbonStatusBar") Me.RibbonStatusBar.Name = "RibbonStatusBar" Me.RibbonStatusBar.Ribbon = Me.RibbonControl @@ -561,6 +573,14 @@ Partial Class frmMain ' Me.RefreshTimer.Interval = 120000 ' + 'bsitmInfo + ' + Me.bsitmInfo.Id = 13 + Me.bsitmInfo.ImageOptions.Image = CType(resources.GetObject("BarStaticItem1.ImageOptions.Image"), System.Drawing.Image) + Me.bsitmInfo.Name = "bsitmInfo" + Me.bsitmInfo.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph + Me.bsitmInfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never + ' 'frmMain ' resources.ApplyResources(Me, "$this") @@ -650,4 +670,6 @@ Partial Class frmMain Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage Friend WithEvents RibbonPageGroup3 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents colAccessCode As DevExpress.XtraGrid.Columns.GridColumn + Friend WithEvents BarCheckItem1 As DevExpress.XtraBars.BarCheckItem + Friend WithEvents bsitmInfo As DevExpress.XtraBars.BarStaticItem End Class diff --git a/EnvelopeGenerator.Form/frmMain.resx b/EnvelopeGenerator.Form/frmMain.resx index d832fccc..4e9b99c0 100644 --- a/EnvelopeGenerator.Form/frmMain.resx +++ b/EnvelopeGenerator.Form/frmMain.resx @@ -565,6 +565,120 @@ MC40Q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Q/wsfhQfp+pup5l + 2FoBnQr+0q1pHoZnRB12mWQK59sNMoiMQGQCNPaNfga+oawoGmXA/UodqpoGUdc2jLTcZugYXFr7SkGX + v5L56IkvIrWjXtRs2JET/i9+E4qC3K5seERTP+BBYnotORpBXeswbtQN4GJsI/RcS3DYNh9fn6D066aJ + vp5LCXxiGlBa04+almHUtgwhLL4Ch364sPjlzmPa5JMvHlF4zPWtlgd1N+zQsYsvCtgU8dHfP9//hdpR + j3Zb50Sk57eQ4yHhmFHTTNhobzUPEriV9VNzmmFmF4V9h106/vqPXf8mX3zvb1a9ELBfw526G3ZAx1sI + eEUEb8f7hE93qpiaqmp5jupbhMIrMAfJWY3IKGhDNaWZkU79pMwGnA/IxnGTYOw/cm50m6KBBT37ewJX + vEg7Y5Nnz2FX+rthatpeWwJeEcHFwhX7EeF3n2/TUlVStQndS5ERer/V8sS3mh7Yo+7ct0fdqUNhn1XY + P79U/47W/oHA+/0OgQN5iZyhcsiZhjZsv4annKqmx09A9qoQrmBOJx8lju6PG+A+j/E+8xpeu0W855CL + nMBBZ0GsctBJTvmAE03977YphI8qO+aUMsmL4DGe4zUMXv8LJif3X9GYf76Y1zM7AAAAAElFTkSuQmCC @@ -583,7 +697,7 @@ Start - Verzeichnisse + Konfiguration Einstellungen @@ -1157,6 +1271,12 @@ DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + BarCheckItem1 + + + DevExpress.XtraBars.BarCheckItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + RibbonPage1 @@ -1283,6 +1403,12 @@ System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + bsitmInfo + + + DevExpress.XtraBars.BarStaticItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + frmMain diff --git a/EnvelopeGenerator.Form/frmMain.vb b/EnvelopeGenerator.Form/frmMain.vb index 38b3f03e..d23053e5 100644 --- a/EnvelopeGenerator.Form/frmMain.vb +++ b/EnvelopeGenerator.Form/frmMain.vb @@ -331,4 +331,25 @@ Public Class frmMain Logger.Error(ex) End Try End Sub + + Private Sub BarCheckItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarCheckItem1.CheckedChanged + If BarCheckItem1.Checked = True Then + If CurrLogConfig.Debug = False Then + CurrLogConfig.Debug = True + bsitmInfo.Caption = "DEBUG-Log is active" + bsitmInfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Always + End If + Else + CurrLogConfig.Debug = False + bsitmInfo.Visibility = DevExpress.XtraBars.BarItemVisibility.Never + End If + End Sub + + Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown + If CurrLogConfig.Debug Then + BarCheckItem1.Checked = True + Else + BarCheckItem1.Checked = False + End If + End Sub End Class \ No newline at end of file diff --git a/EnvelopeGenerator.Form/frmSplashScreen.vb b/EnvelopeGenerator.Form/frmSplashScreen.vb index e125eb78..afdf7cdf 100644 --- a/EnvelopeGenerator.Form/frmSplashScreen.vb +++ b/EnvelopeGenerator.Form/frmSplashScreen.vb @@ -9,7 +9,7 @@ Imports EnvelopeGenerator.Common Imports System.ComponentModel Public Class frmSplashScreen - Private LogConfig As LogConfig + Private Logger As Logger Private ConfigManager As ConfigManager(Of Config) @@ -23,14 +23,14 @@ Public Class frmSplashScreen Private Sub frmSplashScreen_Shown(sender As Object, e As EventArgs) Handles Me.Shown Dim oLogPath = IO.Path.Combine(Application.LocalUserAppDataPath, "Log") - LogConfig = New LogConfig(LogConfig.PathType.CustomPath, oLogPath, CompanyName:="Digital Data", ProductName:="Envelope Generator") - Logger = LogConfig.GetLogger() + CurrLogConfig = New LogConfig(LogConfig.PathType.CustomPath, oLogPath, CompanyName:="Digital Data", ProductName:="Envelope Generator") + Logger = CurrLogConfig.GetLogger() Try - ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath, Application.CommonAppDataPath, Application.StartupPath) + ConfigManager = New ConfigManager(Of Config)(CurrLogConfig, Application.UserAppDataPath, Application.CommonAppDataPath, Application.StartupPath) If ConfigManager.Config.ConnectionString = String.Empty Then - Dim oSQLConfig As New frmSQLConfig(LogConfig) + Dim oSQLConfig As New frmSQLConfig(CurrLogConfig) If oSQLConfig.ShowDialog() = DialogResult.OK Then ConfigManager.Config.ConnectionString = oSQLConfig.ConnectionString ConfigManager.Save() @@ -46,7 +46,7 @@ Public Class frmSplashScreen Worker.RunWorkerAsync(New State() With { .User = Nothing, .UserId = 0, - .LogConfig = LogConfig, + .LogConfig = CurrLogConfig, .Config = ConfigManager.Config, .Database = Nothing, .DbConfig = New DbConfig() diff --git a/EnvelopeGenerator.Service/Service.vb b/EnvelopeGenerator.Service/Service.vb index de56865f..6884c2cc 100644 --- a/EnvelopeGenerator.Service/Service.vb +++ b/EnvelopeGenerator.Service/Service.vb @@ -21,7 +21,7 @@ Public Class Service Try ' === Initialize Logger === Dim oLogPath = Path.Combine(My.Application.Info.DirectoryPath, "Log") - LogConfig = New LogConfig(LogConfig.PathType.CustomPath, oLogPath, Nothing, "Digital Data", "EmailGenerator.Service") + LogConfig = New LogConfig(LogConfig.PathType.CustomPath, oLogPath, Nothing, "Digital Data", "EnvelopeGenerator.Service") ' === Initialize Config === ConfigManager = New ConfigManager(Of Config)(LogConfig, My.Application.Info.DirectoryPath) From 83746abb1b6d58f8b33c0c498fe3f103cb049e52 Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Sun, 31 Mar 2024 19:26:16 +0200 Subject: [PATCH 3/3] MS --- .../frmEnvelopeEditor.Designer.vb | 12 ++++- EnvelopeGenerator.Form/frmEnvelopeEditor.resx | 6 +++ EnvelopeGenerator.Form/frmEnvelopeEditor.vb | 46 ++++++++++--------- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.Designer.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.Designer.vb index f56bdaa5..7adf8935 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.Designer.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.Designer.vb @@ -56,6 +56,7 @@ Partial Public Class frmEnvelopeEditor Me.txtCreatorEmailLabel = New DevExpress.XtraBars.BarStaticItem() Me.txtEnvelopeIdLabel2 = New DevExpress.XtraBars.BarStaticItem() Me.BarButtonItem1 = New DevExpress.XtraBars.BarButtonItem() + Me.BarStaticItem1 = New DevExpress.XtraBars.BarStaticItem() Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() Me.RibbonPageGroupDocuments = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() @@ -238,9 +239,9 @@ Partial Public Class frmEnvelopeEditor 'RibbonControl1 ' Me.RibbonControl1.ExpandCollapseItem.Id = 0 - Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnSave, Me.btnCancel, Me.btnNewFile, Me.btnDeleteFile, Me.btnSendEnvelope, Me.btnEditFields, Me.btnDeleteReceiver, Me.btnEditData, Me.txtCreatorEmailLabel, Me.txtEnvelopeIdLabel2, Me.BarButtonItem1}) + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.btnSave, Me.btnCancel, Me.btnNewFile, Me.btnDeleteFile, Me.btnSendEnvelope, Me.btnEditFields, Me.btnDeleteReceiver, Me.btnEditData, Me.txtCreatorEmailLabel, Me.txtEnvelopeIdLabel2, Me.BarButtonItem1, Me.BarStaticItem1}) resources.ApplyResources(Me.RibbonControl1, "RibbonControl1") - Me.RibbonControl1.MaxItemId = 13 + Me.RibbonControl1.MaxItemId = 14 Me.RibbonControl1.Name = "RibbonControl1" Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] @@ -329,6 +330,11 @@ Partial Public Class frmEnvelopeEditor Me.BarButtonItem1.Id = 12 Me.BarButtonItem1.Name = "BarButtonItem1" ' + 'BarStaticItem1 + ' + Me.BarStaticItem1.Id = 13 + Me.BarStaticItem1.Name = "BarStaticItem1" + ' 'RibbonPage1 ' Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroupDocuments, Me.RibbonPageGroupInvitation, Me.RibbonPageGroupAddSignature, Me.RibbonPageGroupReceiver}) @@ -373,6 +379,7 @@ Partial Public Class frmEnvelopeEditor ' Me.RibbonStatusBar1.ItemLinks.Add(Me.txtCreatorEmailLabel) Me.RibbonStatusBar1.ItemLinks.Add(Me.txtEnvelopeIdLabel2) + Me.RibbonStatusBar1.ItemLinks.Add(Me.BarStaticItem1) resources.ApplyResources(Me.RibbonStatusBar1, "RibbonStatusBar1") Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 @@ -767,6 +774,7 @@ Partial Public Class frmEnvelopeEditor Friend WithEvents txtEnvelopeIdLabel2 As DevExpress.XtraBars.BarStaticItem Friend WithEvents colPageCount As DevExpress.XtraGrid.Columns.TileViewColumn Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem + Friend WithEvents BarStaticItem1 As DevExpress.XtraBars.BarStaticItem #End Region diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.resx b/EnvelopeGenerator.Form/frmEnvelopeEditor.resx index 970894a5..f83640e4 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.resx +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.resx @@ -1043,6 +1043,12 @@ DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + + BarStaticItem1 + + + DevExpress.XtraBars.BarStaticItem, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a + RibbonPage1 diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index 2b83f201..67bb7898 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -330,27 +330,29 @@ Partial Public Class frmEnvelopeEditor MsgBox(Resources.Envelope.Envelope_could_not_be_sent, MsgBoxStyle.Critical, Text) Else If MsgBox(Resources.Envelope.Envelope_Invitations_Sent, MsgBoxStyle.Information Or MsgBoxStyle.OkOnly, Text) = MsgBoxResult.Ok Then - If DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then - Dim oDecrypted = Decryption.Decrypt(My.Settings.NetUse_PW) - For Each odoc In Controller.Envelope.Documents 'envelope ist leer! - Directory2Delete = "" - CopyFileWithNetUse(odoc.Filepath, DOCUMENT_PATH_MOVE_AFTSEND, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) - If Directory2Delete <> String.Empty Then - Logger.Debug("Now Deleting SourcePath: {0} ...", Directory2Delete) - Try - System.IO.Directory.Delete(Directory2Delete, True) - Logger.Debug("Successfully deleted Sourcepath!") - Catch ex As Exception - Logger.Warn("Unexpected Error while deleting SourcePath {0}", Directory2Delete) - Logger.Warn("ErrorMessage: {0}", ex.Message) - End Try - - End If - Next - End If - - End If + 'If DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then + ' If My.Settings.NetUse_PW <> String.Empty And My.Settings.NetUse_Usr <> String.Empty Then + ' Dim oDecrypted = Decryption.Decrypt(My.Settings.NetUse_PW) + ' For Each odoc In Controller.Envelope.Documents 'envelope ist leer! + ' Directory2Delete = "" + ' If CopyFileWithNetUse(odoc.Filepath, DOCUMENT_PATH_MOVE_AFTSEND, My.Settings.NetUse_Usr, My.Settings.NetUse_PW) = False Then + ' BarStaticItem1.Caption = "ERROR while copying files to DMZ! Check Your log!" + ' End If + ' If Directory2Delete <> String.Empty Then + ' Logger.Debug("Now Deleting SourcePath: {0} ...", Directory2Delete) + ' Try + ' System.IO.Directory.Delete(Directory2Delete, True) + ' Logger.Debug("Successfully deleted Sourcepath!") + ' Catch ex As Exception + ' Logger.Warn("Unexpected Error while deleting SourcePath {0}", Directory2Delete) + ' Logger.Warn("ErrorMessage: {0}", ex.Message) + ' End Try + + ' End If + ' Next + ' End If + + 'End If Me.Close() End If End If @@ -397,7 +399,7 @@ Partial Public Class frmEnvelopeEditor Else Logger.Warn("Error while connecting to network-path: " & pDestinationPath) - MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") + 'MsgBox("Error while connecting to network: " & pDestinationPath, MsgBoxStyle.Critical, "Unexpected error in CopyFileWithNetUse") Return False End If End Using