Newsletter,GreenpulseCBAMCost, Rechnungsausgang-Pdf inDatenarchiv
This commit is contained in:
@@ -1841,9 +1841,9 @@ Public Class cFakturierung
|
|||||||
Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
|
Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
|
||||||
rpt.Run(False)
|
rpt.Run(False)
|
||||||
p.NeverEmbedFonts = ""
|
p.NeverEmbedFonts = ""
|
||||||
|
|
||||||
p.Export(rpt.Document, tmpPath)
|
p.Export(rpt.Document, tmpPath)
|
||||||
|
|
||||||
|
|
||||||
Dim Paramslist As New cParameterList(VERAG_PROG_ALLGEMEIN.cAllgemein.PROGID)
|
Dim Paramslist As New cParameterList(VERAG_PROG_ALLGEMEIN.cAllgemein.PROGID)
|
||||||
Dim enableZugpferd = Paramslist.GET_PARAMETER_VALUE_BOOL("ZUGFeRD")
|
Dim enableZugpferd = Paramslist.GET_PARAMETER_VALUE_BOOL("ZUGFeRD")
|
||||||
If enableZugpferd Then
|
If enableZugpferd Then
|
||||||
@@ -1854,9 +1854,18 @@ Public Class cFakturierung
|
|||||||
Dim fileInfo_ZP As New FileInfo(Zugferdpath)
|
Dim fileInfo_ZP As New FileInfo(Zugferdpath)
|
||||||
Dim ZUGF_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "ZUGFERD", Now().Year, "", "", fileInfo_ZP.Name, -1, False)
|
Dim ZUGF_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "ZUGFERD", Now().Year, "", "", fileInfo_ZP.Name, -1, False)
|
||||||
ZUGF_DS.uploadDataToDATENSERVER(Zugferdpath, fileInfo_ZP.Name, fileInfo_ZP.Extension,,,, True)
|
ZUGF_DS.uploadDataToDATENSERVER(Zugferdpath, fileInfo_ZP.Name, fileInfo_ZP.Extension,,,, True)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'----------Rechnung immer in Datenserver speichern------------------------
|
||||||
|
If Not Kopie Then
|
||||||
|
If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
Dim RG_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("RECHNUNGEN", "Firma_" & Rechnung.Firma_ID, CDate(Rechnung.RechnungsDatum).Year & "_" & CDate(Rechnung.RechnungsDatum).Month, "", "", RG_Bezeichnung, Rechnung.RechnungsKundenNr, False)
|
||||||
|
RG_DS.uploadDataToDATENSERVER(tmpPath, RG_Bezeichnung, ".pdf",,,, True)
|
||||||
|
Rechnung.SAVE_DsId(RG_DS.da_id)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
'-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
Path = tmpPath
|
Path = tmpPath
|
||||||
|
|
||||||
@@ -2847,6 +2856,13 @@ Public Class cFakturierung
|
|||||||
End Try
|
End Try
|
||||||
'-------------------------------------------------------------------------------
|
'-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
'----------Rechnung immer in Datenserver speichern------------------------
|
||||||
|
Dim RG_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("RECHNUNGEN", "Firma_" & RECHNUNG.Firma_ID, CDate(RECHNUNG.RechnungsDatum).Year & "_" & CDate(RECHNUNG.RechnungsDatum).Month, "", "", RG_Bezeichnung, RECHNUNG.RechnungsKundenNr, True)
|
||||||
|
RG_DS.uploadDataToDATENSERVER(tmpPath, RG_Bezeichnung, ".pdf",,,, True)
|
||||||
|
RECHNUNG.SAVE_DsId(RG_DS.da_id)
|
||||||
|
'-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
' MsgBox(Rechnugnsdruck)
|
' MsgBox(Rechnugnsdruck)
|
||||||
Dim RD_DRUCK = If(Rechnugnsdruck >= 0, Rechnugnsdruck, If(AD.Rechnungsdruck, 0)) 'If(AD.Rechnungsdruck, 0)
|
Dim RD_DRUCK = If(Rechnugnsdruck >= 0, Rechnugnsdruck, If(AD.Rechnungsdruck, 0)) 'If(AD.Rechnungsdruck, 0)
|
||||||
' MsgBox(RD_DRUCK)
|
' MsgBox(RD_DRUCK)
|
||||||
@@ -4457,6 +4473,23 @@ Public Class cFakturierung
|
|||||||
MsgBox("Therefore-Import fehlgeschlagen!" & ex.Message & ex.StackTrace)
|
MsgBox("Therefore-Import fehlgeschlagen!" & ex.Message & ex.StackTrace)
|
||||||
End Try
|
End Try
|
||||||
'-------------------------------------------------------------------------------
|
'-------------------------------------------------------------------------------
|
||||||
|
Try
|
||||||
|
'----------Rechnung immer in Datenserver speichern------------------------
|
||||||
|
If Not SRDruckWiederholen And saveInTherefore Then
|
||||||
|
If Not VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM And VorschauID = "" Then
|
||||||
|
Dim RG_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("RECHNUNGEN", "Firma_" & Firma_ID, CDate(dt.Rows(0)("RechnungsDatum")).Year & "_" & CDate(dt.Rows(0)("RechnungsDatum")).Month, "", "", "Sammelrechnung_" & RechnungsNr & ".pdf", dt.Rows(0)("RechnungsKundenNr"), False)
|
||||||
|
RG_DS.uploadDataToDATENSERVER(pathPDF, "Sammelrechnung_" & RechnungsNr & ".pdf", ".pdf",,,, True)
|
||||||
|
For Each r In dt.Rows
|
||||||
|
VERAG_PROG_ALLGEMEIN.cRechnungsausgang.SAVE_DsId(r("RK_ID"), RG_DS.da_id)
|
||||||
|
Next
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
MsgBox("RG PDF Speichern fehlgeschlagen!" & ex.Message & ex.StackTrace)
|
||||||
|
End Try
|
||||||
|
'-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
'ABRECHNUNGS API:
|
'ABRECHNUNGS API:
|
||||||
'-------------------------------------------------------------------------------
|
'-------------------------------------------------------------------------------
|
||||||
|
|||||||
268
SDL/kunden/Newsletter/frmNewsletter.Designer.vb
generated
268
SDL/kunden/Newsletter/frmNewsletter.Designer.vb
generated
@@ -24,36 +24,38 @@ Partial Class frmNewsletter
|
|||||||
Private Sub InitializeComponent()
|
Private Sub InitializeComponent()
|
||||||
Me.components = New System.ComponentModel.Container()
|
Me.components = New System.ComponentModel.Container()
|
||||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmNewsletter))
|
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmNewsletter))
|
||||||
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
|
||||||
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox()
|
Me.RichTextBox1 = New System.Windows.Forms.RichTextBox()
|
||||||
Me.Label1 = New System.Windows.Forms.Label()
|
Me.Label1 = New System.Windows.Forms.Label()
|
||||||
Me.Label2 = New System.Windows.Forms.Label()
|
Me.Label2 = New System.Windows.Forms.Label()
|
||||||
Me.MyTextBox1 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
|
||||||
Me.Label3 = New System.Windows.Forms.Label()
|
Me.Label3 = New System.Windows.Forms.Label()
|
||||||
Me.Label4 = New System.Windows.Forms.Label()
|
Me.Label4 = New System.Windows.Forms.Label()
|
||||||
Me.Button1 = New System.Windows.Forms.Button()
|
Me.Button1 = New System.Windows.Forms.Button()
|
||||||
Me.cboKundenstamm = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
|
||||||
Me.Button2 = New System.Windows.Forms.Button()
|
Me.Button2 = New System.Windows.Forms.Button()
|
||||||
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
|
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
|
||||||
Me.Label5 = New System.Windows.Forms.Label()
|
Me.Label5 = New System.Windows.Forms.Label()
|
||||||
Me.Button3 = New System.Windows.Forms.Button()
|
Me.Button3 = New System.Windows.Forms.Button()
|
||||||
Me.Button4 = New System.Windows.Forms.Button()
|
Me.Button4 = New System.Windows.Forms.Button()
|
||||||
Me.Button5 = New System.Windows.Forms.Button()
|
Me.Button5 = New System.Windows.Forms.Button()
|
||||||
Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
|
||||||
Me.Label6 = New System.Windows.Forms.Label()
|
Me.Label6 = New System.Windows.Forms.Label()
|
||||||
Me.Button6 = New System.Windows.Forms.Button()
|
Me.Button6 = New System.Windows.Forms.Button()
|
||||||
|
Me.Button7 = New System.Windows.Forms.Button()
|
||||||
|
Me.cbxNewsletter = New System.Windows.Forms.CheckBox()
|
||||||
|
Me.Label7 = New System.Windows.Forms.Label()
|
||||||
|
Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||||
|
Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
||||||
|
Me.cboKundenstamm = New VERAG_PROG_ALLGEMEIN.MyComboBox()
|
||||||
|
Me.MyTextBox1 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||||
|
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||||
|
Me.Email = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.EmailCC = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.EmailBCC = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.EmpfängerTitel = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.EmpfängerName = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||||
|
Me.ListBox1 = New System.Windows.Forms.ListBox()
|
||||||
|
Me.Label8 = New System.Windows.Forms.Label()
|
||||||
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'MyDatagridview1
|
|
||||||
'
|
|
||||||
Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
|
|
||||||
Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
|
||||||
Me.MyDatagridview1.Location = New System.Drawing.Point(892, 119)
|
|
||||||
Me.MyDatagridview1.Name = "MyDatagridview1"
|
|
||||||
Me.MyDatagridview1.Size = New System.Drawing.Size(537, 498)
|
|
||||||
Me.MyDatagridview1.TabIndex = 0
|
|
||||||
'
|
|
||||||
'RichTextBox1
|
'RichTextBox1
|
||||||
'
|
'
|
||||||
Me.RichTextBox1.Location = New System.Drawing.Point(13, 178)
|
Me.RichTextBox1.Location = New System.Drawing.Point(13, 178)
|
||||||
@@ -67,9 +69,9 @@ Partial Class frmNewsletter
|
|||||||
Me.Label1.AutoSize = True
|
Me.Label1.AutoSize = True
|
||||||
Me.Label1.Location = New System.Drawing.Point(13, 159)
|
Me.Label1.Location = New System.Drawing.Point(13, 159)
|
||||||
Me.Label1.Name = "Label1"
|
Me.Label1.Name = "Label1"
|
||||||
Me.Label1.Size = New System.Drawing.Size(53, 13)
|
Me.Label1.Size = New System.Drawing.Size(119, 13)
|
||||||
Me.Label1.TabIndex = 2
|
Me.Label1.TabIndex = 2
|
||||||
Me.Label1.Text = "Mail-Text:"
|
Me.Label1.Text = "Mail-Text (auch HTML):"
|
||||||
'
|
'
|
||||||
'Label2
|
'Label2
|
||||||
'
|
'
|
||||||
@@ -80,29 +82,6 @@ Partial Class frmNewsletter
|
|||||||
Me.Label2.TabIndex = 3
|
Me.Label2.TabIndex = 3
|
||||||
Me.Label2.Text = "Betreff:"
|
Me.Label2.Text = "Betreff:"
|
||||||
'
|
'
|
||||||
'MyTextBox1
|
|
||||||
'
|
|
||||||
Me.MyTextBox1._DateTimeOnly = False
|
|
||||||
Me.MyTextBox1._numbersOnly = False
|
|
||||||
Me.MyTextBox1._numbersOnlyKommastellen = ""
|
|
||||||
Me.MyTextBox1._numbersOnlyTrennzeichen = True
|
|
||||||
Me.MyTextBox1._Prozent = False
|
|
||||||
Me.MyTextBox1._ShortDateNew = False
|
|
||||||
Me.MyTextBox1._ShortDateOnly = False
|
|
||||||
Me.MyTextBox1._TimeOnly = False
|
|
||||||
Me.MyTextBox1._TimeOnly_Seconds = False
|
|
||||||
Me.MyTextBox1._value = ""
|
|
||||||
Me.MyTextBox1._Waehrung = False
|
|
||||||
Me.MyTextBox1._WaehrungZeichen = True
|
|
||||||
Me.MyTextBox1.ForeColor = System.Drawing.Color.Black
|
|
||||||
Me.MyTextBox1.Location = New System.Drawing.Point(16, 119)
|
|
||||||
Me.MyTextBox1.MaxLineLength = -1
|
|
||||||
Me.MyTextBox1.MaxLines_Warning = ""
|
|
||||||
Me.MyTextBox1.MaxLines_Warning_Label = Nothing
|
|
||||||
Me.MyTextBox1.Name = "MyTextBox1"
|
|
||||||
Me.MyTextBox1.Size = New System.Drawing.Size(870, 20)
|
|
||||||
Me.MyTextBox1.TabIndex = 4
|
|
||||||
'
|
|
||||||
'Label3
|
'Label3
|
||||||
'
|
'
|
||||||
Me.Label3.AutoSize = True
|
Me.Label3.AutoSize = True
|
||||||
@@ -130,17 +109,6 @@ Partial Class frmNewsletter
|
|||||||
Me.Button1.Text = "Alle Zoll-Abrechnungs-Kunden"
|
Me.Button1.Text = "Alle Zoll-Abrechnungs-Kunden"
|
||||||
Me.Button1.UseVisualStyleBackColor = True
|
Me.Button1.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'cboKundenstamm
|
|
||||||
'
|
|
||||||
Me.cboKundenstamm._allowedValuesFreiText = Nothing
|
|
||||||
Me.cboKundenstamm._allowFreiText = False
|
|
||||||
Me.cboKundenstamm._value = ""
|
|
||||||
Me.cboKundenstamm.FormattingEnabled = True
|
|
||||||
Me.cboKundenstamm.Location = New System.Drawing.Point(1067, 9)
|
|
||||||
Me.cboKundenstamm.Name = "cboKundenstamm"
|
|
||||||
Me.cboKundenstamm.Size = New System.Drawing.Size(126, 21)
|
|
||||||
Me.cboKundenstamm.TabIndex = 9
|
|
||||||
'
|
|
||||||
'Button2
|
'Button2
|
||||||
'
|
'
|
||||||
Me.Button2.Location = New System.Drawing.Point(1341, 90)
|
Me.Button2.Location = New System.Drawing.Point(1341, 90)
|
||||||
@@ -152,15 +120,15 @@ Partial Class frmNewsletter
|
|||||||
'
|
'
|
||||||
'ProgressBar1
|
'ProgressBar1
|
||||||
'
|
'
|
||||||
Me.ProgressBar1.Location = New System.Drawing.Point(13, 635)
|
Me.ProgressBar1.Location = New System.Drawing.Point(892, 685)
|
||||||
Me.ProgressBar1.Name = "ProgressBar1"
|
Me.ProgressBar1.Name = "ProgressBar1"
|
||||||
Me.ProgressBar1.Size = New System.Drawing.Size(873, 23)
|
Me.ProgressBar1.Size = New System.Drawing.Size(537, 23)
|
||||||
Me.ProgressBar1.TabIndex = 11
|
Me.ProgressBar1.TabIndex = 11
|
||||||
'
|
'
|
||||||
'Label5
|
'Label5
|
||||||
'
|
'
|
||||||
Me.Label5.AutoSize = True
|
Me.Label5.AutoSize = True
|
||||||
Me.Label5.Location = New System.Drawing.Point(408, 661)
|
Me.Label5.Location = New System.Drawing.Point(889, 669)
|
||||||
Me.Label5.Name = "Label5"
|
Me.Label5.Name = "Label5"
|
||||||
Me.Label5.Size = New System.Drawing.Size(18, 13)
|
Me.Label5.Size = New System.Drawing.Size(18, 13)
|
||||||
Me.Label5.TabIndex = 12
|
Me.Label5.TabIndex = 12
|
||||||
@@ -168,13 +136,14 @@ Partial Class frmNewsletter
|
|||||||
'
|
'
|
||||||
'Button3
|
'Button3
|
||||||
'
|
'
|
||||||
|
Me.Button3.BackColor = System.Drawing.Color.PapayaWhip
|
||||||
Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
Me.Button3.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
||||||
Me.Button3.Location = New System.Drawing.Point(309, 677)
|
Me.Button3.Location = New System.Drawing.Point(1217, 627)
|
||||||
Me.Button3.Name = "Button3"
|
Me.Button3.Name = "Button3"
|
||||||
Me.Button3.Size = New System.Drawing.Size(212, 31)
|
Me.Button3.Size = New System.Drawing.Size(212, 47)
|
||||||
Me.Button3.TabIndex = 13
|
Me.Button3.TabIndex = 13
|
||||||
Me.Button3.Text = "Senden"
|
Me.Button3.Text = "Senden"
|
||||||
Me.Button3.UseVisualStyleBackColor = True
|
Me.Button3.UseVisualStyleBackColor = False
|
||||||
'
|
'
|
||||||
'Button4
|
'Button4
|
||||||
'
|
'
|
||||||
@@ -194,17 +163,6 @@ Partial Class frmNewsletter
|
|||||||
Me.Button5.Text = "Auswahl löschen"
|
Me.Button5.Text = "Auswahl löschen"
|
||||||
Me.Button5.UseVisualStyleBackColor = True
|
Me.Button5.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
'MyComboBox1
|
|
||||||
'
|
|
||||||
Me.MyComboBox1._allowedValuesFreiText = Nothing
|
|
||||||
Me.MyComboBox1._allowFreiText = False
|
|
||||||
Me.MyComboBox1._value = ""
|
|
||||||
Me.MyComboBox1.FormattingEnabled = True
|
|
||||||
Me.MyComboBox1.Location = New System.Drawing.Point(77, 68)
|
|
||||||
Me.MyComboBox1.Name = "MyComboBox1"
|
|
||||||
Me.MyComboBox1.Size = New System.Drawing.Size(126, 21)
|
|
||||||
Me.MyComboBox1.TabIndex = 17
|
|
||||||
'
|
|
||||||
'Label6
|
'Label6
|
||||||
'
|
'
|
||||||
Me.Label6.AutoSize = True
|
Me.Label6.AutoSize = True
|
||||||
@@ -217,19 +175,182 @@ Partial Class frmNewsletter
|
|||||||
'Button6
|
'Button6
|
||||||
'
|
'
|
||||||
Me.Button6.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
Me.Button6.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
||||||
Me.Button6.Location = New System.Drawing.Point(12, 677)
|
Me.Button6.Location = New System.Drawing.Point(12, 635)
|
||||||
Me.Button6.Name = "Button6"
|
Me.Button6.Name = "Button6"
|
||||||
Me.Button6.Size = New System.Drawing.Size(212, 31)
|
Me.Button6.Size = New System.Drawing.Size(212, 31)
|
||||||
Me.Button6.TabIndex = 18
|
Me.Button6.TabIndex = 18
|
||||||
Me.Button6.Text = "Testmail"
|
Me.Button6.Text = "Testmail öffnen..."
|
||||||
Me.Button6.UseVisualStyleBackColor = True
|
Me.Button6.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
|
'Button7
|
||||||
|
'
|
||||||
|
Me.Button7.AllowDrop = True
|
||||||
|
Me.Button7.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
|
||||||
|
Me.Button7.Location = New System.Drawing.Point(230, 635)
|
||||||
|
Me.Button7.Name = "Button7"
|
||||||
|
Me.Button7.Size = New System.Drawing.Size(212, 31)
|
||||||
|
Me.Button7.TabIndex = 19
|
||||||
|
Me.Button7.Text = "Testmail senden ..."
|
||||||
|
Me.Button7.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'cbxNewsletter
|
||||||
|
'
|
||||||
|
Me.cbxNewsletter.AutoSize = True
|
||||||
|
Me.cbxNewsletter.Checked = True
|
||||||
|
Me.cbxNewsletter.CheckState = System.Windows.Forms.CheckState.Checked
|
||||||
|
Me.cbxNewsletter.Location = New System.Drawing.Point(375, 155)
|
||||||
|
Me.cbxNewsletter.Name = "cbxNewsletter"
|
||||||
|
Me.cbxNewsletter.Size = New System.Drawing.Size(167, 17)
|
||||||
|
Me.cbxNewsletter.TabIndex = 20
|
||||||
|
Me.cbxNewsletter.Text = "Newsletter Layout verwenden"
|
||||||
|
Me.cbxNewsletter.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'Label7
|
||||||
|
'
|
||||||
|
Me.Label7.AutoSize = True
|
||||||
|
Me.Label7.Location = New System.Drawing.Point(548, 156)
|
||||||
|
Me.Label7.Name = "Label7"
|
||||||
|
Me.Label7.Size = New System.Drawing.Size(30, 13)
|
||||||
|
Me.Label7.TabIndex = 21
|
||||||
|
Me.Label7.Text = "Titel:"
|
||||||
|
'
|
||||||
|
'MyTextBox2
|
||||||
|
'
|
||||||
|
Me.MyTextBox2._DateTimeOnly = False
|
||||||
|
Me.MyTextBox2._numbersOnly = False
|
||||||
|
Me.MyTextBox2._numbersOnlyKommastellen = ""
|
||||||
|
Me.MyTextBox2._numbersOnlyTrennzeichen = True
|
||||||
|
Me.MyTextBox2._Prozent = False
|
||||||
|
Me.MyTextBox2._ShortDateNew = False
|
||||||
|
Me.MyTextBox2._ShortDateOnly = False
|
||||||
|
Me.MyTextBox2._TimeOnly = False
|
||||||
|
Me.MyTextBox2._TimeOnly_Seconds = False
|
||||||
|
Me.MyTextBox2._value = ""
|
||||||
|
Me.MyTextBox2._Waehrung = False
|
||||||
|
Me.MyTextBox2._WaehrungZeichen = True
|
||||||
|
Me.MyTextBox2.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.MyTextBox2.Location = New System.Drawing.Point(584, 153)
|
||||||
|
Me.MyTextBox2.MaxLineLength = -1
|
||||||
|
Me.MyTextBox2.MaxLines_Warning = ""
|
||||||
|
Me.MyTextBox2.MaxLines_Warning_Label = Nothing
|
||||||
|
Me.MyTextBox2.Name = "MyTextBox2"
|
||||||
|
Me.MyTextBox2.Size = New System.Drawing.Size(302, 20)
|
||||||
|
Me.MyTextBox2.TabIndex = 22
|
||||||
|
'
|
||||||
|
'MyComboBox1
|
||||||
|
'
|
||||||
|
Me.MyComboBox1._allowedValuesFreiText = Nothing
|
||||||
|
Me.MyComboBox1._allowFreiText = False
|
||||||
|
Me.MyComboBox1._value = ""
|
||||||
|
Me.MyComboBox1.FormattingEnabled = True
|
||||||
|
Me.MyComboBox1.Items.AddRange(New Object() {"cbam@verag.ag", "cbam@imex-group.com", "support@verag.ag"})
|
||||||
|
Me.MyComboBox1.Location = New System.Drawing.Point(77, 68)
|
||||||
|
Me.MyComboBox1.Name = "MyComboBox1"
|
||||||
|
Me.MyComboBox1.Size = New System.Drawing.Size(126, 21)
|
||||||
|
Me.MyComboBox1.TabIndex = 17
|
||||||
|
'
|
||||||
|
'cboKundenstamm
|
||||||
|
'
|
||||||
|
Me.cboKundenstamm._allowedValuesFreiText = Nothing
|
||||||
|
Me.cboKundenstamm._allowFreiText = False
|
||||||
|
Me.cboKundenstamm._value = ""
|
||||||
|
Me.cboKundenstamm.FormattingEnabled = True
|
||||||
|
Me.cboKundenstamm.Location = New System.Drawing.Point(1067, 9)
|
||||||
|
Me.cboKundenstamm.Name = "cboKundenstamm"
|
||||||
|
Me.cboKundenstamm.Size = New System.Drawing.Size(126, 21)
|
||||||
|
Me.cboKundenstamm.TabIndex = 9
|
||||||
|
'
|
||||||
|
'MyTextBox1
|
||||||
|
'
|
||||||
|
Me.MyTextBox1._DateTimeOnly = False
|
||||||
|
Me.MyTextBox1._numbersOnly = False
|
||||||
|
Me.MyTextBox1._numbersOnlyKommastellen = ""
|
||||||
|
Me.MyTextBox1._numbersOnlyTrennzeichen = True
|
||||||
|
Me.MyTextBox1._Prozent = False
|
||||||
|
Me.MyTextBox1._ShortDateNew = False
|
||||||
|
Me.MyTextBox1._ShortDateOnly = False
|
||||||
|
Me.MyTextBox1._TimeOnly = False
|
||||||
|
Me.MyTextBox1._TimeOnly_Seconds = False
|
||||||
|
Me.MyTextBox1._value = ""
|
||||||
|
Me.MyTextBox1._Waehrung = False
|
||||||
|
Me.MyTextBox1._WaehrungZeichen = True
|
||||||
|
Me.MyTextBox1.ForeColor = System.Drawing.Color.Black
|
||||||
|
Me.MyTextBox1.Location = New System.Drawing.Point(16, 119)
|
||||||
|
Me.MyTextBox1.MaxLineLength = -1
|
||||||
|
Me.MyTextBox1.MaxLines_Warning = ""
|
||||||
|
Me.MyTextBox1.MaxLines_Warning_Label = Nothing
|
||||||
|
Me.MyTextBox1.Name = "MyTextBox1"
|
||||||
|
Me.MyTextBox1.Size = New System.Drawing.Size(870, 20)
|
||||||
|
Me.MyTextBox1.TabIndex = 4
|
||||||
|
'
|
||||||
|
'MyDatagridview1
|
||||||
|
'
|
||||||
|
Me.MyDatagridview1.AKTUALISIERUNGS_INTERVALL = -1
|
||||||
|
Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
|
||||||
|
Me.MyDatagridview1.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.Email, Me.EmailCC, Me.EmailBCC, Me.EmpfängerTitel, Me.EmpfängerName})
|
||||||
|
Me.MyDatagridview1.Location = New System.Drawing.Point(892, 119)
|
||||||
|
Me.MyDatagridview1.Name = "MyDatagridview1"
|
||||||
|
Me.MyDatagridview1.Size = New System.Drawing.Size(537, 498)
|
||||||
|
Me.MyDatagridview1.TabIndex = 0
|
||||||
|
'
|
||||||
|
'Email
|
||||||
|
'
|
||||||
|
Me.Email.HeaderText = "Email"
|
||||||
|
Me.Email.Name = "Email"
|
||||||
|
'
|
||||||
|
'EmailCC
|
||||||
|
'
|
||||||
|
Me.EmailCC.HeaderText = "EmailCC"
|
||||||
|
Me.EmailCC.Name = "EmailCC"
|
||||||
|
'
|
||||||
|
'EmailBCC
|
||||||
|
'
|
||||||
|
Me.EmailBCC.HeaderText = "EmailBCC"
|
||||||
|
Me.EmailBCC.Name = "EmailBCC"
|
||||||
|
'
|
||||||
|
'EmpfängerTitel
|
||||||
|
'
|
||||||
|
Me.EmpfängerTitel.HeaderText = "EmpfängerTitel"
|
||||||
|
Me.EmpfängerTitel.Name = "EmpfängerTitel"
|
||||||
|
'
|
||||||
|
'EmpfängerName
|
||||||
|
'
|
||||||
|
Me.EmpfängerName.HeaderText = "EmpfängerName"
|
||||||
|
Me.EmpfängerName.Name = "EmpfängerName"
|
||||||
|
'
|
||||||
|
'ListBox1
|
||||||
|
'
|
||||||
|
Me.ListBox1.AllowDrop = True
|
||||||
|
Me.ListBox1.FormattingEnabled = True
|
||||||
|
Me.ListBox1.Location = New System.Drawing.Point(448, 635)
|
||||||
|
Me.ListBox1.Name = "ListBox1"
|
||||||
|
Me.ListBox1.ScrollAlwaysVisible = True
|
||||||
|
Me.ListBox1.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
|
||||||
|
Me.ListBox1.Size = New System.Drawing.Size(417, 82)
|
||||||
|
Me.ListBox1.TabIndex = 23
|
||||||
|
'
|
||||||
|
'Label8
|
||||||
|
'
|
||||||
|
Me.Label8.AutoSize = True
|
||||||
|
Me.Label8.Location = New System.Drawing.Point(445, 620)
|
||||||
|
Me.Label8.Name = "Label8"
|
||||||
|
Me.Label8.Size = New System.Drawing.Size(53, 13)
|
||||||
|
Me.Label8.TabIndex = 24
|
||||||
|
Me.Label8.Text = "Anhänge:"
|
||||||
|
'
|
||||||
'frmNewsletter
|
'frmNewsletter
|
||||||
'
|
'
|
||||||
|
Me.AllowDrop = True
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.BackColor = System.Drawing.Color.White
|
Me.BackColor = System.Drawing.Color.White
|
||||||
Me.ClientSize = New System.Drawing.Size(1441, 720)
|
Me.ClientSize = New System.Drawing.Size(1441, 720)
|
||||||
|
Me.Controls.Add(Me.Label8)
|
||||||
|
Me.Controls.Add(Me.ListBox1)
|
||||||
|
Me.Controls.Add(Me.MyTextBox2)
|
||||||
|
Me.Controls.Add(Me.Label7)
|
||||||
|
Me.Controls.Add(Me.cbxNewsletter)
|
||||||
|
Me.Controls.Add(Me.Button7)
|
||||||
Me.Controls.Add(Me.Button6)
|
Me.Controls.Add(Me.Button6)
|
||||||
Me.Controls.Add(Me.MyComboBox1)
|
Me.Controls.Add(Me.MyComboBox1)
|
||||||
Me.Controls.Add(Me.Label6)
|
Me.Controls.Add(Me.Label6)
|
||||||
@@ -276,4 +397,15 @@ Partial Class frmNewsletter
|
|||||||
Friend WithEvents MyComboBox1 As VERAG_PROG_ALLGEMEIN.MyComboBox
|
Friend WithEvents MyComboBox1 As VERAG_PROG_ALLGEMEIN.MyComboBox
|
||||||
Friend WithEvents Label6 As Label
|
Friend WithEvents Label6 As Label
|
||||||
Friend WithEvents Button6 As Button
|
Friend WithEvents Button6 As Button
|
||||||
|
Friend WithEvents Button7 As Button
|
||||||
|
Friend WithEvents cbxNewsletter As CheckBox
|
||||||
|
Friend WithEvents Label7 As Label
|
||||||
|
Friend WithEvents MyTextBox2 As VERAG_PROG_ALLGEMEIN.MyTextBox
|
||||||
|
Friend WithEvents Email As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents EmailCC As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents EmailBCC As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents EmpfängerTitel As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents EmpfängerName As DataGridViewTextBoxColumn
|
||||||
|
Friend WithEvents ListBox1 As ListBox
|
||||||
|
Friend WithEvents Label8 As Label
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -117,6 +117,21 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
|
<metadata name="Email.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="EmailCC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="EmailBCC.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="EmpfängerTitel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="EmpfängerName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<value>True</value>
|
||||||
|
</metadata>
|
||||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
|
|||||||
@@ -1,39 +1,73 @@
|
|||||||
Public Class frmNewsletter
|
|
||||||
|
Imports System.Drawing.Imaging
|
||||||
|
Imports System.IO
|
||||||
|
Imports System.Net.Mail
|
||||||
|
Imports System.Net.Mime
|
||||||
|
Imports GrapeCity.Documents.Pdf.AcroForms
|
||||||
|
Imports sun.java2d
|
||||||
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
|
|
||||||
|
Public Class frmNewsletter
|
||||||
|
Private exporter As New RichTextBoxHtmlExporter()
|
||||||
|
|
||||||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||||||
ProgressBar1.Minimum = 0
|
Try
|
||||||
ProgressBar1.Maximum = MyDatagridview1.SelectedRows.Count
|
|
||||||
ProgressBar1.Value = 0
|
|
||||||
ProgressBar1.Visible = True
|
|
||||||
ProgressBar1.Style = ProgressBarStyle.Continuous
|
|
||||||
|
|
||||||
If MyDatagridview1.SelectedRows.Count = 0 Then
|
ProgressBar1.Minimum = 0
|
||||||
MsgBox("Bitte mindestens einen Eintrag auswählen.")
|
ProgressBar1.Maximum = MyDatagridview1.SelectedRows.Count
|
||||||
Exit Sub
|
ProgressBar1.Value = 0
|
||||||
End If
|
ProgressBar1.Visible = True
|
||||||
|
ProgressBar1.Style = ProgressBarStyle.Continuous
|
||||||
|
|
||||||
If MsgBox("Wirklich " & MyDatagridview1.SelectedRows.Count & " Mails senden?", vbYesNoCancel) = vbYes Then
|
If MyDatagridview1.SelectedRows.Count = 0 Then
|
||||||
For Each row As DataGridViewRow In MyDatagridview1.SelectedRows
|
MsgBox("Bitte mindestens einen Eintrag auswählen.")
|
||||||
Dim mail As String = getValidEmail(row.Cells("Email").Value.ToString())
|
Exit Sub
|
||||||
Dim mailCC As String = getValidEmail(row.Cells("EmailCC").Value.ToString())
|
End If
|
||||||
Dim mailBCC As String = getValidEmail(row.Cells("EmailBCC").Value.ToString())
|
Label5.Text = "0/" & ProgressBar1.Maximum
|
||||||
Dim ANH As New List(Of String)
|
Dim mailText = getMailtext()
|
||||||
Dim from = ""
|
Dim ANHAENGE = getAnhaenge()
|
||||||
If mail <> "" Then
|
Dim Absender = getAbsender()
|
||||||
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mail, "", "", from,,, mailCC, mailBCC, ANH)
|
Dim Subject = getSubject()
|
||||||
End If
|
|
||||||
' === Fortschritt aktualisieren ===
|
|
||||||
ProgressBar1.Value += 1
|
|
||||||
ProgressBar1.Refresh()
|
|
||||||
|
|
||||||
' Damit UI nicht hängt
|
If MsgBox("Wirklich " & MyDatagridview1.SelectedRows.Count & " Mails senden?", vbYesNoCancel) = vbYes Then
|
||||||
Application.DoEvents()
|
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(Absender, Subject, mailText, Absender,, False, "", "", ANHAENGE)
|
||||||
|
|
||||||
Next
|
For Each row As DataGridViewRow In MyDatagridview1.SelectedRows
|
||||||
End If
|
Dim mail As String = getValidEmail(If(row.Cells("Email").Value, "").ToString())
|
||||||
|
Dim mailCC As String = getValidEmail(If(row.Cells("EmailCC").Value, "").ToString())
|
||||||
|
Dim mailBCC As String = getValidEmail(If(row.Cells("EmailBCC").Value, "").ToString())
|
||||||
|
|
||||||
|
If mail <> "" Then
|
||||||
|
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mail, Subject, mailText, Absender,, False, mailCC, mailBCC, ANHAENGE)
|
||||||
|
End If
|
||||||
|
' === Fortschritt aktualisieren ===
|
||||||
|
ProgressBar1.Value += 1
|
||||||
|
ProgressBar1.Refresh()
|
||||||
|
Label5.Text = ProgressBar1.Value & "/" & ProgressBar1.Maximum
|
||||||
|
' Damit UI nicht hängt
|
||||||
|
Application.DoEvents()
|
||||||
|
|
||||||
|
Next
|
||||||
|
ProgressBar1.Value = ProgressBar1.Maximum
|
||||||
|
Label5.Text = ProgressBar1.Maximum & "/" & ProgressBar1.Maximum
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function getValidEmail(email As String) As String
|
Private Sub RichTextBox1_KeyDown(
|
||||||
|
sender As Object, e As KeyEventArgs) Handles RichTextBox1.KeyDown
|
||||||
|
|
||||||
|
If e.Control AndAlso e.KeyCode = Keys.V AndAlso Clipboard.ContainsImage() Then
|
||||||
|
e.SuppressKeyPress = True
|
||||||
|
exporter.HandlePaste(RichTextBox1)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function getValidEmail(email As Object) As String
|
||||||
|
If email Is Nothing OrElse email Is DBNull.Value Then email = ""
|
||||||
If IsValidEmail(email) Then
|
If IsValidEmail(email) Then
|
||||||
Return email.Trim()
|
Return email.Trim()
|
||||||
Else
|
Else
|
||||||
@@ -41,7 +75,7 @@
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Public Function IsValidEmail(email As String) As Boolean
|
Public Function IsValidEmail(email As String) As Boolean
|
||||||
If String.IsNullOrWhiteSpace(email) Then Return False
|
If String.IsNullOrWhiteSpace(email) Then Return True
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim addr = New System.Net.Mail.MailAddress(email)
|
Dim addr = New System.Net.Mail.MailAddress(email)
|
||||||
@@ -52,9 +86,394 @@
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
|
||||||
Dim mail = InputBox("Bitte Testmail eingeben:")
|
Try
|
||||||
If mail <> "" Then
|
Dim outlookApp As Object
|
||||||
|
|
||||||
|
Try
|
||||||
|
' Laufende Outlook-Instanz holen
|
||||||
|
outlookApp = GetObject(, "Outlook.Application")
|
||||||
|
Catch
|
||||||
|
' Falls Outlook noch nicht läuft
|
||||||
|
outlookApp = CreateObject("Outlook.Application")
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Dim mailItem As Object = outlookApp.CreateItem(0) ' 0 = olMailItem
|
||||||
|
|
||||||
|
With mailItem
|
||||||
|
.To = ""
|
||||||
|
.CC = ""
|
||||||
|
.Subject = MyTextBox1.Text
|
||||||
|
.HTMLBody = getMailtext()
|
||||||
|
.Display() ' Mail öffnen (nicht senden!)
|
||||||
|
End With
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
|
||||||
|
Dim mailTo = InputBox("Bitte Testmail eingeben:")
|
||||||
|
If mailTo <> "" Then
|
||||||
|
Try
|
||||||
|
' Dim mailTo = ""
|
||||||
|
Dim mailCC = ""
|
||||||
|
Dim mailBCC = ""
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(mailTo, getSubject(), getMailtext(), getAbsender(), , False, mailCC, mailBCC, getAnhaenge())
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Function getAnhaenge() As List(Of String)
|
||||||
|
Dim anhaenge As New List(Of String)
|
||||||
|
'---Anhänge:----------------------------
|
||||||
|
For Each line In ListBox1.Text.Split(New String() {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
If File.Exists(line) Then
|
||||||
|
anhaenge.Add(line)
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return anhaenge
|
||||||
|
|
||||||
|
End Function
|
||||||
|
Private Sub ListBoxFiles_DragEnter(sender As Object, e As DragEventArgs) Handles ListBox1.DragEnter
|
||||||
|
|
||||||
|
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
|
||||||
|
e.Effect = DragDropEffects.Copy
|
||||||
|
Else
|
||||||
|
e.Effect = DragDropEffects.None
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Private Sub ListBoxFiles_DragDrop(sender As Object, e As DragEventArgs) Handles ListBox1.DragDrop
|
||||||
|
|
||||||
|
Dim files As String() =
|
||||||
|
CType(e.Data.GetData(DataFormats.FileDrop), String())
|
||||||
|
|
||||||
|
For Each filePath As String In files
|
||||||
|
If System.IO.File.Exists(filePath) Then
|
||||||
|
If Not ListBox1.Items.Contains(filePath) Then
|
||||||
|
ListBox1.Items.Add(filePath)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Function getAbsender() As String
|
||||||
|
If MyComboBox1._value <> "" Then
|
||||||
|
Return MyComboBox1._value
|
||||||
|
Else
|
||||||
|
Return "support@verag.ag"
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
Function getSubject() As String
|
||||||
|
Return MyTextBox1.Text
|
||||||
|
|
||||||
|
End Function
|
||||||
|
Function getMailtext()
|
||||||
|
Dim mailtext As String = ""
|
||||||
|
Dim htmlText As String = RichTextBox1.Text
|
||||||
|
htmlText = htmlText.Replace(vbCrLf, "<br>")
|
||||||
|
htmlText = htmlText.Replace(vbLf, "<br>")
|
||||||
|
htmlText = htmlText.Replace(vbCr, "<br>")
|
||||||
|
|
||||||
|
If cbxNewsletter.Checked Then
|
||||||
|
mailtext &= getMailtext_NewsletterTop()
|
||||||
|
|
||||||
|
'---Content:----------------------------
|
||||||
|
' mailtext &= RichTextBox1.Text
|
||||||
|
mailtext &= exporter.BuildHtml(RichTextBox1.Text.Replace(Environment.NewLine, "<br>"))
|
||||||
|
'---------------------------------------
|
||||||
|
|
||||||
|
If cbxNewsletter.Checked Then mailtext &= getMailtext_NewsletterBottom()
|
||||||
|
Else
|
||||||
|
|
||||||
|
|
||||||
|
mailtext &= "<html><body>" & htmlText.Replace(Environment.NewLine, "<br>") & "</body></html>"
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Return mailtext
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub ListBox1_KeyDown(sender As Object, e As KeyEventArgs) _
|
||||||
|
Handles ListBox1.KeyDown
|
||||||
|
|
||||||
|
If e.KeyCode = Keys.Delete Then
|
||||||
|
|
||||||
|
' Rückwärts durchgehen, sonst Index-Problem
|
||||||
|
For i As Integer = ListBox1.SelectedIndices.Count - 1 To 0 Step -1
|
||||||
|
ListBox1.Items.RemoveAt(ListBox1.SelectedIndices(i))
|
||||||
|
Next
|
||||||
|
|
||||||
|
e.Handled = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Function getMailtext_NewsletterTop2()
|
||||||
|
Dim mailtext As String = ""
|
||||||
|
mailtext &= "<html lang=""de"">
|
||||||
|
<body style=""margin:0; padding:0; background-color:#f4f6f8; font-family:Arial, Helvetica, sans-serif; color:#1f2933;"">
|
||||||
|
<table width=""100%"" cellpadding=""0"" cellspacing=""0"" style=""background-color:#f4f6f8;"">
|
||||||
|
<tr>
|
||||||
|
<td align=""center"">
|
||||||
|
<table width=""720"" cellpadding=""0"" cellspacing=""0"" style=""background-color:#ffffff; max-width:720px;"">"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If MyTextBox2.Text <> "" Then
|
||||||
|
mailtext &= "<tr>
|
||||||
|
<td style=""background-color:#0b2a4a; padding:30px 40px; color:#ffffff;"">
|
||||||
|
<h1 style=""margin:0; font-size:28px; line-height:1.3; font-weight:bold;"">
|
||||||
|
" & MyTextBox2.Text & "
|
||||||
|
</h1>
|
||||||
|
</td>
|
||||||
|
</tr> "
|
||||||
|
End If
|
||||||
|
mailtext &= "<tr><td>"
|
||||||
|
|
||||||
|
Return mailtext
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Function getMailtext_NewsletterTop()
|
||||||
|
Dim mailtext As String = ""
|
||||||
|
mailtext &= "<html lang=""de"">
|
||||||
|
<body style=""margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; color:#1f2933;"">
|
||||||
|
<table width=""100%"" cellpadding=""0"" cellspacing=""0"" style="""">
|
||||||
|
<tr>
|
||||||
|
<td align=""left"">
|
||||||
|
<table width=""720"" cellpadding=""0"" cellspacing=""0"" style=""background-color:#ffffff; max-width:720px;"">"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
If MyTextBox2.Text <> "" Then
|
||||||
|
mailtext &= "<tr>
|
||||||
|
<td style="" padding:30px 40px; color:#ffffff;"">
|
||||||
|
<h1 style=""margin:0; font-size:28px; line-height:1.3; font-weight:bold;"">
|
||||||
|
" & MyTextBox2.Text & "
|
||||||
|
</h1>
|
||||||
|
</td>
|
||||||
|
</tr> "
|
||||||
|
End If
|
||||||
|
mailtext &= "<tr><td>"
|
||||||
|
|
||||||
|
Return mailtext
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Function getMailtext_NewsletterBottom()
|
||||||
|
Dim mailtext As String = ""
|
||||||
|
mailtext &= " </td></tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html> "
|
||||||
|
Return mailtext
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub cbxNewsletter_CheckedChanged(sender As Object, e As EventArgs) Handles cbxNewsletter.CheckedChanged
|
||||||
|
MyTextBox2.Enabled = cbxNewsletter.Checked
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
||||||
|
MyDatagridview1.Rows.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||||
|
MyDatagridview1.SelectAll()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
|
||||||
|
MyDatagridview1.ClearSelection()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
End Class
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Public Class RichTextBoxHtmlImageExporter
|
||||||
|
|
||||||
|
' Private ReadOnly _images As New List(Of ImageInfo)
|
||||||
|
|
||||||
|
' Private Class ImageInfo
|
||||||
|
' Public Property Token As String
|
||||||
|
' Public Property FilePath As String
|
||||||
|
' Public Property ContentId As String
|
||||||
|
' Public Property MimeType As String
|
||||||
|
' End Class
|
||||||
|
|
||||||
|
' ' Beim Einfügen (Ctrl+V) aufrufen
|
||||||
|
' Public Sub HandlePaste(rtb As RichTextBox)
|
||||||
|
' If Not Clipboard.ContainsImage() Then Return
|
||||||
|
|
||||||
|
' Dim img As Image = Clipboard.GetImage()
|
||||||
|
|
||||||
|
' ' Wichtig: Guid NICHT als Variable überschreiben.
|
||||||
|
' Dim id As String = System.Guid.NewGuid().ToString("N")
|
||||||
|
|
||||||
|
' Dim token As String = $"[IMG_{id}]"
|
||||||
|
' Dim filePath As String = Path.Combine(Path.GetTempPath(), $"rtb_img_{id}.png")
|
||||||
|
|
||||||
|
' img.Save(filePath, ImageFormat.Png)
|
||||||
|
|
||||||
|
' _images.Add(New ImageInfo With {
|
||||||
|
' .Token = token,
|
||||||
|
' .FilePath = filePath,
|
||||||
|
' .ContentId = id,
|
||||||
|
' .MimeType = "image/png"
|
||||||
|
' })
|
||||||
|
|
||||||
|
' ' Token an Cursorposition einfügen (Bild selbst bleibt nicht im RTF)
|
||||||
|
' rtb.SelectedText = token & Environment.NewLine
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
' ' HTML + AlternateView (mit LinkedResources) erzeugen
|
||||||
|
' Public Function BuildHtmlView(rtb As RichTextBox) As AlternateView
|
||||||
|
' Dim htmlBody As String = rtb.Text
|
||||||
|
|
||||||
|
' ' Minimal-HTML-Escaping + Zeilenumbrüche
|
||||||
|
' htmlBody = htmlBody.Replace("&", "&").Replace("<", "<").Replace(">", ">")
|
||||||
|
' htmlBody = htmlBody.Replace(Environment.NewLine, "<br>")
|
||||||
|
|
||||||
|
' ' Tokens durch CID-Images ersetzen
|
||||||
|
' For Each img In _images
|
||||||
|
' htmlBody = htmlBody.Replace(
|
||||||
|
' img.Token,
|
||||||
|
' $"<img src=""cid:{img.ContentId}"" style=""max-width:100%; display:block; margin:10px 0;"">"
|
||||||
|
' )
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' Dim fullHtml As String =
|
||||||
|
' $"<!DOCTYPE html>
|
||||||
|
' <html>
|
||||||
|
' <head><meta charset=""UTF-8""></head>
|
||||||
|
' <body style=""font-family:Arial,Helvetica,sans-serif; font-size:14px; line-height:1.5;"">
|
||||||
|
' {htmlBody}
|
||||||
|
' </body>
|
||||||
|
' </html>"
|
||||||
|
|
||||||
|
' Dim view As AlternateView =
|
||||||
|
' AlternateView.CreateAlternateViewFromString(fullHtml, Nothing, MediaTypeNames.Text.Html)
|
||||||
|
|
||||||
|
' ' LinkedResources hinzufügen (Inline Attachments)
|
||||||
|
' For Each img In _images
|
||||||
|
' Dim lr As New LinkedResource(img.FilePath, img.MimeType)
|
||||||
|
' lr.ContentId = img.ContentId
|
||||||
|
' lr.TransferEncoding = TransferEncoding.Base64
|
||||||
|
' view.LinkedResources.Add(lr)
|
||||||
|
' Next
|
||||||
|
|
||||||
|
' Return view
|
||||||
|
' End Function
|
||||||
|
|
||||||
|
' ' Temp-Dateien löschen (optional)
|
||||||
|
' Public Sub Cleanup()
|
||||||
|
' For Each img In _images
|
||||||
|
' Try
|
||||||
|
' If File.Exists(img.FilePath) Then File.Delete(img.FilePath)
|
||||||
|
' Catch
|
||||||
|
' ' optional: Logging
|
||||||
|
' End Try
|
||||||
|
' Next
|
||||||
|
' _images.Clear()
|
||||||
|
' End Sub
|
||||||
|
|
||||||
|
'End Class
|
||||||
|
Public Class RichTextBoxHtmlExporter
|
||||||
|
|
||||||
|
Private ReadOnly _images As New List(Of ImageInfo)
|
||||||
|
|
||||||
|
Private Class ImageInfo
|
||||||
|
Public Property Token As String
|
||||||
|
Public Property FilePath As String
|
||||||
|
End Class
|
||||||
|
|
||||||
|
' Beim Einfügen eines Bildes (Ctrl+V)
|
||||||
|
Public Sub HandlePaste(rtb As RichTextBox)
|
||||||
|
If Not Clipboard.ContainsImage() Then Return
|
||||||
|
|
||||||
|
Dim img As Image = Clipboard.GetImage()
|
||||||
|
|
||||||
|
Dim id As String = System.Guid.NewGuid().ToString("N")
|
||||||
|
Dim token As String = $"[IMG_{id}]"
|
||||||
|
Dim filePath As String =
|
||||||
|
Path.Combine(Path.GetTempPath(), $"rtb_img_{id}.png")
|
||||||
|
|
||||||
|
img.Save(filePath, ImageFormat.Png)
|
||||||
|
|
||||||
|
_images.Add(New ImageInfo With {
|
||||||
|
.Token = token,
|
||||||
|
.FilePath = filePath
|
||||||
|
})
|
||||||
|
|
||||||
|
rtb.SelectedText = token & Environment.NewLine
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' HTML-Text erzeugen
|
||||||
|
Public Function BuildHtml(html) As String
|
||||||
|
'Dim html As String = rtb.Text
|
||||||
|
|
||||||
|
' Grundlegendes Escaping
|
||||||
|
'html = html.Replace("&", "&").
|
||||||
|
' Replace("<", "<").
|
||||||
|
' Replace(">", ">")
|
||||||
|
|
||||||
|
'html = html.Replace(Environment.NewLine, "<br>")
|
||||||
|
|
||||||
|
' Tokens durch IMG-Tags ersetzen
|
||||||
|
For Each img In _images
|
||||||
|
Dim uri As String = New Uri(img.FilePath).AbsoluteUri
|
||||||
|
html = html.Replace(
|
||||||
|
img.Token,
|
||||||
|
$"<img src=""{uri}"" style=""max-width:100%; display:block; margin:10px 0;"">"
|
||||||
|
)
|
||||||
|
Next
|
||||||
|
|
||||||
|
Return WrapHtml(html)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function WrapHtml(body As String) As String
|
||||||
|
Return $"
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset=""UTF-8"">
|
||||||
|
</head>
|
||||||
|
<body style=""font-family:Arial,Helvetica,sans-serif; font-size:14px; line-height:1.5;"">
|
||||||
|
{body}
|
||||||
|
</body>
|
||||||
|
</html>"
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' Optional: Temp-Dateien löschen
|
||||||
|
Public Sub Cleanup()
|
||||||
|
For Each img In _images
|
||||||
|
Try
|
||||||
|
If File.Exists(img.FilePath) Then File.Delete(img.FilePath)
|
||||||
|
Catch
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
_images.Clear()
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -123,6 +123,7 @@ Public Class cRechnungsausgang
|
|||||||
Property Rechnungsart As String = "RG" ' RG=Rechnung; RU=Rechnung Unvollständig; RK=RechnungKopf -> bei unvollständiger Rechnung ein Kopf benötigt (zB Staffelabrechnung)
|
Property Rechnungsart As String = "RG" ' RG=Rechnung; RU=Rechnung Unvollständig; RK=RechnungKopf -> bei unvollständiger Rechnung ein Kopf benötigt (zB Staffelabrechnung)
|
||||||
|
|
||||||
Property Vorlageprovision_Mindestbetrag As Object = Nothing
|
Property Vorlageprovision_Mindestbetrag As Object = Nothing
|
||||||
|
Property dsId As Object = Nothing
|
||||||
|
|
||||||
|
|
||||||
' FROM [VERAG as object=nothing.[dbo as object=nothing.[Rechnungsausgang as object=nothing
|
' FROM [VERAG as object=nothing.[dbo as object=nothing.[Rechnungsausgang as object=nothing
|
||||||
@@ -369,6 +370,7 @@ Public Class cRechnungsausgang
|
|||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Automailversand", Automailversand))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Automailversand", Automailversand))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Rechnungsart", Rechnungsart))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Rechnungsart", Rechnungsart))
|
||||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Vorlageprovision_Mindestbetrag", Vorlageprovision_Mindestbetrag))
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Vorlageprovision_Mindestbetrag", Vorlageprovision_Mindestbetrag))
|
||||||
|
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("dsId", dsId))
|
||||||
|
|
||||||
Return list
|
Return list
|
||||||
End Function
|
End Function
|
||||||
@@ -460,12 +462,25 @@ Public Class cRechnungsausgang
|
|||||||
Return RK_ID > 0
|
Return RK_ID > 0
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function SAVE_DruckDatumZeit() As Boolean
|
Public Function SAVE_DruckDatumZeit() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
Dim sqlstr = " UPDATE Rechnungsausgang SET DruckDatumZeit=@DruckDatumZeit WHERE RK_ID=@RK_ID "
|
Dim sqlstr = " UPDATE Rechnungsausgang SET DruckDatumZeit=@DruckDatumZeit WHERE RK_ID=@RK_ID "
|
||||||
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function SAVE_DsId(DsId) As Boolean
|
||||||
|
Me.dsId = DsId
|
||||||
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
Dim sqlstr = " UPDATE Rechnungsausgang SET DsId=@DsId WHERE RK_ID=@RK_ID "
|
||||||
|
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function SAVE_DsId(RK_ID, DsId) As Boolean
|
||||||
|
Dim sqlstr = " UPDATE Rechnungsausgang SET DsId='" & DsId & "' WHERE RK_ID='" & RK_ID & "' "
|
||||||
|
Return SQL.doSQL(sqlstr, "FMZOLL")
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Sub doVorzeichen()
|
Public Sub doVorzeichen()
|
||||||
Dim vz = If(Vorzeichen = "-", -1, 1)
|
Dim vz = If(Vorzeichen = "-", -1, 1)
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ Public Class cATEZ_Greenpulse_CBAM_CostCalculation
|
|||||||
Dim req As New cCBAM_CostCalculation_Request With {
|
Dim req As New cCBAM_CostCalculation_Request With {
|
||||||
.cn_code = cn_code,
|
.cn_code = cn_code,
|
||||||
.weight = CDbl(weight), ' Tonnen
|
.weight = CDbl(weight), ' Tonnen
|
||||||
.see_total = If(see_total = "", Nothing, see_total), ' optionale echte Emissionen
|
.see_total = If(see_total = "", Nothing, see_total), ' optionale echte Emissionen
|
||||||
.year = If(year = "", Nothing, CInt(year)) ' Phase-in Jahr
|
.year = If(year = "", Nothing, CInt(year)) ' Phase-in Jahr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -511,7 +511,7 @@ BindingFlags.Instance Or BindingFlags.NonPublic, Nothing, [Control], New Object(
|
|||||||
mySmtpsvr.Credentials = myCredentials
|
mySmtpsvr.Credentials = myCredentials
|
||||||
Try
|
Try
|
||||||
'Msg.BodyEncoding = System.Text.Encoding.GetEncoding("UTF-8")
|
'Msg.BodyEncoding = System.Text.Encoding.GetEncoding("UTF-8")
|
||||||
Msg.BodyEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1")
|
Msg.BodyEncoding = System.Text.Encoding.UTF8 'System.Text.Encoding.GetEncoding("ISO-8859-1")
|
||||||
Msg.From = New MailAddress(eMailfrom)
|
Msg.From = New MailAddress(eMailfrom)
|
||||||
|
|
||||||
If eMailTo IsNot Nothing Then
|
If eMailTo IsNot Nothing Then
|
||||||
|
|||||||
Reference in New Issue
Block a user