This commit is contained in:
ms
2026-08-11 10:30:51 +02:00
parent 7365379812
commit 687c0a91ee
5 changed files with 110 additions and 25 deletions

View File

@@ -53,15 +53,30 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="GrapeCity.ActiveReports.ArsClient.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Chart.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Diagnostics.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Document.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Export.Image.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Export.Pdf.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff, processorArchitecture=MSIL" />
<Reference Include="GrapeCity.ActiveReports.Extensibility.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
<Reference Include="GrapeCity.ActiveReports.Viewer.Win.v12, Version=12.2.13986.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff, processorArchitecture=MSIL" />
<Reference Include="GrapeCity.ActiveReports">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Core.Document">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Core.Document.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Core.Export.Tiff.Section">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Core.Export.Tiff.Section.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Document">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Document.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Export.Image">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Export.Image.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Export.Pdf">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Export.Pdf.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Viewer.Common">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Viewer.Common.dll</HintPath>
</Reference>
<Reference Include="GrapeCity.ActiveReports.Viewer.Win">
<HintPath>C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Viewer.Win.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Outlook, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
@@ -227,6 +242,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="gastro.ico" />
<EmbeddedResource Include="licenses.licx" />
<None Include="Resources\mail20.png" />
<None Include="Resources\mail201.png" />
<None Include="Resources\LogOff20.bmp" />

View File

