diff --git a/EnvelopeGenerator.Common/Entities/DbConfig.vb b/EnvelopeGenerator.Common/Entities/DbConfig.vb index 6f93198c..a59b7fe2 100644 --- a/EnvelopeGenerator.Common/Entities/DbConfig.vb +++ b/EnvelopeGenerator.Common/Entities/DbConfig.vb @@ -3,13 +3,6 @@ Public Property DocumentPathOrigin As String = "" Public Property DocumentPath As String = "" Public Property ExportPath As String = "" - Public Property DocumentPath_DMZ As String = "" - Public Property ExportPath_DMZ As String = "" - Public Property DOCUMENT_PATH_MOVE_AFTSEND As String = "" - Public Property FINISHED_PATH_EX_DMZ As String = "" - Public Property EML_PATH_EX_DMZ As String = "" Public Property SendingProfile As Integer = 0 Public Property SignatureHost As String = "" - Public Property NetUse_necessary As Boolean = False - Public Property NetUse_Finish As Boolean = False End Class diff --git a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb index f15171d1..5287e5ac 100644 --- a/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb +++ b/EnvelopeGenerator.Common/Jobs/FinalizeDocument/FinalizeDocumentJob.vb @@ -82,49 +82,14 @@ 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) + Config.DocumentPath = Config.DocumentPath - If My.Settings.RuninDMZ = True Then - If Config.DocumentPath_DMZ <> String.Empty Then - Logger.Debug("RuninDMZ - Using DocumentPath_DMZ: [{0}] - Overwrite Document-Path", Config.DocumentPath_DMZ) - Config.DocumentPath = Config.DocumentPath_DMZ - Config.NetUse_necessary = True - Else - Config.DocumentPath = Config.DocumentPath - 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) - Config.DocumentPath = Config.DOCUMENT_PATH_MOVE_AFTSEND - 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) - Config.NetUse_Finish = True - End If - If Config.ExportPath_DMZ <> String.Empty Then - Logger.Debug("RuninDMZ - Using ExportPath_DMZ: [{0}] - Overwrite ExportPath", Config.ExportPath_DMZ) - Config.ExportPath = Config.ExportPath_DMZ - End If - End If Logger.Debug("ExportPath: [{0}]", Config.ExportPath) - If Config.NetUse_Finish = True Then - 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()) >= {CompleteWaitTime} ORDER BY GUID" Dim oTable = Database.GetDatatable(oSql) @@ -157,10 +122,6 @@ Namespace Jobs Logger.Warn("EnvelopeData could not be loaded for Id [{0}]!", oId) Throw New ArgumentNullException("EnvelopeData") End If - 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 Logger.Debug("Burning Annotations to pdf ...") Dim oBurnedDocument As Byte() = BurnAnnotationsToPdf(oEnvelopeData) If oBurnedDocument Is Nothing Then @@ -196,13 +157,6 @@ Namespace Jobs Throw New ExportDocumentException("Could not export final document to disk!", ex) End Try - 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 - Clean_DNZ_PAth(Config.FINISHED_PATH_EX_DMZ) - End If - End If - End If Logger.Info("Writing EB-bytes to database...") Update_File_DB(oOutputFilePath, oEnvelope.Id) @@ -287,48 +241,48 @@ Namespace Jobs data = br.ReadBytes(CInt(numBytes)) Return data 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}" - Logger.Debug("EXECUTING NetUse_Command for " & pDestinationPath) - Dim processInfo As New ProcessStartInfo("cmd.exe", $"/C {netUseCommand}") - processInfo.RedirectStandardOutput = True - processInfo.UseShellExecute = False - processInfo.CreateNoWindow = True + '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 + ' processInfo.CreateNoWindow = True - Using process As Process = Process.Start(processInfo) - process.WaitForExit() + ' 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 + ' ' 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 Clean_DNZ_PAth(pSourcePath As String) As Boolean - Dim oFilename = System.IO.Path.GetFileName(pSourcePath) + 'Private Function Clean_DNZ_PAth(pSourcePath As String) As Boolean + ' Dim oFilename = System.IO.Path.GetFileName(pSourcePath) - Logger.Debug("## Starting Clean_DNZ_PAth ...") - Logger.Debug("## pSourcePath {0}", pSourcePath) + ' Logger.Debug("## Starting Clean_DNZ_PAth ...") + ' Logger.Debug("## pSourcePath {0}", pSourcePath) - Dim oDirectorySource = Path.Combine(pSourcePath, ParentFolderUID) + ' Dim oDirectorySource = Path.Combine(pSourcePath, ParentFolderUID) - 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 + ' 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 - End Function + 'End Function Private Function SendFinalEmails(pEnvelope As Envelope) As Boolean ', pAttachment As String Dim oMailToCreator = pEnvelope.FinalEmailToCreator Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers @@ -398,15 +352,7 @@ Namespace Jobs Dim oAnnotations = pEnvelopeData.AnnotationData Dim oInputPath = "" If IsNothing(pEnvelopeData.DocAsByte) Then - If My.Settings.RuninDMZ Then - Logger.Debug("Replacing Path in pData.DocumentPath ...") - oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DocumentPath) - ElseIf Config.DOCUMENT_PATH_MOVE_AFTSEND <> String.Empty Then - Logger.Debug("Replacing Path in pData.DocumentPath ...") - oInputPath = pEnvelopeData.DocumentPath.Replace(Config.DocumentPathOrigin, Config.DOCUMENT_PATH_MOVE_AFTSEND) - Else - oInputPath = pEnvelopeData.DocumentPath - End If + oInputPath = pEnvelopeData.DocumentPath Logger.Info($"Input path: [{oInputPath}]") Else Logger.Info($"we got bytes..") diff --git a/EnvelopeGenerator.Common/Models/ConfigModel.vb b/EnvelopeGenerator.Common/Models/ConfigModel.vb index 01e89f8b..dffa8036 100644 --- a/EnvelopeGenerator.Common/Models/ConfigModel.vb +++ b/EnvelopeGenerator.Common/Models/ConfigModel.vb @@ -16,17 +16,12 @@ Public Class ConfigModel Dim oRow As DataRow = oTable.Rows.Item(0) 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", ""), - .SendingProfile = oRow.ItemEx("SENDING_PROFILE", 0), - .SignatureHost = oRow.ItemEx("SIGNATURE_HOST", ""), - .ExternalProgramName = oRow.ItemEx("EXTERNAL_PROGRAM_NAME", ""), - .DOCUMENT_PATH_MOVE_AFTSEND = oRow.ItemEx("DOCUMENT_PATH_MOVE_AFTSEND", ""), - .FINISHED_PATH_EX_DMZ = oRow.ItemEx("FINISHED_PATH_EX_DMZ", ""), - .EML_PATH_EX_DMZ = oRow.ItemEx("EML_PATH_EX_DMZ", "") + .DocumentPath = oRow.ItemEx("DOCUMENT_PATH", ""), + .DocumentPathOrigin = oRow.ItemEx("DOCUMENT_PATH", ""), + .ExportPath = oRow.ItemEx("EXPORT_PATH", ""), + .SendingProfile = oRow.ItemEx("SENDING_PROFILE", 0), + .SignatureHost = oRow.ItemEx("SIGNATURE_HOST", ""), + .ExternalProgramName = oRow.ItemEx("EXTERNAL_PROGRAM_NAME", "") } Catch ex As Exception Logger.Error(ex) diff --git a/EnvelopeGenerator.Common/My Project/AssemblyInfo.vb b/EnvelopeGenerator.Common/My Project/AssemblyInfo.vb index ea66036d..98768762 100644 --- a/EnvelopeGenerator.Common/My Project/AssemblyInfo.vb +++ b/EnvelopeGenerator.Common/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' indem Sie "*" wie unten gezeigt eingeben: ' - - + + diff --git a/EnvelopeGenerator.Common/My Project/Settings.Designer.vb b/EnvelopeGenerator.Common/My Project/Settings.Designer.vb index aad32a06..55633f64 100644 --- a/EnvelopeGenerator.Common/My Project/Settings.Designer.vb +++ b/EnvelopeGenerator.Common/My Project/Settings.Designer.vb @@ -15,7 +15,7 @@ Option Explicit On Namespace My _ Partial Friend NotInheritable Class MySettings Inherits Global.System.Configuration.ApplicationSettingsBase @@ -53,33 +53,6 @@ Namespace My Return defaultInstance End Get End Property - - _ - Public ReadOnly Property RuninDMZ() As Boolean - Get - Return CType(Me("RuninDMZ"),Boolean) - End Get - End Property - - _ - Public ReadOnly Property NetUse_Usr() As String - Get - Return CType(Me("NetUse_Usr"),String) - End Get - End Property - - _ - Public ReadOnly Property NetUse_PW() As String - Get - Return CType(Me("NetUse_PW"),String) - End Get - End Property End Class End Namespace diff --git a/EnvelopeGenerator.Common/My Project/Settings.settings b/EnvelopeGenerator.Common/My Project/Settings.settings index f06f716e..f7f176ac 100644 --- a/EnvelopeGenerator.Common/My Project/Settings.settings +++ b/EnvelopeGenerator.Common/My Project/Settings.settings @@ -1,15 +1,5 @@  - + - - - False - - - dd-gan\Administrator - - - sY4vnATDXwosbTJGip6SqA== - - + \ No newline at end of file diff --git a/EnvelopeGenerator.Common/Strings/Envelope.en.resx b/EnvelopeGenerator.Common/Strings/Envelope.en.resx index 1eb26f3b..97de2fe9 100644 --- a/EnvelopeGenerator.Common/Strings/Envelope.en.resx +++ b/EnvelopeGenerator.Common/Strings/Envelope.en.resx @@ -169,7 +169,7 @@ Envelope-Editor - This email could not be validated! + The email [ @Mail ] could not be varified! Error sending the envelope: diff --git a/EnvelopeGenerator.Common/Strings/Envelope.resx b/EnvelopeGenerator.Common/Strings/Envelope.resx index 1eaecce1..f2ec900a 100644 --- a/EnvelopeGenerator.Common/Strings/Envelope.resx +++ b/EnvelopeGenerator.Common/Strings/Envelope.resx @@ -169,7 +169,7 @@ Umschlag-Editor - Die Email-Adresse konnte nicht validiert werden! + Die Email-Adresse [ @Mail ] konnte nicht validiert werden! Fehler beim Senden des Umschlags: diff --git a/EnvelopeGenerator.Common/Strings/Envelope1.Designer.vb b/EnvelopeGenerator.Common/Strings/Envelope1.Designer.vb index 466cb614..d2679585 100644 --- a/EnvelopeGenerator.Common/Strings/Envelope1.Designer.vb +++ b/EnvelopeGenerator.Common/Strings/Envelope1.Designer.vb @@ -218,7 +218,7 @@ Namespace My.Resources End Property ''' - ''' Sucht eine lokalisierte Zeichenfolge, die Die Email-Adresse konnte nicht validiert werden! ähnelt. + ''' Sucht eine lokalisierte Zeichenfolge, die Die Email-Adresse [ @Mail ] konnte nicht validiert werden! ähnelt. ''' Public Shared ReadOnly Property Error_email_Validation() As String Get diff --git a/EnvelopeGenerator.Common/app.config b/EnvelopeGenerator.Common/app.config index 63222b2e..dbc1d6f0 100644 --- a/EnvelopeGenerator.Common/app.config +++ b/EnvelopeGenerator.Common/app.config @@ -2,9 +2,6 @@ - -
- @@ -29,17 +26,4 @@ - - - - False - - - dd-gan\Administrator - - - sY4vnATDXwosbTJGip6SqA== - - - diff --git a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb index c4a15eaa..7265245e 100644 --- a/EnvelopeGenerator.Form/frmEnvelopeEditor.vb +++ b/EnvelopeGenerator.Form/frmEnvelopeEditor.vb @@ -4,9 +4,12 @@ Imports System.IO Imports DevExpress.Export.Xl Imports DevExpress.Utils.CommonDialogs Imports DevExpress.Utils.Drawing +Imports DevExpress.Utils.Svg.CommonSvgImages Imports DevExpress.XtraEditors Imports DevExpress.XtraExport.Helpers Imports DevExpress.XtraGrid +Imports DevExpress.XtraGrid.Columns +Imports DevExpress.XtraGrid.Views.Base Imports DevExpress.XtraGrid.Views.Grid Imports DevExpress.XtraSplashScreen Imports DigitalData.Modules.Base @@ -41,30 +44,30 @@ Partial Public Class frmEnvelopeEditor 'SaveEnvelopeWithValidation() ' If Not IsNothing(Envelope) Then Try - ' prüfen ob es schon eine Datei gibt - If Documents.Count > 0 Then - MsgBox(Resources.Envelope.Only_one_file_is_allowed, MsgBoxStyle.Information, Text) - Return + ' prüfen ob es schon eine Datei gibt + If Documents.Count > 0 Then + MsgBox(Resources.Envelope.Only_one_file_is_allowed, MsgBoxStyle.Information, Text) + Return + End If + + If OpenFileDialog1.ShowDialog() = DialogResult.OK Then + Dim oDocument = Await Controller.CreateDocument(OpenFileDialog1.FileName) + + If oDocument IsNot Nothing Then + Documents.Add(oDocument) + ' Update_File_DB(OpenFileDialog1.FileName) + Else + MsgBox(Resources.Envelope.Document_Could_Not_Be_Saved, MsgBoxStyle.Critical, Text) End If + End If - If OpenFileDialog1.ShowDialog() = DialogResult.OK Then - Dim oDocument = Await Controller.CreateDocument(OpenFileDialog1.FileName) + Catch ex As Exception + Logger.Error(ex) + Finally + SplashScreenManager.CloseOverlayForm(oHandle) - If oDocument IsNot Nothing Then - Documents.Add(oDocument) - ' Update_File_DB(OpenFileDialog1.FileName) - Else - MsgBox(Resources.Envelope.Document_Could_Not_Be_Saved, MsgBoxStyle.Critical, Text) - End If - End If - - Catch ex As Exception - Logger.Error(ex) - Finally - SplashScreenManager.CloseOverlayForm(oHandle) - - RibbonPageGroupAddSignature_Enabled() - End Try + RibbonPageGroupAddSignature_Enabled() + End Try ' Else ' SplashScreenManager.CloseOverlayForm(oHandle) ' End If @@ -531,7 +534,12 @@ Partial Public Class frmEnvelopeEditor RibbonPageGroupAddSignature_Enabled() End Sub Dim CellValueChanged As Boolean = False + Private Sub ViewReceivers_ColumnPositionChanged(sender As Object, e As EventArgs) Handles ViewReceivers.ColumnPositionChanged + + + End Sub Private Sub ViewReceivers_CellValueChanged(sender As Object, e As Views.Base.CellValueChangedEventArgs) Handles ViewReceivers.CellValueChanged + If e.Column.FieldName = COL_EMAIL And CellValueChanged = False Then If e.Value Is Nothing Then ' Keine E-Mail-Adresse, also weg damit @@ -552,14 +560,20 @@ Partial Public Class frmEnvelopeEditor ViewReceivers.SetRowCellValue(e.RowHandle, ViewReceivers.Columns.Item(COL_CODE), oAccessCode) CellValueChanged = False Else - MsgBox(Resources.Envelope.Error_email_Validation, MsgBoxStyle.Exclamation, Text) - ViewReceivers.SetFocusedValue("") + Dim oMsg = Resources.Envelope.Error_email_Validation + oMsg = oMsg.Replace("@Mail", oEmailAdress) + MsgBox(oMsg, MsgBoxStyle.Exclamation, Text) + ViewReceivers.DeleteRow(ViewReceivers.FocusedRowHandle) End If End If End If End If End Sub + Private Sub email_validation() + + End Sub + Private Function IsValidEmailAddress(pEmailAddress As String) As Boolean Try If pEmailAddress.Contains("@") Then @@ -584,4 +598,10 @@ Partial Public Class frmEnvelopeEditor Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick End Sub + + Private Sub ViewReceivers_CellValueChanging(sender As Object, e As CellValueChangedEventArgs) Handles ViewReceivers.CellValueChanging + + End Sub + + End Class