diff --git a/Gastro/Gastro.vbproj b/Gastro/Gastro.vbproj index 4a1aefb..45dc114 100644 --- a/Gastro/Gastro.vbproj +++ b/Gastro/Gastro.vbproj @@ -53,15 +53,30 @@ - - - - - - - - - + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Core.Document.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Core.Export.Tiff.Section.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Document.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Export.Image.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Export.Pdf.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Viewer.Common.dll + + + C:\Program Files (x86)\GrapeCity\ActiveReports 15\Tools\GrapeCity.ActiveReports.Viewer.Win.dll + True @@ -227,6 +242,7 @@ + diff --git a/Gastro/frmMenu.vb b/Gastro/frmMenu.vb index d176943..4911461 100644 --- a/Gastro/frmMenu.vb +++ b/Gastro/frmMenu.vb @@ -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 \ No newline at end of file diff --git a/Gastro/licenses.licx b/Gastro/licenses.licx new file mode 100644 index 0000000..c7ef3e2 --- /dev/null +++ b/Gastro/licenses.licx @@ -0,0 +1,2 @@ +GrapeCity.ActiveReports.SectionReport, GrapeCity.ActiveReports +GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport, GrapeCity.ActiveReports.Export.Image \ No newline at end of file diff --git a/Gastro/usrcntlPrint.vb b/Gastro/usrcntlPrint.vb index 44e0b6e..a7d172c 100644 --- a/Gastro/usrcntlPrint.vb +++ b/Gastro/usrcntlPrint.vb @@ -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 diff --git a/Gastro/usrcntlVerteiler.vb b/Gastro/usrcntlVerteiler.vb index 6927c78..ae4f3d7 100644 --- a/Gastro/usrcntlVerteiler.vb +++ b/Gastro/usrcntlVerteiler.vb @@ -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