kleiner Änderungen bei AddIn-Vollmachten
This commit is contained in:
@@ -8,6 +8,7 @@ Imports VERAGAddIn.ThisAddIn
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.IO
|
||||
Imports SDL
|
||||
|
||||
Public Class VERAGRibbon
|
||||
Dim LOGIN_OK = False
|
||||
@@ -124,6 +125,7 @@ Public Class AVISO_Mail_Functions
|
||||
Dim pdf_mail = ""
|
||||
Dim SendungsId = -1
|
||||
Dim Art = ""
|
||||
Dim kdNr = -1
|
||||
Dim ATTACHMENTS_LIST As New List(Of String)
|
||||
loadAttachment(mailItem, ATTACHMENTS_LIST)
|
||||
|
||||
@@ -133,7 +135,7 @@ Public Class AVISO_Mail_Functions
|
||||
End If
|
||||
End If
|
||||
Dim Bezeichnung = strFileName
|
||||
Dim AvisoId = getAvisoId(Bezeichnung, pdf_mail, SendungsId, Art, ATTACHMENTS_LIST, isFormular) ')getAttachmentStringList(mailItem))
|
||||
Dim AvisoId = getAvisoId(Bezeichnung, pdf_mail, SendungsId, Art, ATTACHMENTS_LIST, kdNr, isFormular) ')getAttachmentStringList(mailItem))
|
||||
If AvisoId < 0 Then Exit Sub
|
||||
|
||||
Dim BezAnhang = If(Bezeichnung <> strFileName, Bezeichnung, "") 'Wenn die Bezeichnung geändert wurde --> und wenn nur 1 Anhang, dann wird die Bezeichnung für den Anhang verwendet.
|
||||
@@ -144,10 +146,10 @@ Public Class AVISO_Mail_Functions
|
||||
saveMail(mailItem, AvisoId, Bezeichnung,, SendungsId, Art)
|
||||
saveAttachment(ATTACHMENTS_LIST, AvisoId, SendungsId, Art, BezAnhang)
|
||||
ElseIf pdf_mail = "PDF_DATENSERVER" Then
|
||||
saveMailOnDatenserver(mailItem, AvisoId, Bezeichnung,, Art)
|
||||
saveAttachmentOnDatenserver(ATTACHMENTS_LIST, AvisoId, Art, BezAnhang)
|
||||
saveMailOnDatenserver(mailItem, AvisoId, Bezeichnung,, Art, kdNr, True)
|
||||
saveAttachmentOnDatenserver(ATTACHMENTS_LIST, AvisoId, Art, BezAnhang, kdNr, True)
|
||||
ElseIf pdf_mail = "ONLYMAIL_DATENSERVER" Then
|
||||
saveMailOnDatenserver(mailItem, AvisoId, Bezeichnung,, Art)
|
||||
saveMailOnDatenserver(mailItem, AvisoId, Bezeichnung,, Art, kdNr)
|
||||
Else 'ONLYMAIL
|
||||
saveMail(mailItem, AvisoId, Bezeichnung,, SendungsId, Art)
|
||||
End If
|
||||
@@ -393,7 +395,7 @@ Public Class AVISO_Mail_Functions
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Shared Sub saveAttachmentOnDatenserver(ByRef ATTACHMENTS_LIST As List(Of String), AvisoId As Integer, Art As String, BezeichnungAnh As String)
|
||||
Shared Sub saveAttachmentOnDatenserver(ByRef ATTACHMENTS_LIST As List(Of String), AvisoId As Integer, Art As String, BezeichnungAnh As String, Optional kdNr As Integer = -1, Optional multifiles As Boolean = False)
|
||||
Try
|
||||
If AvisoId > 0 Then
|
||||
If ATTACHMENTS_LIST.Count > 1 Then BezeichnungAnh = "" ' nur wenn 1 Anhang wird die Bezeichnung übernommen.
|
||||
@@ -402,8 +404,20 @@ Public Class AVISO_Mail_Functions
|
||||
Dim Bezeichnung = BezeichnungAnh
|
||||
If Bezeichnung = "" Then Bezeichnung = fi.Name
|
||||
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", Bezeichnung)
|
||||
Dim DS As Object = Nothing
|
||||
If multifiles Then
|
||||
DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", Bezeichnung, kdNr, multifiles)
|
||||
Else
|
||||
DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", Bezeichnung)
|
||||
End If
|
||||
Dim path = DS.uploadDataToDATENSERVER(fi.FullName)
|
||||
If path Then
|
||||
Dim c As New cKundenVollmachten(AvisoId)
|
||||
c.kdvm_datenarchivId = DS.da_id
|
||||
c.SAVE()
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Next
|
||||
End If
|
||||
@@ -606,7 +620,7 @@ Public Class AVISO_Mail_Functions
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Shared Sub saveMailOnDatenserver(mailItem As Outlook.MailItem, AvisoId As Integer, Optional bezeichnung As String = "", Optional saveAttachments As Boolean = True, Optional Art As String = "")
|
||||
Shared Sub saveMailOnDatenserver(mailItem As Outlook.MailItem, AvisoId As Integer, Optional bezeichnung As String = "", Optional saveAttachments As Boolean = True, Optional Art As String = "", Optional kdNr As Integer = -1, Optional multifiles As Boolean = False)
|
||||
Try
|
||||
If AvisoId > 0 Then
|
||||
|
||||
@@ -616,11 +630,18 @@ Public Class AVISO_Mail_Functions
|
||||
|
||||
mailItem.SaveAs(strTmpPath, Outlook.OlSaveAsType.olMSG)
|
||||
|
||||
|
||||
'If AVISO.frmSendungAnhangImport.saveToDS(AvisoId, bezeichnung, strTmpPath, Art, "MSG",,,, If(SendungsId, SendungsId, Nothing)) Then
|
||||
' End If
|
||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", bezeichnung)
|
||||
Dim DS As Object = Nothing
|
||||
If multifiles Then
|
||||
DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", bezeichnung, kdNr, multifiles)
|
||||
Else
|
||||
DS = New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "VOLLMACHTEN", "VMID_" & AvisoId, "", "", bezeichnung)
|
||||
End If
|
||||
Dim path = DS.uploadDataToDATENSERVER(strTmpPath)
|
||||
If path Then
|
||||
Dim c As New cKundenVollmachten(AvisoId)
|
||||
c.kdvm_datenarchivId = DS.da_id
|
||||
c.SAVE()
|
||||
End If
|
||||
|
||||
|
||||
' Clean up the temporary .MSG file from the user's temporary folder
|
||||
@@ -636,18 +657,20 @@ Public Class AVISO_Mail_Functions
|
||||
End Sub
|
||||
|
||||
|
||||
Shared Function getAvisoId(ByRef Bezeichnung, ByRef pdf_mail, ByRef SendungsId, ByRef Art, ByRef Att, ByVal isFormular) As Integer
|
||||
Shared Function getAvisoId(ByRef Bezeichnung, ByRef pdf_mail, ByRef SendungsId, ByRef Art, ByRef Att, ByVal isFormular, ByRef kdNr) As Integer
|
||||
|
||||
If (isFormular = True) Then
|
||||
Dim frmAvisoFormularAnfuegen As New frmAvisoFormularAnfuegen(Bezeichnung)
|
||||
frmAvisoFormularAnfuegen.ATT = Att
|
||||
If frmAvisoFormularAnfuegen.ShowDialog = DialogResult.OK Then
|
||||
Dim AvisoId = frmAvisoFormularAnfuegen.vollmachtId
|
||||
kdNr = frmAvisoFormularAnfuegen.KdNr
|
||||
SendungsId = frmAvisoFormularAnfuegen.SendungsId
|
||||
Bezeichnung = frmAvisoFormularAnfuegen.Bezeichnung
|
||||
pdf_mail = frmAvisoFormularAnfuegen.PDF_MAIL
|
||||
Att = frmAvisoFormularAnfuegen.ATT
|
||||
|
||||
|
||||
Return AvisoId
|
||||
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user