@@ -245,6 +245,10 @@ Public Class frmMenu
Dim myData As IDataObject = Clipboard.GetDataObject()
oMsg.HTMLBody = CType(myData.GetData(GetType(String)), String)
'''
'oMsg.Attachments.Add(IO.Path.Combine(IO.Path.GetTempPath(), "termin.ics"),
' Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue,
' Type.Missing,
' "Mittagsmenü.ics")
oMsg.Display()
@@ -291,6 +295,10 @@ Public Class frmMenu
' MsgBox(bcc)
'ics erstellen
'CreateIcsFile(menu.MenuDateBis.AddHours(-11), menu.MenuDateBis.AddHours(-9).AddMinutes(-30), "Mittagsmenü", "Mittagsmenü bestellen!!!")
setEmailSend(subject, body, empfaenger, cc, Anhang, Anhangdateiname, bcc)
End Sub
@@ -326,5 +334,37 @@ Public Class frmMenu
End If
End Sub
Private Function CreateIcsFile(startDate As DateTime,
endDate As DateTime,
summary As String,
description As String) As String
Dim icsPath As String = IO.Path.Combine(IO.Path.GetTempPath(), "termin.ics")
Dim ics As String =
"BEGIN:VCALENDAR" & vbCrLf &
"VERSION:2.0" & vbCrLf &
"PRODID:-//VERAG//Mittagsmenue//DE" & vbCrLf &
"CALSCALE:GREGORIAN" & vbCrLf &
"METHOD:PUBLISH" & vbCrLf &
"BEGIN:VEVENT" & vbCrLf &
"UID:" & Guid.NewGuid().ToString() & "@verag.ag" & vbCrLf &
"DTSTAMP:" & DateTime.UtcNow.ToString("yyyyMMddTHHmmssZ") & vbCrLf &
"DTSTART:" & startDate.ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf &
"DTEND:" & endDate.ToUniversalTime().ToString("yyyyMMddTHHmmssZ") & vbCrLf &
"SUMMARY:" & summary & vbCrLf &
"DESCRIPTION:" & description & vbCrLf &
"BEGIN:VALARM" & vbCrLf &
"TRIGGER:-PT30M" & vbCrLf &
"ACTION:DISPLAY" & vbCrLf &
"DESCRIPTION:Erinnerung" & vbCrLf &
"END:VALARM" & vbCrLf &
"END:VEVENT" & vbCrLf &
"END:VCALENDAR"
IO.File.WriteAllText(icsPath, ics, System.Text.Encoding.UTF8)
Return icsPath
End Function
End Class

2
Gastro/licenses.licx Normal file
View File

@@ -0,0 +1,2 @@
GrapeCity.ActiveReports.SectionReport, GrapeCity.ActiveReports
GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport, GrapeCity.ActiveReports.Export.Image

View File

@@ -1,4 +1,9 @@
Imports GrapeCity.ActiveReports
Imports GrapeCity.ActiveReports.Export.Image
Imports GrapeCity.ActiveReports.Export.Image.Page.Renderers
Imports GrapeCity.ActiveReports.SectionReportModel
Imports GrapeCity.ActiveReports.Export.Image.Tiff.Section
Imports System.Drawing.Imaging
Public Class usrcntlPrint
@@ -60,28 +65,50 @@ Public Class usrcntlPrint
Function exportJPG()
Dim filename As String = "C:\Gastro\Menues\" & dt.Rows.Item(0).Item("MenuDateVon").ToString.Substring(0, 10) & ".jpg"
Dim jpge As New Export.Image.Tiff.Section.TiffExport
Dim jpge As New Core.Export.Tiff.Section.TiffExport 'Export.Image.Tiff.Section.TiffExport
jpge.export(Viewer.Document, filename)
End Function
Public Sub Export(ByVal ReportDocument As GrapeCity.ActiveReports.Document.SectionDocument, ByVal folderSavePath As String)
' Dim pageindex As Integer = 0
'Public Sub Export(ByVal ReportDocument As GrapeCity.ActiveReports.Document.SectionDocument, ByVal folderSavePath As String)
' ' Dim pageindex As Integer = 0
For Each _pg As GrapeCity.ActiveReports.Document.Section.Page In ReportDocument.Pages
_pg.Units = GrapeCity.ActiveReports.Document.Section.Units.Pixels
Dim bmp As Bitmap = New Bitmap(CInt(_pg.Width), CInt(_pg.Height))
Dim g As Graphics = Graphics.FromImage(bmp)
g.FillRectangle(New SolidBrush(Color.White), 0, 0, bmp.Width, bmp.Height)
_pg.Draw(g, New RectangleF(0, 0, _pg.Width, _pg.Height))
bmp.Save(folderSavePath & dt.Rows.Item(0).Item("MenuDateVon").ToString.Substring(0, 10) & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
'pageindex += 1
_pg.Units = GrapeCity.ActiveReports.Document.Section.Units.Inches
Next
' For Each _pg As GrapeCity.ActiveReports.Document.Section.Page In ReportDocument.Pages
' _pg.Units = GrapeCity.ActiveReports.Document.Section.Units.Pixels
' Dim bmp As Bitmap = New Bitmap(CInt(_pg.Width), CInt(_pg.Height))
' Dim g As Graphics = Graphics.FromImage(bmp)
' g.FillRectangle(New SolidBrush(Color.White), 0, 0, bmp.Width, bmp.Height)
' _pg.Draw(g, New RectangleF(0, 0, _pg.Width, _pg.Height))
' bmp.Save(folderSavePath & dt.Rows.Item(0).Item("MenuDateVon").ToString.Substring(0, 10) & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
' 'pageindex += 1
' _pg.Units = GrapeCity.ActiveReports.Document.Section.Units.Inches
' Next
'End Sub
Public Sub Export(ByVal ReportDocument As GrapeCity.ActiveReports.Document.SectionDocument,
ByVal folderSavePath As String)
Dim baseName As String =
dt.Rows.Item(0).Item("MenuDateVon").ToString.Substring(0, 10)
Dim tiffPath As String = IO.Path.Combine(folderSavePath, baseName & ".tiff")
Dim jpgPath As String = IO.Path.Combine(folderSavePath, baseName & ".jpg")
Dim tiffExport As New TiffExport()
tiffExport.DpiX = 96
tiffExport.DpiY = 96
tiffExport.Export(ReportDocument, tiffPath)
Using img As Image = Image.FromFile(tiffPath)
img.SelectActiveFrame(FrameDimension.Page, 0)
img.Save(jpgPath, ImageFormat.Jpeg)
End Using
End Sub

View File

@@ -24,9 +24,9 @@
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
LoadReci()
If NeuerEintrag = True And SQLTools.CheckIfExist("SELECT * FROM GVerteilerListe WHERE EmpfEMail LIKE '%" & txtEMail.Text & "%' ") Then
If NeuerEintrag = True And SQLTools.CheckIfExist("SELECT * FROM GVerteilerListe WHERE EmpfEMail LIKE '" & txtEMail.Text & "%' ") Then
MsgBox("Diese EMail Adresse ist bereits registriert!") : Exit Sub
ElseIf NeuerEintrag = True And SQLTools.CheckIfExist("SELECT * FROM GVerteilerListe WHERE EmpfEMail LIKE '%" & txtEMail.Text & "%' ") = False Then
ElseIf NeuerEintrag = True And SQLTools.CheckIfExist("SELECT * FROM GVerteilerListe WHERE EmpfEMail LIKE '" & txtEMail.Text & "%' ") = False Then
'Reci.EmpfID = Now
Reci.saveAsNew()
NeuerEintrag = False
@@ -42,7 +42,7 @@
txtName.Enabled = True : txtEMail.Enabled = True
NeuerEintrag = True
Reci = New cEmpfaenger
txtName.Text = "" : txtEMail.Text = ""
txtName.Text = "" : txtEMail.Text = "" : txtSuche.Text = ""
txtName.BackColor = Color.Beige : txtEMail.BackColor = Color.Beige
End Sub