From 03e5c95cc7ab6e0d7799524d8ab289d6c369108d Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Mon, 26 Jun 2023 10:53:26 +0200 Subject: [PATCH] Sonderzeichen bei Datenserverupload werden nun entfernt. --- VERAGAddIn/frmAvisoAnfügen.Designer.vb | 14 ++++++++++++++ VERAGAddIn/frmAvisoAnfügen.vb | 1 + VERAGAddIn/rbnMailItem.Designer.vb | 8 ++++---- VERAGAddIn/rbnMailItem.vb | 3 ++- VERAGAddIn/rbnVERAG.vb | 18 ++++++++++++++---- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/VERAGAddIn/frmAvisoAnfügen.Designer.vb b/VERAGAddIn/frmAvisoAnfügen.Designer.vb index 02fe3ac..0fcd84d 100644 --- a/VERAGAddIn/frmAvisoAnfügen.Designer.vb +++ b/VERAGAddIn/frmAvisoAnfügen.Designer.vb @@ -47,6 +47,7 @@ Partial Class frmAvisoAnfuegen Me.dgvAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.bttnSaveMail = New System.Windows.Forms.Button() Me.btnSaveAttachments = New System.Windows.Forms.Button() + Me.Label4 = New System.Windows.Forms.Label() CType(Me.dgvAnhaenge, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvSendungen, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvAviso, System.ComponentModel.ISupportInitialize).BeginInit() @@ -397,12 +398,24 @@ Partial Class frmAvisoAnfuegen Me.btnSaveAttachments.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnSaveAttachments.UseVisualStyleBackColor = True ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label4.ForeColor = System.Drawing.Color.Red + Me.Label4.Location = New System.Drawing.Point(530, 4) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(100, 20) + Me.Label4.TabIndex = 39 + Me.Label4.Text = "Testsystem" + ' 'frmAvisoAnfuegen ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.White Me.ClientSize = New System.Drawing.Size(642, 797) + Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.dgvAnhaenge) Me.Controls.Add(Me.cboArt) Me.Controls.Add(Me.Label3) @@ -461,4 +474,5 @@ Partial Class frmAvisoAnfuegen Friend WithEvents columnName As Windows.Forms.DataGridViewTextBoxColumn Friend WithEvents cbx As Windows.Forms.CheckBox Friend WithEvents CheckBox1 As Windows.Forms.CheckBox + Friend WithEvents Label4 As Windows.Forms.Label End Class diff --git a/VERAGAddIn/frmAvisoAnfügen.vb b/VERAGAddIn/frmAvisoAnfügen.vb index ff37789..d989c0f 100644 --- a/VERAGAddIn/frmAvisoAnfügen.vb +++ b/VERAGAddIn/frmAvisoAnfügen.vb @@ -20,6 +20,7 @@ Public Class frmAvisoAnfuegen Private Sub frmAvisoAnfügen_Load(sender As Object, e As EventArgs) Handles Me.Load txtBezeichnung.Text = Bezeichnung txtSrchDat.Text = Now.AddMonths(-1).ToShortDateString + Label4.Visible = VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM cboFiliale.fillWithSQL("SELECT FilialenNr, Grenzstelle FROM Filialen WHERE Fil_Status='A' ORDER BY FilialenNr ", True, "FMZOLL", True) txtLKWNr.Focus() diff --git a/VERAGAddIn/rbnMailItem.Designer.vb b/VERAGAddIn/rbnMailItem.Designer.vb index 65c2238..a5e9684 100644 --- a/VERAGAddIn/rbnMailItem.Designer.vb +++ b/VERAGAddIn/rbnMailItem.Designer.vb @@ -1,7 +1,7 @@ Partial Class rbnMailItem Inherits Microsoft.Office.Tools.Ribbon.RibbonBase - _ + Public Sub New(ByVal container As System.ComponentModel.IContainer) MyClass.New() @@ -12,7 +12,7 @@ End Sub - _ + Public Sub New() MyBase.New(Globals.Factory.GetRibbonFactory()) @@ -22,7 +22,7 @@ End Sub 'Die Komponente überschreibt den Löschvorgang zum Bereinigen der Komponentenliste. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -39,7 +39,7 @@ 'Hinweis: Die folgende Prozedur ist für den Komponenten-Designer erforderlich. 'Das Bearbeiten ist mit dem Komponenten-Designer möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. - _ + Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.Tab1 = Me.Factory.CreateRibbonTab diff --git a/VERAGAddIn/rbnMailItem.vb b/VERAGAddIn/rbnMailItem.vb index 369cd0b..45d0e61 100644 --- a/VERAGAddIn/rbnMailItem.vb +++ b/VERAGAddIn/rbnMailItem.vb @@ -13,7 +13,8 @@ Public Class rbnMailItem Dim currentexplorer As Outlook.Explorer Private Sub rbnMailItem_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load - VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False + ' VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True LOGIN_OK = AVISO_Mail_Functions.initFirmaUser() currentexplorer = ThisAddIn.SharedExplorer diff --git a/VERAGAddIn/rbnVERAG.vb b/VERAGAddIn/rbnVERAG.vb index e7ff14e..b740f7d 100644 --- a/VERAGAddIn/rbnVERAG.vb +++ b/VERAGAddIn/rbnVERAG.vb @@ -12,6 +12,7 @@ Imports SDL Imports System.Net Imports System.Security.Policy Imports System.Diagnostics.Eventing.Reader +Imports System.Runtime.InteropServices.ComTypes Public Class VERAGRibbon Dim LOGIN_OK = False @@ -35,7 +36,8 @@ Public Class VERAGRibbon Private Sub Ribbon1_Load(ByVal sender As System.Object, ByVal e As RibbonUIEventArgs) Handles MyBase.Load - cAllgemein.TESTSYSTEM = False + 'cAllgemein.TESTSYSTEM = False + cAllgemein.TESTSYSTEM = True LOGIN_OK = AVISO_Mail_Functions.initFirmaUser() End Sub @@ -138,6 +140,7 @@ Public Class AVISO_Mail_Functions Dim strFileName As String = "E-Mail" If mailItem.Subject IsNot Nothing AndAlso mailItem.Subject <> "" Then strFileName = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?!€,&'\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg" + strFileName = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(strFileName) End If 'Dim strFileName As String = "Mail.msg" Dim pdf_mail = "" @@ -602,8 +605,10 @@ Public Class AVISO_Mail_Functions Try If AvisoId > 0 Then ' The full path will place the email in the user's temporary folder - If bezeichnung = "" Then bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg" + + bezeichnung = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(bezeichnung) + Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg") ' Save the email to the user's temp folder and convert it to a .MSG 'Dim cnt = 0 @@ -623,6 +628,7 @@ Public Class AVISO_Mail_Functions ' Clean up the temporary .MSG file from the user's temporary folder System.IO.File.Delete(strTmpPath) End If + Catch ex As Exception MsgBox(ex.Message & ex.StackTrace) Finally @@ -636,9 +642,13 @@ Public Class AVISO_Mail_Functions Try If AvisoId > 0 Then - If bezeichnung = "" Then bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg" - Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg") + If bezeichnung = "" Then + bezeichnung = Left(Regex.Replace(mailItem.Subject, "[\/\\\:\?\*\<\>\|""]", ""), 100).Replace("""", "").Replace(vbTab, " ") & ".msg" + End If + bezeichnung = VERAG_PROG_ALLGEMEIN.cDATENSERVER.replaceInvalidCahr(bezeichnung) + + Dim strTmpPath As String = System.IO.Path.GetTempPath() & bezeichnung & If(bezeichnung.EndsWith(".msg"), "", ".msg") mailItem.SaveAs(strTmpPath, Outlook.OlSaveAsType.olMSG)