From 256c4b9865150fa19c023836b13972c1df08dbf9 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Wed, 13 Nov 2024 08:54:30 +0100 Subject: [PATCH 1/7] =?UTF-8?q?Akt=20wieder=20=C3=B6ffnen=20->=20LkwChat?= =?UTF-8?q?=20aktivieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aviso/My Project/license.elic.xml | 26 -------------------------- Aviso/My Project/licenses.licx | 2 -- Aviso/usrcntlAktDetails.vb | 1 + 3 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 Aviso/My Project/license.elic.xml delete mode 100644 Aviso/My Project/licenses.licx diff --git a/Aviso/My Project/license.elic.xml b/Aviso/My Project/license.elic.xml deleted file mode 100644 index f96e91e..0000000 --- a/Aviso/My Project/license.elic.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - 55633149-C6EB-4350-98D5-3D2BA195D309 - Runtime - VERAG Spedition AG - al@verag.ag - VERAG Spedition AG - 2024-09-28T12:00:00Z - 2025-09-28T12:00:00Z - - - Spire.PDF Pro Edition - 10.8 - - Developer OEM Subscription - 1 - 2147483647 - - - - - e-iceblue - sales@e-iceblue.com - http://www.e-iceblue.com - - diff --git a/Aviso/My Project/licenses.licx b/Aviso/My Project/licenses.licx deleted file mode 100644 index 8c5f570..0000000 --- a/Aviso/My Project/licenses.licx +++ /dev/null @@ -1,2 +0,0 @@ -GrapeCity.ActiveReports.SectionReport, MESCIUS.ActiveReports -GrapeCity.ActiveReports.Viewer.Win.Viewer, MESCIUS.ActiveReports.Viewer.Win \ No newline at end of file diff --git a/Aviso/usrcntlAktDetails.vb b/Aviso/usrcntlAktDetails.vb index dd6bb1a..29fc6fb 100644 --- a/Aviso/usrcntlAktDetails.vb +++ b/Aviso/usrcntlAktDetails.vb @@ -2636,6 +2636,7 @@ Public Class usrcntlAktDetails If vbYes = MsgBox("Möchten Sie den Akt wieder öffnen?", vbYesNoCancel) Then If FUNC.setAbgeschlossen(AvisoID, False) Then frmHauptfenster.avisoAktualisierenAktiveIdBehalten(AvisoID) + VERAG_PROG_ALLGEMEIN.cMessenger.SET_LKWCHAT_AKTIV(AvisoID) reload(AvisoID) End If From 134135685343d83420f43dc9ba52b9048ad52991 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Wed, 20 Nov 2024 15:28:12 +0100 Subject: [PATCH 2/7] TVAPP Settings --- AVISOUPDATER/packages.config | 6 + Aviso/Aviso.vbproj | 11 +- Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/frmEintragTvNew.Designer.vb | 509 ++++++++++++++++++++++++++++ Aviso/frmEintragTvNew.resx | 120 +++++++ Aviso/frmEintragTvNew.vb | 542 ++++++++++++++++++++++++++++++ Aviso/frmHauptfenster.Designer.vb | 50 +-- Aviso/frmHauptfenster.vb | 4 + AvisoTV/packages.config | 6 + Gemeinsames/App.config | 20 +- Gemeinsames/packages.config | 6 + 11 files changed, 1251 insertions(+), 27 deletions(-) create mode 100644 AVISOUPDATER/packages.config create mode 100644 Aviso/frmEintragTvNew.Designer.vb create mode 100644 Aviso/frmEintragTvNew.resx create mode 100644 Aviso/frmEintragTvNew.vb create mode 100644 AvisoTV/packages.config create mode 100644 Gemeinsames/packages.config diff --git a/AVISOUPDATER/packages.config b/AVISOUPDATER/packages.config new file mode 100644 index 0000000..6725fde --- /dev/null +++ b/AVISOUPDATER/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 07bd4c2..8a1a7be 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -658,6 +658,12 @@ Form + + frmEintragTvNew.vb + + + Form + frmFrachtkostenBerechnen.vb @@ -1252,6 +1258,9 @@ frmATZollEingereichtSetzen.vb + + frmEintragTvNew.vb + frmFrachtkostenBerechnen.vb @@ -1429,7 +1438,6 @@ frmGVMSNew.vb - PublicVbMyResourcesResXFileCodeGenerator My.Resources @@ -1635,7 +1643,6 @@ - diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 51f8164..25d4a6f 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb new file mode 100644 index 0000000..db735ae --- /dev/null +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -0,0 +1,509 @@ + +Partial Class frmEintragTvNew + Inherits System.Windows.Forms.Form + + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + Private components As System.ComponentModel.IContainer + + + Private Sub InitializeComponent() + Me.cbxStandort = New System.Windows.Forms.ComboBox() + Me.lblStandort = New System.Windows.Forms.Label() + Me.dgvAVISOTV = New System.Windows.Forms.DataGridView() + Me.grpEingabe = New System.Windows.Forms.GroupBox() + Me.lblNeueTvTextBezeichnung = New System.Windows.Forms.Label() + Me.txtNeueTvTextBezeichnung = New System.Windows.Forms.TextBox() + Me.chkIsActive = New System.Windows.Forms.CheckBox() + Me.chkIsRecurring = New System.Windows.Forms.CheckBox() + Me.grpWochentage = New System.Windows.Forms.GroupBox() + Me.chkSunday = New System.Windows.Forms.CheckBox() + Me.chkSaturday = New System.Windows.Forms.CheckBox() + Me.chkFriday = New System.Windows.Forms.CheckBox() + Me.chkThursday = New System.Windows.Forms.CheckBox() + Me.chkWednesday = New System.Windows.Forms.CheckBox() + Me.chkTuesday = New System.Windows.Forms.CheckBox() + Me.chkMonday = New System.Windows.Forms.CheckBox() + Me.dtpEndTime = New System.Windows.Forms.DateTimePicker() + Me.lblEndTime = New System.Windows.Forms.Label() + Me.dtpStartTime = New System.Windows.Forms.DateTimePicker() + Me.lblStartTime = New System.Windows.Forms.Label() + Me.dtpEndDate = New System.Windows.Forms.DateTimePicker() + Me.lblEndDate = New System.Windows.Forms.Label() + Me.dtpStartDate = New System.Windows.Forms.DateTimePicker() + Me.lblStartDate = New System.Windows.Forms.Label() + Me.txtZeile3 = New System.Windows.Forms.TextBox() + Me.lblZeile3 = New System.Windows.Forms.Label() + Me.txtZeile2 = New System.Windows.Forms.TextBox() + Me.lblZeile2 = New System.Windows.Forms.Label() + Me.txtZeile1 = New System.Windows.Forms.TextBox() + Me.lblZeile1 = New System.Windows.Forms.Label() + Me.cmbTvTextBezeichnungAuswahl = New System.Windows.Forms.ComboBox() + Me.lblBezeichnung = New System.Windows.Forms.Label() + Me.lblPosition = New System.Windows.Forms.Label() + Me.cmbPosition = New System.Windows.Forms.ComboBox() + Me.btnSpeichern = New System.Windows.Forms.Button() + Me.btnLoeschen = New System.Windows.Forms.Button() + Me.btnAbbrechen = New System.Windows.Forms.Button() + Me.chkShowInactive = New System.Windows.Forms.CheckBox() + CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).BeginInit() + Me.grpEingabe.SuspendLayout() + Me.grpWochentage.SuspendLayout() + Me.SuspendLayout() + ' + 'cbxStandort + ' + Me.cbxStandort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cbxStandort.FormattingEnabled = True + Me.cbxStandort.Location = New System.Drawing.Point(15, 25) + Me.cbxStandort.Name = "cbxStandort" + Me.cbxStandort.Size = New System.Drawing.Size(200, 21) + Me.cbxStandort.TabIndex = 0 + ' + 'lblStandort + ' + Me.lblStandort.AutoSize = True + Me.lblStandort.Location = New System.Drawing.Point(12, 9) + Me.lblStandort.Name = "lblStandort" + Me.lblStandort.Size = New System.Drawing.Size(87, 13) + Me.lblStandort.TabIndex = 1 + Me.lblStandort.Text = "Standort wählen:" + ' + 'dgvAVISOTV + ' + Me.dgvAVISOTV.AllowUserToAddRows = False + Me.dgvAVISOTV.AllowUserToDeleteRows = False + Me.dgvAVISOTV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgvAVISOTV.Location = New System.Drawing.Point(15, 60) + Me.dgvAVISOTV.MultiSelect = False + Me.dgvAVISOTV.Name = "dgvAVISOTV" + Me.dgvAVISOTV.ReadOnly = True + Me.dgvAVISOTV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgvAVISOTV.Size = New System.Drawing.Size(977, 200) + Me.dgvAVISOTV.TabIndex = 2 + ' + 'grpEingabe + ' + Me.grpEingabe.Controls.Add(Me.lblNeueTvTextBezeichnung) + Me.grpEingabe.Controls.Add(Me.txtNeueTvTextBezeichnung) + Me.grpEingabe.Controls.Add(Me.chkIsActive) + Me.grpEingabe.Controls.Add(Me.chkIsRecurring) + Me.grpEingabe.Controls.Add(Me.grpWochentage) + Me.grpEingabe.Controls.Add(Me.dtpEndTime) + Me.grpEingabe.Controls.Add(Me.lblEndTime) + Me.grpEingabe.Controls.Add(Me.dtpStartTime) + Me.grpEingabe.Controls.Add(Me.lblStartTime) + Me.grpEingabe.Controls.Add(Me.dtpEndDate) + Me.grpEingabe.Controls.Add(Me.lblEndDate) + Me.grpEingabe.Controls.Add(Me.dtpStartDate) + Me.grpEingabe.Controls.Add(Me.lblStartDate) + Me.grpEingabe.Controls.Add(Me.txtZeile3) + Me.grpEingabe.Controls.Add(Me.lblZeile3) + Me.grpEingabe.Controls.Add(Me.txtZeile2) + Me.grpEingabe.Controls.Add(Me.lblZeile2) + Me.grpEingabe.Controls.Add(Me.txtZeile1) + Me.grpEingabe.Controls.Add(Me.lblZeile1) + Me.grpEingabe.Controls.Add(Me.cmbTvTextBezeichnungAuswahl) + Me.grpEingabe.Controls.Add(Me.lblBezeichnung) + Me.grpEingabe.Controls.Add(Me.lblPosition) + Me.grpEingabe.Controls.Add(Me.cmbPosition) + Me.grpEingabe.Location = New System.Drawing.Point(15, 275) + Me.grpEingabe.Name = "grpEingabe" + Me.grpEingabe.Size = New System.Drawing.Size(977, 427) + Me.grpEingabe.TabIndex = 3 + Me.grpEingabe.TabStop = False + Me.grpEingabe.Text = "Informationen eingeben" + ' + 'lblNeueTvTextBezeichnung + ' + Me.lblNeueTvTextBezeichnung.AutoSize = True + Me.lblNeueTvTextBezeichnung.Location = New System.Drawing.Point(300, 33) + Me.lblNeueTvTextBezeichnung.Name = "lblNeueTvTextBezeichnung" + Me.lblNeueTvTextBezeichnung.Size = New System.Drawing.Size(135, 13) + Me.lblNeueTvTextBezeichnung.TabIndex = 19 + Me.lblNeueTvTextBezeichnung.Text = "Neue TvTextBezeichnung:" + ' + 'txtNeueTvTextBezeichnung + ' + Me.txtNeueTvTextBezeichnung.Location = New System.Drawing.Point(460, 30) + Me.txtNeueTvTextBezeichnung.Name = "txtNeueTvTextBezeichnung" + Me.txtNeueTvTextBezeichnung.Size = New System.Drawing.Size(200, 20) + Me.txtNeueTvTextBezeichnung.TabIndex = 20 + ' + 'chkIsActive + ' + Me.chkIsActive.AutoSize = True + Me.chkIsActive.Location = New System.Drawing.Point(670, 32) + Me.chkIsActive.Name = "chkIsActive" + Me.chkIsActive.Size = New System.Drawing.Size(50, 17) + Me.chkIsActive.TabIndex = 18 + Me.chkIsActive.Text = "Aktiv" + Me.chkIsActive.UseVisualStyleBackColor = True + ' + 'chkIsRecurring + ' + Me.chkIsRecurring.AutoSize = True + Me.chkIsRecurring.Location = New System.Drawing.Point(18, 302) + Me.chkIsRecurring.Name = "chkIsRecurring" + Me.chkIsRecurring.Size = New System.Drawing.Size(86, 17) + Me.chkIsRecurring.TabIndex = 10 + Me.chkIsRecurring.Text = "Wiederholen" + Me.chkIsRecurring.UseVisualStyleBackColor = True + ' + 'grpWochentage + ' + Me.grpWochentage.Controls.Add(Me.chkSunday) + Me.grpWochentage.Controls.Add(Me.chkSaturday) + Me.grpWochentage.Controls.Add(Me.chkFriday) + Me.grpWochentage.Controls.Add(Me.chkThursday) + Me.grpWochentage.Controls.Add(Me.chkWednesday) + Me.grpWochentage.Controls.Add(Me.chkTuesday) + Me.grpWochentage.Controls.Add(Me.chkMonday) + Me.grpWochentage.Location = New System.Drawing.Point(20, 340) + Me.grpWochentage.Name = "grpWochentage" + Me.grpWochentage.Size = New System.Drawing.Size(763, 57) + Me.grpWochentage.TabIndex = 11 + Me.grpWochentage.TabStop = False + Me.grpWochentage.Text = "Wochentage" + ' + 'chkSunday + ' + Me.chkSunday.AutoSize = True + Me.chkSunday.Location = New System.Drawing.Point(664, 25) + Me.chkSunday.Name = "chkSunday" + Me.chkSunday.Size = New System.Drawing.Size(66, 17) + Me.chkSunday.TabIndex = 17 + Me.chkSunday.Text = "Sonntag" + Me.chkSunday.UseVisualStyleBackColor = True + ' + 'chkSaturday + ' + Me.chkSaturday.AutoSize = True + Me.chkSaturday.Location = New System.Drawing.Point(550, 25) + Me.chkSaturday.Name = "chkSaturday" + Me.chkSaturday.Size = New System.Drawing.Size(67, 17) + Me.chkSaturday.TabIndex = 16 + Me.chkSaturday.Text = "Samstag" + Me.chkSaturday.UseVisualStyleBackColor = True + ' + 'chkFriday + ' + Me.chkFriday.AutoSize = True + Me.chkFriday.Location = New System.Drawing.Point(450, 25) + Me.chkFriday.Name = "chkFriday" + Me.chkFriday.Size = New System.Drawing.Size(58, 17) + Me.chkFriday.TabIndex = 15 + Me.chkFriday.Text = "Freitag" + Me.chkFriday.UseVisualStyleBackColor = True + ' + 'chkThursday + ' + Me.chkThursday.AutoSize = True + Me.chkThursday.Location = New System.Drawing.Point(350, 25) + Me.chkThursday.Name = "chkThursday" + Me.chkThursday.Size = New System.Drawing.Size(81, 17) + Me.chkThursday.TabIndex = 14 + Me.chkThursday.Text = "Donnerstag" + Me.chkThursday.UseVisualStyleBackColor = True + ' + 'chkWednesday + ' + Me.chkWednesday.AutoSize = True + Me.chkWednesday.Location = New System.Drawing.Point(250, 25) + Me.chkWednesday.Name = "chkWednesday" + Me.chkWednesday.Size = New System.Drawing.Size(69, 17) + Me.chkWednesday.TabIndex = 13 + Me.chkWednesday.Text = "Mittwoch" + Me.chkWednesday.UseVisualStyleBackColor = True + ' + 'chkTuesday + ' + Me.chkTuesday.AutoSize = True + Me.chkTuesday.Location = New System.Drawing.Point(150, 25) + Me.chkTuesday.Name = "chkTuesday" + Me.chkTuesday.Size = New System.Drawing.Size(68, 17) + Me.chkTuesday.TabIndex = 12 + Me.chkTuesday.Text = "Dienstag" + Me.chkTuesday.UseVisualStyleBackColor = True + ' + 'chkMonday + ' + Me.chkMonday.AutoSize = True + Me.chkMonday.Location = New System.Drawing.Point(50, 25) + Me.chkMonday.Name = "chkMonday" + Me.chkMonday.Size = New System.Drawing.Size(62, 17) + Me.chkMonday.TabIndex = 11 + Me.chkMonday.Text = "Montag" + Me.chkMonday.UseVisualStyleBackColor = True + ' + 'dtpEndTime + ' + Me.dtpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Time + Me.dtpEndTime.Location = New System.Drawing.Point(557, 245) + Me.dtpEndTime.Name = "dtpEndTime" + Me.dtpEndTime.ShowCheckBox = True + Me.dtpEndTime.ShowUpDown = True + Me.dtpEndTime.Size = New System.Drawing.Size(200, 20) + Me.dtpEndTime.TabIndex = 9 + ' + 'lblEndTime + ' + Me.lblEndTime.AutoSize = True + Me.lblEndTime.Location = New System.Drawing.Point(502, 248) + Me.lblEndTime.Name = "lblEndTime" + Me.lblEndTime.Size = New System.Drawing.Size(45, 13) + Me.lblEndTime.TabIndex = 14 + Me.lblEndTime.Text = "Endzeit:" + ' + 'dtpStartTime + ' + Me.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Time + Me.dtpStartTime.Location = New System.Drawing.Point(557, 204) + Me.dtpStartTime.Name = "dtpStartTime" + Me.dtpStartTime.ShowCheckBox = True + Me.dtpStartTime.ShowUpDown = True + Me.dtpStartTime.Size = New System.Drawing.Size(200, 20) + Me.dtpStartTime.TabIndex = 8 + ' + 'lblStartTime + ' + Me.lblStartTime.AutoSize = True + Me.lblStartTime.Location = New System.Drawing.Point(502, 205) + Me.lblStartTime.Name = "lblStartTime" + Me.lblStartTime.Size = New System.Drawing.Size(48, 13) + Me.lblStartTime.TabIndex = 12 + Me.lblStartTime.Text = "Startzeit:" + ' + 'dtpEndDate + ' + Me.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.dtpEndDate.Location = New System.Drawing.Point(130, 245) + Me.dtpEndDate.Name = "dtpEndDate" + Me.dtpEndDate.ShowCheckBox = True + Me.dtpEndDate.Size = New System.Drawing.Size(201, 20) + Me.dtpEndDate.TabIndex = 7 + ' + 'lblEndDate + ' + Me.lblEndDate.AutoSize = True + Me.lblEndDate.Location = New System.Drawing.Point(15, 248) + Me.lblEndDate.Name = "lblEndDate" + Me.lblEndDate.Size = New System.Drawing.Size(104, 13) + Me.lblEndDate.TabIndex = 10 + Me.lblEndDate.Text = "Enddatum (optional):" + ' + 'dtpStartDate + ' + Me.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] + Me.dtpStartDate.Location = New System.Drawing.Point(131, 205) + Me.dtpStartDate.Name = "dtpStartDate" + Me.dtpStartDate.ShowCheckBox = True + Me.dtpStartDate.Size = New System.Drawing.Size(200, 20) + Me.dtpStartDate.TabIndex = 6 + ' + 'lblStartDate + ' + Me.lblStartDate.AutoSize = True + Me.lblStartDate.Location = New System.Drawing.Point(17, 205) + Me.lblStartDate.Name = "lblStartDate" + Me.lblStartDate.Size = New System.Drawing.Size(107, 13) + Me.lblStartDate.TabIndex = 8 + Me.lblStartDate.Text = "Startdatum (optional):" + ' + 'txtZeile3 + ' + Me.txtZeile3.Location = New System.Drawing.Point(100, 120) + Me.txtZeile3.Name = "txtZeile3" + Me.txtZeile3.Size = New System.Drawing.Size(871, 20) + Me.txtZeile3.TabIndex = 5 + ' + 'lblZeile3 + ' + Me.lblZeile3.AutoSize = True + Me.lblZeile3.Location = New System.Drawing.Point(42, 123) + Me.lblZeile3.Name = "lblZeile3" + Me.lblZeile3.Size = New System.Drawing.Size(42, 13) + Me.lblZeile3.TabIndex = 6 + Me.lblZeile3.Text = "Zeile 3:" + ' + 'txtZeile2 + ' + Me.txtZeile2.Location = New System.Drawing.Point(100, 90) + Me.txtZeile2.Name = "txtZeile2" + Me.txtZeile2.Size = New System.Drawing.Size(871, 20) + Me.txtZeile2.TabIndex = 4 + ' + 'lblZeile2 + ' + Me.lblZeile2.AutoSize = True + Me.lblZeile2.Location = New System.Drawing.Point(42, 93) + Me.lblZeile2.Name = "lblZeile2" + Me.lblZeile2.Size = New System.Drawing.Size(42, 13) + Me.lblZeile2.TabIndex = 4 + Me.lblZeile2.Text = "Zeile 2:" + ' + 'txtZeile1 + ' + Me.txtZeile1.Location = New System.Drawing.Point(100, 60) + Me.txtZeile1.Name = "txtZeile1" + Me.txtZeile1.Size = New System.Drawing.Size(871, 20) + Me.txtZeile1.TabIndex = 3 + ' + 'lblZeile1 + ' + Me.lblZeile1.AutoSize = True + Me.lblZeile1.Location = New System.Drawing.Point(42, 63) + Me.lblZeile1.Name = "lblZeile1" + Me.lblZeile1.Size = New System.Drawing.Size(42, 13) + Me.lblZeile1.TabIndex = 2 + Me.lblZeile1.Text = "Zeile 1:" + ' + 'cmbTvTextBezeichnungAuswahl + ' + Me.cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbTvTextBezeichnungAuswahl.FormattingEnabled = True + Me.cmbTvTextBezeichnungAuswahl.Location = New System.Drawing.Point(100, 30) + Me.cmbTvTextBezeichnungAuswahl.Name = "cmbTvTextBezeichnungAuswahl" + Me.cmbTvTextBezeichnungAuswahl.Size = New System.Drawing.Size(177, 21) + Me.cmbTvTextBezeichnungAuswahl.TabIndex = 2 + ' + 'lblBezeichnung + ' + Me.lblBezeichnung.AutoSize = True + Me.lblBezeichnung.Location = New System.Drawing.Point(17, 33) + Me.lblBezeichnung.Name = "lblBezeichnung" + Me.lblBezeichnung.Size = New System.Drawing.Size(72, 13) + Me.lblBezeichnung.TabIndex = 0 + Me.lblBezeichnung.Text = "Bezeichnung:" + ' + 'lblPosition + ' + Me.lblPosition.AutoSize = True + Me.lblPosition.Location = New System.Drawing.Point(42, 156) + Me.lblPosition.Name = "lblPosition" + Me.lblPosition.Size = New System.Drawing.Size(47, 13) + Me.lblPosition.TabIndex = 21 + Me.lblPosition.Text = "Position:" + ' + 'cmbPosition + ' + Me.cmbPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbPosition.FormattingEnabled = True + Me.cmbPosition.Items.AddRange(New Object() {"Top", "Middle", "Bottom"}) + Me.cmbPosition.Location = New System.Drawing.Point(100, 152) + Me.cmbPosition.Name = "cmbPosition" + Me.cmbPosition.Size = New System.Drawing.Size(177, 21) + Me.cmbPosition.TabIndex = 22 + ' + 'btnSpeichern + ' + Me.btnSpeichern.Location = New System.Drawing.Point(755, 708) + Me.btnSpeichern.Name = "btnSpeichern" + Me.btnSpeichern.Size = New System.Drawing.Size(75, 30) + Me.btnSpeichern.TabIndex = 5 + Me.btnSpeichern.Text = "Speichern" + Me.btnSpeichern.UseVisualStyleBackColor = True + ' + 'btnLoeschen + ' + Me.btnLoeschen.Location = New System.Drawing.Point(836, 708) + Me.btnLoeschen.Name = "btnLoeschen" + Me.btnLoeschen.Size = New System.Drawing.Size(75, 30) + Me.btnLoeschen.TabIndex = 6 + Me.btnLoeschen.Text = "Löschen" + Me.btnLoeschen.UseVisualStyleBackColor = True + ' + 'btnAbbrechen + ' + Me.btnAbbrechen.Location = New System.Drawing.Point(917, 708) + Me.btnAbbrechen.Name = "btnAbbrechen" + Me.btnAbbrechen.Size = New System.Drawing.Size(75, 30) + Me.btnAbbrechen.TabIndex = 7 + Me.btnAbbrechen.Text = "Abbrechen" + Me.btnAbbrechen.UseVisualStyleBackColor = True + ' + 'chkShowInactive + ' + Me.chkShowInactive.AutoSize = True + Me.chkShowInactive.Location = New System.Drawing.Point(230, 27) + Me.chkShowInactive.Name = "chkShowInactive" + Me.chkShowInactive.Size = New System.Drawing.Size(110, 17) + Me.chkShowInactive.TabIndex = 1 + Me.chkShowInactive.Text = "Inaktive anzeigen" + Me.chkShowInactive.UseVisualStyleBackColor = True + ' + 'frmEintragTvNew + ' + Me.ClientSize = New System.Drawing.Size(1004, 750) + Me.Controls.Add(Me.chkShowInactive) + Me.Controls.Add(Me.btnAbbrechen) + Me.Controls.Add(Me.btnLoeschen) + Me.Controls.Add(Me.btnSpeichern) + Me.Controls.Add(Me.grpEingabe) + Me.Controls.Add(Me.dgvAVISOTV) + Me.Controls.Add(Me.lblStandort) + Me.Controls.Add(Me.cbxStandort) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.MaximizeBox = False + Me.Name = "frmEintragTvNew" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Einstellungen für TV-Anzeige" + CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).EndInit() + Me.grpEingabe.ResumeLayout(False) + Me.grpEingabe.PerformLayout() + Me.grpWochentage.ResumeLayout(False) + Me.grpWochentage.PerformLayout() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents cbxStandort As ComboBox + Friend WithEvents lblStandort As Label + Friend WithEvents dgvAVISOTV As DataGridView + Friend WithEvents grpEingabe As GroupBox + Friend WithEvents lblNeueTvTextBezeichnung As Label + Friend WithEvents txtNeueTvTextBezeichnung As TextBox + Friend WithEvents chkIsActive As CheckBox + Friend WithEvents chkIsRecurring As CheckBox + Friend WithEvents grpWochentage As GroupBox + Friend WithEvents chkSunday As CheckBox + Friend WithEvents chkSaturday As CheckBox + Friend WithEvents chkFriday As CheckBox + Friend WithEvents chkThursday As CheckBox + Friend WithEvents chkWednesday As CheckBox + Friend WithEvents chkTuesday As CheckBox + Friend WithEvents chkMonday As CheckBox + Friend WithEvents dtpEndTime As DateTimePicker + Friend WithEvents lblEndTime As Label + Friend WithEvents dtpStartTime As DateTimePicker + Friend WithEvents lblStartTime As Label + Friend WithEvents dtpEndDate As DateTimePicker + Friend WithEvents lblEndDate As Label + Friend WithEvents dtpStartDate As DateTimePicker + Friend WithEvents lblStartDate As Label + Friend WithEvents txtZeile3 As TextBox + Friend WithEvents lblZeile3 As Label + Friend WithEvents txtZeile2 As TextBox + Friend WithEvents lblZeile2 As Label + Friend WithEvents txtZeile1 As TextBox + Friend WithEvents lblZeile1 As Label + Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox + Friend WithEvents lblBezeichnung As Label + Friend WithEvents lblPosition As Label + Friend WithEvents cmbPosition As ComboBox + Friend WithEvents btnSpeichern As Button + Friend WithEvents btnLoeschen As Button + Friend WithEvents btnAbbrechen As Button + Friend WithEvents chkShowInactive As CheckBox + +End Class diff --git a/Aviso/frmEintragTvNew.resx b/Aviso/frmEintragTvNew.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Aviso/frmEintragTvNew.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb new file mode 100644 index 0000000..ea9d2c8 --- /dev/null +++ b/Aviso/frmEintragTvNew.vb @@ -0,0 +1,542 @@ +Imports System.Data.SqlClient +Imports VERAG_PROG_ALLGEMEIN + +Public Class frmEintragTvNew + + Dim AvisoTvNewDAL As New cAvisoTvNewDAL() + Dim myAvisoTvNew As cAvisoTvNew + Dim hatAenderung As Boolean = False + Dim Neuanlage As Boolean = False + Dim list As New List(Of cAvisoTvNew)() + Dim listAll As New List(Of cAvisoTvNew)() + + Private isInitializing As Boolean = False + + Public Sub New() + InitializeComponent() + Icon = cMeineFunktionenAVISO.GetProgrammIcon() + End Sub + + Private Sub frmEintragTvNew_Load(sender As Object, e As EventArgs) Handles MyBase.Load + LadeStandorte() + LadeTvTextBezeichnungen() + LadenAlleEintraege() + grpWochentage.Enabled = chkIsRecurring.Checked + dgvAVISOTV.SelectionMode = DataGridViewSelectionMode.FullRowSelect + dgvAVISOTV.MultiSelect = False + dtpStartDate.ShowCheckBox = True + dtpEndDate.ShowCheckBox = True + dtpStartTime.ShowCheckBox = True + dtpEndTime.ShowCheckBox = True + chkIsActive.Checked = True + End Sub + + Private Sub LadenAlleEintraege() + Try + AvisoTvNewDAL.LesenAlleAvisoTvNew(listAll) + Catch ex As Exception + MessageBox.Show("Fehler beim Laden aller Einträge: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + Private Sub LadeStandorte() + Dim standorte As New List(Of String)() + + Try + Dim conn As SqlConnection = cDatenbankAVISO.GetNewOpenConnectionWithoutError() + If conn Is Nothing Then + MessageBox.Show("Die Datenbankverbindung konnte nicht hergestellt werden.", "Verbindungsfehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End If + + Dim sql As String = "SELECT DISTINCT Standort FROM StandorteTV ORDER BY Standort" + Using cmd As New SqlCommand(sql, conn) + Using dr As SqlDataReader = cmd.ExecuteReader() + While dr.Read() + Dim standort As String = Convert.ToString(dr("Standort")) + standorte.Add(standort) + End While + End Using + End Using + Catch ex As SqlException + MessageBox.Show("SQL Fehler beim Laden der Standorte: " & ex.Message, "SQL Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Catch ex As Exception + MessageBox.Show("Allgemeiner Fehler beim Laden der Standorte: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + + cbxStandort.Items.Clear() + cbxStandort.Items.AddRange(standorte.ToArray()) + If cbxStandort.Items.Count > 0 Then cbxStandort.SelectedIndex = 0 + End Sub + + Private Sub initdgv() + Try + RemoveHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + + Dim standort As String = cbxStandort.SelectedItem?.ToString() + Dim showInactive As Boolean = chkShowInactive.Checked + + Dim gefilterteListe As List(Of cAvisoTvNew) + If showInactive Then + gefilterteListe = list.Where(Function(x) x.Standort = standort).ToList() + Else + gefilterteListe = list.Where(Function(x) x.Standort = standort AndAlso x.IsActive).ToList() + End If + + dgvAVISOTV.DataSource = Nothing + dgvAVISOTV.Rows.Clear() + + If gefilterteListe.Count > 0 Then + dgvAVISOTV.DataSource = gefilterteListe + dgvAVISOTV.Columns("TvTextBezeichnungID").HeaderText = "ID" + dgvAVISOTV.Columns("TvTextBezeichnung").HeaderText = "Bezeichnung" + dgvAVISOTV.Columns("FixeZeile1").HeaderText = "Zeile 1" + dgvAVISOTV.Columns("FixeZeile2").HeaderText = "Zeile 2" + dgvAVISOTV.Columns("FixeZeile3").HeaderText = "Zeile 3" + dgvAVISOTV.Columns("Standort").Visible = False + dgvAVISOTV.Columns("Art").Visible = False + dgvAVISOTV.Columns("StartDate").HeaderText = "Startdatum" + dgvAVISOTV.Columns("EndDate").HeaderText = "Enddatum" + dgvAVISOTV.Columns("StartTime").HeaderText = "Startzeit" + dgvAVISOTV.Columns("EndTime").HeaderText = "Endzeit" + dgvAVISOTV.Columns("IsRecurring").HeaderText = "Wiederholen" + dgvAVISOTV.Columns("IsActive").HeaderText = "Aktiv" + dgvAVISOTV.Columns("IsMonday").Visible = False + dgvAVISOTV.Columns("IsTuesday").Visible = False + dgvAVISOTV.Columns("IsWednesday").Visible = False + dgvAVISOTV.Columns("IsThursday").Visible = False + dgvAVISOTV.Columns("IsFriday").Visible = False + dgvAVISOTV.Columns("IsSaturday").Visible = False + dgvAVISOTV.Columns("IsSunday").Visible = False + + dgvAVISOTV.AutoResizeColumns() + + AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + + If dgvAVISOTV.Rows.Count > 0 Then + dgvAVISOTV.Rows(0).Selected = True + dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) + dgvAVISOTV_SelectionChanged(Nothing, Nothing) + End If + Else + AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + ClearFields() + myAvisoTvNew = Nothing + End If + + Neuanlage = False + hatAenderung = False + + Catch ex As Exception + MessageBox.Show("Fehler beim Laden der Daten: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + Private Sub cbxStandort_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxStandort.SelectedValueChanged + If list IsNot Nothing Then list.Clear() + + Dim selectedStandort As String = If(cbxStandort.SelectedItem IsNot Nothing, cbxStandort.SelectedItem.ToString(), "") + + Try + AvisoTvNewDAL.LesenAvisoTvNew(0, "", selectedStandort, list) + Catch ex As Exception + MessageBox.Show("Fehler beim Lesen der Einträge: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End Try + + LadeTvTextBezeichnungen() + initdgv() + End Sub + + Private Sub btnNeu_Click(sender As Object, e As EventArgs) + Dim standort As String = cbxStandort.SelectedItem?.ToString() + If String.IsNullOrEmpty(standort) Then + MessageBox.Show("Bitte wählen Sie einen Standort aus.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Warning) + Return + End If + + Dim standortID As Integer = AvisoTvNewDAL.GetStandortID(standort) + If standortID = 0 Then + MessageBox.Show("Ungültiger Standort ausgewählt.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End If + + myAvisoTvNew = New cAvisoTvNew() With { + .StandortID = standortID, + .Standort = standort, + .Art = "", + .IsActive = True + } + + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + txtNeueTvTextBezeichnung.Text = "" + + Neuanlage = True + hatAenderung = False + Me.Text = "Neuen Eintrag hinzufügen" + End Sub + + Public Class ComboBoxItem + Public Property ID As Integer + Public Property DisplayText As String + + Public Overrides Function ToString() As String + Return DisplayText + End Function + End Class + + Private Sub LadeTvTextBezeichnungen() + isInitializing = True + Dim bezeichnungen As New List(Of cTvTextBezeichnung)() + + Try + bezeichnungen = AvisoTvNewDAL.LadenAlleTvTextBezeichnungen() + Catch ex As Exception + MessageBox.Show("Fehler beim Laden der TvTextBezeichnungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + isInitializing = False + Return + End Try + + Dim items As New List(Of ComboBoxItem)() + + For Each bezeichnung In bezeichnungen + items.Add(New ComboBoxItem() With { + .ID = bezeichnung.TvTextBezeichnungID, + .DisplayText = bezeichnung.TvTextBezeichnung + }) + Next + + cmbTvTextBezeichnungAuswahl.DataSource = items + cmbTvTextBezeichnungAuswahl.DisplayMember = "DisplayText" + cmbTvTextBezeichnungAuswahl.ValueMember = "ID" + cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + cmbPosition.SelectedIndex = -1 + isInitializing = False + + Debug.WriteLine("TvTextBezeichnungen geladen:") + For Each item In items + Debug.WriteLine($"ID: {item.ID}, Text: {item.DisplayText}") + Next + End Sub + + Private Sub cmbTvTextBezeichnungAuswahl_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTvTextBezeichnungAuswahl.SelectedIndexChanged + If isInitializing Then + Return + End If + + If cmbTvTextBezeichnungAuswahl.SelectedValue Is Nothing OrElse cmbTvTextBezeichnungAuswahl.SelectedValue Is DBNull.Value Then + Return + End If + + Try + Dim selectedTvTextBezeichnungID As Integer + Try + selectedTvTextBezeichnungID = Convert.ToInt32(cmbTvTextBezeichnungAuswahl.SelectedValue) + Debug.WriteLine("Selected TvTextBezeichnungID: " & selectedTvTextBezeichnungID) + Catch ex As Exception + MessageBox.Show("Ungültiger Wert für TvTextBezeichnungID: " & ex.Message, "Konvertierungsfehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End Try + + If listAll Is Nothing OrElse Not listAll.Any() Then + MessageBox.Show("Die Liste aller AvisoEinträge ist nicht geladen oder leer.", "Datenfehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End If + + Dim selectedAviso As cAvisoTvNew = listAll.FirstOrDefault(Function(x) x.TvTextBezeichnungID = selectedTvTextBezeichnungID AndAlso x.IsActive) + + Dim currentStandort As String = cbxStandort.SelectedItem?.ToString() + Dim currentStandortID As Integer = AvisoTvNewDAL.GetStandortID(currentStandort) + + If selectedAviso IsNot Nothing Then + Debug.WriteLine("Gefundenes Aviso: TVID = " & selectedAviso.TVID) + myAvisoTvNew = selectedAviso + Neuanlage = False + FillFieldsFromAviso(selectedAviso) + Me.Text = "Eintrag bearbeiten" + txtNeueTvTextBezeichnung.Text = "" + Else + Debug.WriteLine("Kein bestehender Eintrag gefunden. Neuer Eintrag wird erstellt.") + myAvisoTvNew = New cAvisoTvNew() With { + .IsActive = True, + .StandortID = currentStandortID, + .Standort = currentStandort + } + Neuanlage = True + Me.Text = "Neuen Eintrag hinzufügen" + End If + Catch ex As InvalidCastException + MessageBox.Show("Fehler beim Konvertieren der TvTextBezeichnungID: " & ex.Message, "Konvertierungsfehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Catch ex As Exception + MessageBox.Show("Ein unerwarteter Fehler ist aufgetreten: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + Private Sub txtNeueTvTextBezeichnung_TextChanged(sender As Object, e As EventArgs) Handles txtNeueTvTextBezeichnung.TextChanged + If Not String.IsNullOrWhiteSpace(txtNeueTvTextBezeichnung.Text) Then + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + myAvisoTvNew = New cAvisoTvNew() With { + .TvTextBezeichnung = txtNeueTvTextBezeichnung.Text.Trim(), + .IsActive = True + } + Neuanlage = True + Me.Text = "Neuen Eintrag hinzufügen" + End If + End Sub + + Private Sub FillFieldsFromAviso(ByVal aviso As cAvisoTvNew) + cmbTvTextBezeichnungAuswahl.SelectedValue = aviso.TvTextBezeichnungID + If Not String.IsNullOrEmpty(aviso.Position) Then + cmbPosition.SelectedItem = aviso.Position + Else + cmbPosition.SelectedIndex = -1 + End If + + txtNeueTvTextBezeichnung.Text = "" + + txtZeile1.Text = aviso.FixeZeile1 + txtZeile2.Text = aviso.FixeZeile2 + txtZeile3.Text = aviso.FixeZeile3 + + chkIsRecurring.Checked = aviso.IsRecurring.GetValueOrDefault(False) + + If aviso.StartDate.HasValue Then + dtpStartDate.Value = aviso.StartDate.Value + dtpStartDate.Checked = True + Else + dtpStartDate.Value = DateTime.Now + dtpStartDate.Checked = False + End If + + If aviso.EndDate.HasValue Then + dtpEndDate.Value = aviso.EndDate.Value + dtpEndDate.Checked = True + Else + dtpEndDate.Value = DateTime.Now + dtpEndDate.Checked = False + End If + + If aviso.StartTime.HasValue Then + dtpStartTime.Value = DateTime.Today.Add(aviso.StartTime.Value) + dtpStartTime.Checked = True + Else + dtpStartTime.Value = DateTime.Now + dtpStartTime.Checked = False + End If + + If aviso.EndTime.HasValue Then + dtpEndTime.Value = DateTime.Today.Add(aviso.EndTime.Value) + dtpEndTime.Checked = True + Else + dtpEndTime.Value = DateTime.Now + dtpEndTime.Checked = False + End If + + chkMonday.Checked = aviso.IsMonday.GetValueOrDefault(False) + chkTuesday.Checked = aviso.IsTuesday.GetValueOrDefault(False) + chkWednesday.Checked = aviso.IsWednesday.GetValueOrDefault(False) + chkThursday.Checked = aviso.IsThursday.GetValueOrDefault(False) + chkFriday.Checked = aviso.IsFriday.GetValueOrDefault(False) + chkSaturday.Checked = aviso.IsSaturday.GetValueOrDefault(False) + chkSunday.Checked = aviso.IsSunday.GetValueOrDefault(False) + + chkIsActive.Checked = aviso.IsActive + + grpWochentage.Enabled = chkIsRecurring.Checked + End Sub + + Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click + Dim verwendeteTvTextBezeichnung As String = "" + Dim isNeueTvTextBezeichnung As Boolean = False + Dim currentStandort As String = cbxStandort.SelectedItem?.ToString() + Dim currentStandortID As Integer = 0 + + If Not String.IsNullOrEmpty(currentStandort) Then + currentStandortID = AvisoTvNewDAL.GetStandortID(currentStandort) + End If + + If currentStandortID = 0 Then + MessageBox.Show("Ungültiger Standort ausgewählt.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End If + + Dim selectedTvTextBezeichnungID As Integer = 0 + + If cmbTvTextBezeichnungAuswahl.SelectedIndex >= 0 AndAlso String.IsNullOrWhiteSpace(txtNeueTvTextBezeichnung.Text) Then + verwendeteTvTextBezeichnung = cmbTvTextBezeichnungAuswahl.Text + selectedTvTextBezeichnungID = Convert.ToInt32(cmbTvTextBezeichnungAuswahl.SelectedValue) + ElseIf Not String.IsNullOrWhiteSpace(txtNeueTvTextBezeichnung.Text) Then + verwendeteTvTextBezeichnung = txtNeueTvTextBezeichnung.Text.Trim() + isNeueTvTextBezeichnung = True + Else + MessageBox.Show("Bitte wählen Sie eine TvTextBezeichnung aus oder geben Sie eine neue TvTextBezeichnung ein.", "Eingabefehler", MessageBoxButtons.OK, MessageBoxIcon.Warning) + cmbTvTextBezeichnungAuswahl.Focus() + Exit Sub + End If + + Try + myAvisoTvNew.TvTextBezeichnung = verwendeteTvTextBezeichnung + myAvisoTvNew.StandortID = currentStandortID + If cmbPosition.SelectedIndex >= 0 Then + myAvisoTvNew.Position = cmbPosition.SelectedItem.ToString() + Else + myAvisoTvNew.Position = Nothing + End If + If isNeueTvTextBezeichnung Then + If AvisoTvNewDAL.IstTvTextBezeichnungVorhanden(myAvisoTvNew.TvTextBezeichnung) Then + MessageBox.Show("Die TvTextBezeichnung ist vorhanden. Bitte wählen Sie eine eindeutige TvTextBezeichnung.", "Eingabefehler", MessageBoxButtons.OK, MessageBoxIcon.Warning) + txtNeueTvTextBezeichnung.Focus() + Exit Sub + End If + Else + myAvisoTvNew.TvTextBezeichnungID = selectedTvTextBezeichnungID + End If + + myAvisoTvNew.FixeZeile1 = If(String.IsNullOrWhiteSpace(txtZeile1.Text), Nothing, txtZeile1.Text.Trim()) + myAvisoTvNew.FixeZeile2 = If(String.IsNullOrWhiteSpace(txtZeile2.Text), Nothing, txtZeile2.Text.Trim()) + myAvisoTvNew.FixeZeile3 = If(String.IsNullOrWhiteSpace(txtZeile3.Text), Nothing, txtZeile3.Text.Trim()) + + myAvisoTvNew.IsRecurring = chkIsRecurring.Checked + + myAvisoTvNew.StartDate = If(dtpStartDate.Checked, CType(dtpStartDate.Value.Date, Date?), Nothing) + myAvisoTvNew.EndDate = If(dtpEndDate.Checked, CType(dtpEndDate.Value.Date, Date?), Nothing) + + myAvisoTvNew.StartTime = If(dtpStartTime.Checked, CType(dtpStartTime.Value.TimeOfDay, TimeSpan?), Nothing) + myAvisoTvNew.EndTime = If(dtpEndTime.Checked, CType(dtpEndTime.Value.TimeOfDay, TimeSpan?), Nothing) + + myAvisoTvNew.IsMonday = chkMonday.Checked + myAvisoTvNew.IsTuesday = chkTuesday.Checked + myAvisoTvNew.IsWednesday = chkWednesday.Checked + myAvisoTvNew.IsThursday = chkThursday.Checked + myAvisoTvNew.IsFriday = chkFriday.Checked + myAvisoTvNew.IsSaturday = chkSaturday.Checked + myAvisoTvNew.IsSunday = chkSunday.Checked + + myAvisoTvNew.IsActive = chkIsActive.Checked + + If Neuanlage Then + myAvisoTvNew.Standort = cbxStandort.SelectedItem?.ToString() + If String.IsNullOrEmpty(myAvisoTvNew.Standort) Then + MessageBox.Show("Bitte wählen Sie einen Standort aus.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Warning) + Return + End If + End If + + Debug.WriteLine($"Speichern: TVID = {myAvisoTvNew.TVID}, TvTextBezeichnungID = {myAvisoTvNew.TvTextBezeichnungID}, StandortID = {myAvisoTvNew.StandortID}") + + AvisoTvNewDAL.SpeichernAvisoTvNew(myAvisoTvNew) + + LadeTvTextBezeichnungen() + + list.Clear() + AvisoTvNewDAL.LesenAvisoTvNew(0, "", currentStandort, list) + + initdgv() + hatAenderung = False + + If isNeueTvTextBezeichnung Then + MessageBox.Show("Die neue TvTextBezeichnung wurde erfolgreich gespeichert.", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) + cmbTvTextBezeichnungAuswahl.SelectedValue = myAvisoTvNew.TvTextBezeichnungID + txtNeueTvTextBezeichnung.Text = "" + Else + MessageBox.Show("Die Änderungen wurden erfolgreich gespeichert.", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) + End If + + Catch ex As Exception + MessageBox.Show("Fehler beim Speichern der Daten: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + Private Sub btnLoeschen_Click(sender As Object, e As EventArgs) Handles btnLoeschen.Click + If myAvisoTvNew Is Nothing OrElse myAvisoTvNew.TVID = 0 Then + MessageBox.Show("Bitte wählen Sie einen Eintrag zum Deaktivieren aus.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information) + Return + End If + + Dim antwort As DialogResult = MessageBox.Show("Möchten Sie den ausgewählten Eintrag wirklich deaktivieren?", "Deaktivieren bestätigen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) + If antwort = DialogResult.Yes Then + Try + AvisoTvNewDAL.SetzeAufInaktiv(myAvisoTvNew.TVID) + list.Clear() + AvisoTvNewDAL.LesenAvisoTvNew(0, "", cbxStandort.SelectedItem?.ToString(), list) + initdgv() + ClearFields() + myAvisoTvNew = Nothing + Neuanlage = False + hatAenderung = False + MessageBox.Show("Der Eintrag wurde erfolgreich deaktiviert.", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) + Catch ex As Exception + MessageBox.Show("Fehler beim Deaktivieren des Eintrags: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End If + End Sub + + Private Sub dgvAVISOTV_SelectionChanged(sender As Object, e As EventArgs) Handles dgvAVISOTV.SelectionChanged + If dgvAVISOTV.CurrentRow IsNot Nothing AndAlso dgvAVISOTV.CurrentRow.DataBoundItem IsNot Nothing Then + Dim selectedAviso As cAvisoTvNew = CType(dgvAVISOTV.CurrentRow.DataBoundItem, cAvisoTvNew) + If selectedAviso IsNot Nothing Then + myAvisoTvNew = selectedAviso + FillFieldsFromAviso(selectedAviso) + Neuanlage = False + hatAenderung = False + Me.Text = "Eintrag bearbeiten" + End If + End If + End Sub + + Private Sub btnAbbrechen_Click(sender As Object, e As EventArgs) Handles btnAbbrechen.Click + If hatAenderung Then + Dim antwort As DialogResult = MessageBox.Show("Es liegen ungespeicherte Änderungen vor. Möchten Sie das Fenster trotzdem schließen?", "Ungespeicherte Änderungen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) + If antwort = DialogResult.No Then Exit Sub + End If + Me.Close() + End Sub + + Private Sub txt_TextChanged(sender As Object, e As EventArgs) Handles txtZeile1.TextChanged, txtZeile2.TextChanged, txtZeile3.TextChanged, dtpStartDate.ValueChanged, dtpEndDate.ValueChanged, dtpStartTime.ValueChanged, dtpEndTime.ValueChanged, chkIsRecurring.CheckedChanged, chkMonday.CheckedChanged, chkTuesday.CheckedChanged, chkWednesday.CheckedChanged, chkThursday.CheckedChanged, chkFriday.CheckedChanged, chkSaturday.CheckedChanged, chkSunday.CheckedChanged, chkIsActive.CheckedChanged, cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, txtNeueTvTextBezeichnung.TextChanged + hatAenderung = True + End Sub + + Private Sub frmEintragTvNew_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing + If hatAenderung Then + Dim antwort As DialogResult = MessageBox.Show("Es liegen ungespeicherte Änderungen vor. Möchten Sie das Fenster trotzdem schließen?", "Ungespeicherte Änderungen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) + If antwort = DialogResult.No Then e.Cancel = True + End If + End Sub + + Private Sub chkIsRecurring_CheckedChanged(sender As Object, e As EventArgs) Handles chkIsRecurring.CheckedChanged + grpWochentage.Enabled = chkIsRecurring.Checked + End Sub + + Private Sub ClearFields() + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + cmbPosition.SelectedIndex = -1 + txtNeueTvTextBezeichnung.Text = "" + txtZeile1.Text = "" + txtZeile2.Text = "" + txtZeile3.Text = "" + dtpStartDate.Value = DateTime.Now + dtpStartDate.Checked = False + dtpEndDate.Value = DateTime.Now + dtpEndDate.Checked = False + dtpStartTime.Value = DateTime.Now + dtpStartTime.Checked = False + dtpEndTime.Value = DateTime.Now + dtpEndTime.Checked = False + chkIsRecurring.Checked = False + chkMonday.Checked = False + chkTuesday.Checked = False + chkWednesday.Checked = False + chkThursday.Checked = False + chkFriday.Checked = False + chkSaturday.Checked = False + chkSunday.Checked = False + chkIsActive.Checked = True + grpWochentage.Enabled = False + End Sub + + Private Sub chkShowInactive_CheckedChanged_1(sender As Object, e As EventArgs) Handles chkShowInactive.CheckedChanged + initdgv() + End Sub + +End Class diff --git a/Aviso/frmHauptfenster.Designer.vb b/Aviso/frmHauptfenster.Designer.vb index 3647d5e..46c17d2 100644 --- a/Aviso/frmHauptfenster.Designer.vb +++ b/Aviso/frmHauptfenster.Designer.vb @@ -239,6 +239,7 @@ Partial Class frmHauptfenster Me.Label6 = New System.Windows.Forms.Label() Me.txtSuche = New System.Windows.Forms.TextBox() Me.Top = New System.Windows.Forms.Panel() + Me.Button1 = New System.Windows.Forms.Button() Me.lblUsrname = New System.Windows.Forms.Label() Me.lblFimaAviso = New System.Windows.Forms.Label() Me.Button11 = New System.Windows.Forms.Button() @@ -291,6 +292,7 @@ Partial Class frmHauptfenster Me.cntxtAtilla = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.ToolStripMenuItem17 = New System.Windows.Forms.ToolStripMenuItem() Me.SplitContainer3 = New System.Windows.Forms.SplitContainer() + Me.UsrCntlBenachrichtigungen1 = New AVISO.usrCntlBenachrichtigungen() Me.pnl = New System.Windows.Forms.Panel() Me.Button10 = New System.Windows.Forms.Button() Me.gridMyAviso = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) @@ -398,8 +400,7 @@ Partial Class frmHauptfenster Me.ZertifikateToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.HomepageToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.UsrCntlTestsystem1 = New VERAG_PROG_ALLGEMEIN.usrCntlTestsystem() - Me.Button1 = New System.Windows.Forms.Button() - Me.UsrCntlBenachrichtigungen1 = New AVISO.usrCntlBenachrichtigungen() + Me.TVEditorNewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.pnlDetailsRechts.SuspendLayout() @@ -599,7 +600,7 @@ Partial Class frmHauptfenster ' 'AvisoTVToolStripMenuItem ' - Me.AvisoTVToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.InfoTextÄndernToolStripMenuItem}) + Me.AvisoTVToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.InfoTextÄndernToolStripMenuItem, Me.TVEditorNewToolStripMenuItem}) Me.AvisoTVToolStripMenuItem.Name = "AvisoTVToolStripMenuItem" Me.AvisoTVToolStripMenuItem.Size = New System.Drawing.Size(213, 22) Me.AvisoTVToolStripMenuItem.Text = "AvisoTV" @@ -608,7 +609,7 @@ Partial Class frmHauptfenster 'InfoTextÄndernToolStripMenuItem ' Me.InfoTextÄndernToolStripMenuItem.Name = "InfoTextÄndernToolStripMenuItem" - Me.InfoTextÄndernToolStripMenuItem.Size = New System.Drawing.Size(156, 22) + Me.InfoTextÄndernToolStripMenuItem.Size = New System.Drawing.Size(180, 22) Me.InfoTextÄndernToolStripMenuItem.Text = "InfoText ändern" ' 'SecretAvisoToolStripMenuItem @@ -1800,6 +1801,16 @@ Partial Class frmHauptfenster Me.Top.Size = New System.Drawing.Size(1372, 52) Me.Top.TabIndex = 6 ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(1028, 7) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 87 + Me.Button1.Text = "Button1" + Me.Button1.UseVisualStyleBackColor = True + Me.Button1.Visible = False + ' 'lblUsrname ' Me.lblUsrname.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -2496,6 +2507,15 @@ Partial Class frmHauptfenster Me.SplitContainer3.SplitterDistance = 158 Me.SplitContainer3.TabIndex = 3 ' + 'UsrCntlBenachrichtigungen1 + ' + Me.UsrCntlBenachrichtigungen1.Dock = System.Windows.Forms.DockStyle.Fill + Me.UsrCntlBenachrichtigungen1.Location = New System.Drawing.Point(0, 0) + Me.UsrCntlBenachrichtigungen1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) + Me.UsrCntlBenachrichtigungen1.Name = "UsrCntlBenachrichtigungen1" + Me.UsrCntlBenachrichtigungen1.Size = New System.Drawing.Size(158, 300) + Me.UsrCntlBenachrichtigungen1.TabIndex = 0 + ' 'pnl ' Me.pnl.Controls.Add(Me.Button10) @@ -3786,24 +3806,11 @@ Partial Class frmHauptfenster Me.UsrCntlTestsystem1.Size = New System.Drawing.Size(152, 28) Me.UsrCntlTestsystem1.TabIndex = 8 ' - 'Button1 + 'TVEditorNewToolStripMenuItem ' - Me.Button1.Location = New System.Drawing.Point(1028, 7) - Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(75, 23) - Me.Button1.TabIndex = 87 - Me.Button1.Text = "Button1" - Me.Button1.UseVisualStyleBackColor = True - Me.Button1.Visible = False - ' - 'UsrCntlBenachrichtigungen1 - ' - Me.UsrCntlBenachrichtigungen1.Dock = System.Windows.Forms.DockStyle.Fill - Me.UsrCntlBenachrichtigungen1.Location = New System.Drawing.Point(0, 0) - Me.UsrCntlBenachrichtigungen1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) - Me.UsrCntlBenachrichtigungen1.Name = "UsrCntlBenachrichtigungen1" - Me.UsrCntlBenachrichtigungen1.Size = New System.Drawing.Size(158, 300) - Me.UsrCntlBenachrichtigungen1.TabIndex = 0 + Me.TVEditorNewToolStripMenuItem.Name = "TVEditorNewToolStripMenuItem" + Me.TVEditorNewToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.TVEditorNewToolStripMenuItem.Text = "TVEditorNew" ' 'frmHauptfenster ' @@ -4245,4 +4252,5 @@ Partial Class frmHauptfenster Friend WithEvents SpireLizenzPrüfenToolStripMenuItem As ToolStripMenuItem Friend WithEvents DEAmbarToolStripMenuItem As ToolStripMenuItem Friend WithEvents Button1 As Button + Friend WithEvents TVEditorNewToolStripMenuItem As ToolStripMenuItem End Class diff --git a/Aviso/frmHauptfenster.vb b/Aviso/frmHauptfenster.vb index db32eef..89fda67 100644 --- a/Aviso/frmHauptfenster.vb +++ b/Aviso/frmHauptfenster.vb @@ -4806,6 +4806,10 @@ Public Class frmHauptfenster saveLukowaPDFsFromTherefore() End Sub + + Private Sub TVEditorNewToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TVEditorNewToolStripMenuItem.Click + frmEintragTvNew.ShowDialog(Me) + End Sub End Class Public Class AvisoStatusFunctions diff --git a/AvisoTV/packages.config b/AvisoTV/packages.config new file mode 100644 index 0000000..6725fde --- /dev/null +++ b/AvisoTV/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Gemeinsames/App.config b/Gemeinsames/App.config index a86c646..596ae86 100644 --- a/Gemeinsames/App.config +++ b/Gemeinsames/App.config @@ -1,6 +1,22 @@ - + - + + + + + + + + + + + + + + + + + diff --git a/Gemeinsames/packages.config b/Gemeinsames/packages.config new file mode 100644 index 0000000..6725fde --- /dev/null +++ b/Gemeinsames/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 94ad2234d1bf97770966b682e09f43cb97ea1eca Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Fri, 22 Nov 2024 09:45:47 +0100 Subject: [PATCH 3/7] Verag TV App --- Aviso/frmEintragTvNew.Designer.vb | 187 +++++++++++++++--- Aviso/frmEintragTvNew.vb | 312 ++++++++++++++++++++++++++---- 2 files changed, 427 insertions(+), 72 deletions(-) diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb index db735ae..4414fca 100644 --- a/Aviso/frmEintragTvNew.Designer.vb +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -15,6 +15,20 @@ Partial Class frmEintragTvNew Private components As System.ComponentModel.IContainer + ' Neue Komponenten für Textformatierung + Private WithEvents btnBold As Button + Private WithEvents btnItalic As Button + Private WithEvents btnUnderline As Button + Private WithEvents btnTextColor As Button + Private WithEvents btnBackColor As Button + Private WithEvents btnAlignLeft As Button + Private WithEvents btnAlignCenter As Button + Private WithEvents btnAlignRight As Button + Private WithEvents cmbFontFamily As ComboBox + Private WithEvents cmbFontSize As ComboBox + Private WithEvents colorDialogText As ColorDialog + Private WithEvents rtbZeile1 As RichTextBox ' Geänderte TextBox zu RichTextBox + Private Sub InitializeComponent() Me.cbxStandort = New System.Windows.Forms.ComboBox() @@ -45,16 +59,27 @@ Partial Class frmEintragTvNew Me.lblZeile3 = New System.Windows.Forms.Label() Me.txtZeile2 = New System.Windows.Forms.TextBox() Me.lblZeile2 = New System.Windows.Forms.Label() - Me.txtZeile1 = New System.Windows.Forms.TextBox() + Me.rtbZeile1 = New System.Windows.Forms.RichTextBox() Me.lblZeile1 = New System.Windows.Forms.Label() Me.cmbTvTextBezeichnungAuswahl = New System.Windows.Forms.ComboBox() Me.lblBezeichnung = New System.Windows.Forms.Label() Me.lblPosition = New System.Windows.Forms.Label() Me.cmbPosition = New System.Windows.Forms.ComboBox() + Me.btnBold = New System.Windows.Forms.Button() + Me.btnItalic = New System.Windows.Forms.Button() + Me.btnUnderline = New System.Windows.Forms.Button() + Me.btnTextColor = New System.Windows.Forms.Button() + Me.btnBackColor = New System.Windows.Forms.Button() + Me.btnAlignLeft = New System.Windows.Forms.Button() + Me.btnAlignCenter = New System.Windows.Forms.Button() + Me.btnAlignRight = New System.Windows.Forms.Button() + Me.cmbFontFamily = New System.Windows.Forms.ComboBox() + Me.cmbFontSize = New System.Windows.Forms.ComboBox() Me.btnSpeichern = New System.Windows.Forms.Button() Me.btnLoeschen = New System.Windows.Forms.Button() Me.btnAbbrechen = New System.Windows.Forms.Button() Me.chkShowInactive = New System.Windows.Forms.CheckBox() + Me.colorDialogText = New System.Windows.Forms.ColorDialog() CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpEingabe.SuspendLayout() Me.grpWochentage.SuspendLayout() @@ -88,7 +113,7 @@ Partial Class frmEintragTvNew Me.dgvAVISOTV.Name = "dgvAVISOTV" Me.dgvAVISOTV.ReadOnly = True Me.dgvAVISOTV.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvAVISOTV.Size = New System.Drawing.Size(977, 200) + Me.dgvAVISOTV.Size = New System.Drawing.Size(1300, 200) Me.dgvAVISOTV.TabIndex = 2 ' 'grpEingabe @@ -110,15 +135,25 @@ Partial Class frmEintragTvNew Me.grpEingabe.Controls.Add(Me.lblZeile3) Me.grpEingabe.Controls.Add(Me.txtZeile2) Me.grpEingabe.Controls.Add(Me.lblZeile2) - Me.grpEingabe.Controls.Add(Me.txtZeile1) + Me.grpEingabe.Controls.Add(Me.rtbZeile1) Me.grpEingabe.Controls.Add(Me.lblZeile1) Me.grpEingabe.Controls.Add(Me.cmbTvTextBezeichnungAuswahl) Me.grpEingabe.Controls.Add(Me.lblBezeichnung) Me.grpEingabe.Controls.Add(Me.lblPosition) Me.grpEingabe.Controls.Add(Me.cmbPosition) + Me.grpEingabe.Controls.Add(Me.btnBold) + Me.grpEingabe.Controls.Add(Me.btnItalic) + Me.grpEingabe.Controls.Add(Me.btnUnderline) + Me.grpEingabe.Controls.Add(Me.btnTextColor) + Me.grpEingabe.Controls.Add(Me.btnBackColor) + Me.grpEingabe.Controls.Add(Me.btnAlignLeft) + Me.grpEingabe.Controls.Add(Me.btnAlignCenter) + Me.grpEingabe.Controls.Add(Me.btnAlignRight) + Me.grpEingabe.Controls.Add(Me.cmbFontFamily) + Me.grpEingabe.Controls.Add(Me.cmbFontSize) Me.grpEingabe.Location = New System.Drawing.Point(15, 275) Me.grpEingabe.Name = "grpEingabe" - Me.grpEingabe.Size = New System.Drawing.Size(977, 427) + Me.grpEingabe.Size = New System.Drawing.Size(1300, 570) Me.grpEingabe.TabIndex = 3 Me.grpEingabe.TabStop = False Me.grpEingabe.Text = "Informationen eingeben" @@ -152,7 +187,7 @@ Partial Class frmEintragTvNew 'chkIsRecurring ' Me.chkIsRecurring.AutoSize = True - Me.chkIsRecurring.Location = New System.Drawing.Point(18, 302) + Me.chkIsRecurring.Location = New System.Drawing.Point(58, 439) Me.chkIsRecurring.Name = "chkIsRecurring" Me.chkIsRecurring.Size = New System.Drawing.Size(86, 17) Me.chkIsRecurring.TabIndex = 10 @@ -168,7 +203,7 @@ Partial Class frmEintragTvNew Me.grpWochentage.Controls.Add(Me.chkWednesday) Me.grpWochentage.Controls.Add(Me.chkTuesday) Me.grpWochentage.Controls.Add(Me.chkMonday) - Me.grpWochentage.Location = New System.Drawing.Point(20, 340) + Me.grpWochentage.Location = New System.Drawing.Point(60, 494) Me.grpWochentage.Name = "grpWochentage" Me.grpWochentage.Size = New System.Drawing.Size(763, 57) Me.grpWochentage.TabIndex = 11 @@ -248,7 +283,7 @@ Partial Class frmEintragTvNew 'dtpEndTime ' Me.dtpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Time - Me.dtpEndTime.Location = New System.Drawing.Point(557, 245) + Me.dtpEndTime.Location = New System.Drawing.Point(597, 382) Me.dtpEndTime.Name = "dtpEndTime" Me.dtpEndTime.ShowCheckBox = True Me.dtpEndTime.ShowUpDown = True @@ -258,7 +293,7 @@ Partial Class frmEintragTvNew 'lblEndTime ' Me.lblEndTime.AutoSize = True - Me.lblEndTime.Location = New System.Drawing.Point(502, 248) + Me.lblEndTime.Location = New System.Drawing.Point(542, 385) Me.lblEndTime.Name = "lblEndTime" Me.lblEndTime.Size = New System.Drawing.Size(45, 13) Me.lblEndTime.TabIndex = 14 @@ -267,7 +302,7 @@ Partial Class frmEintragTvNew 'dtpStartTime ' Me.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Time - Me.dtpStartTime.Location = New System.Drawing.Point(557, 204) + Me.dtpStartTime.Location = New System.Drawing.Point(597, 341) Me.dtpStartTime.Name = "dtpStartTime" Me.dtpStartTime.ShowCheckBox = True Me.dtpStartTime.ShowUpDown = True @@ -277,7 +312,7 @@ Partial Class frmEintragTvNew 'lblStartTime ' Me.lblStartTime.AutoSize = True - Me.lblStartTime.Location = New System.Drawing.Point(502, 205) + Me.lblStartTime.Location = New System.Drawing.Point(542, 342) Me.lblStartTime.Name = "lblStartTime" Me.lblStartTime.Size = New System.Drawing.Size(48, 13) Me.lblStartTime.TabIndex = 12 @@ -286,7 +321,7 @@ Partial Class frmEintragTvNew 'dtpEndDate ' Me.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpEndDate.Location = New System.Drawing.Point(130, 245) + Me.dtpEndDate.Location = New System.Drawing.Point(170, 382) Me.dtpEndDate.Name = "dtpEndDate" Me.dtpEndDate.ShowCheckBox = True Me.dtpEndDate.Size = New System.Drawing.Size(201, 20) @@ -295,7 +330,7 @@ Partial Class frmEintragTvNew 'lblEndDate ' Me.lblEndDate.AutoSize = True - Me.lblEndDate.Location = New System.Drawing.Point(15, 248) + Me.lblEndDate.Location = New System.Drawing.Point(55, 385) Me.lblEndDate.Name = "lblEndDate" Me.lblEndDate.Size = New System.Drawing.Size(104, 13) Me.lblEndDate.TabIndex = 10 @@ -304,7 +339,7 @@ Partial Class frmEintragTvNew 'dtpStartDate ' Me.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpStartDate.Location = New System.Drawing.Point(131, 205) + Me.dtpStartDate.Location = New System.Drawing.Point(171, 342) Me.dtpStartDate.Name = "dtpStartDate" Me.dtpStartDate.ShowCheckBox = True Me.dtpStartDate.Size = New System.Drawing.Size(200, 20) @@ -313,7 +348,7 @@ Partial Class frmEintragTvNew 'lblStartDate ' Me.lblStartDate.AutoSize = True - Me.lblStartDate.Location = New System.Drawing.Point(17, 205) + Me.lblStartDate.Location = New System.Drawing.Point(57, 342) Me.lblStartDate.Name = "lblStartDate" Me.lblStartDate.Size = New System.Drawing.Size(107, 13) Me.lblStartDate.TabIndex = 8 @@ -321,7 +356,7 @@ Partial Class frmEintragTvNew ' 'txtZeile3 ' - Me.txtZeile3.Location = New System.Drawing.Point(100, 120) + Me.txtZeile3.Location = New System.Drawing.Point(90, 242) Me.txtZeile3.Name = "txtZeile3" Me.txtZeile3.Size = New System.Drawing.Size(871, 20) Me.txtZeile3.TabIndex = 5 @@ -329,7 +364,7 @@ Partial Class frmEintragTvNew 'lblZeile3 ' Me.lblZeile3.AutoSize = True - Me.lblZeile3.Location = New System.Drawing.Point(42, 123) + Me.lblZeile3.Location = New System.Drawing.Point(42, 245) Me.lblZeile3.Name = "lblZeile3" Me.lblZeile3.Size = New System.Drawing.Size(42, 13) Me.lblZeile3.TabIndex = 6 @@ -337,7 +372,7 @@ Partial Class frmEintragTvNew ' 'txtZeile2 ' - Me.txtZeile2.Location = New System.Drawing.Point(100, 90) + Me.txtZeile2.Location = New System.Drawing.Point(90, 182) Me.txtZeile2.Name = "txtZeile2" Me.txtZeile2.Size = New System.Drawing.Size(871, 20) Me.txtZeile2.TabIndex = 4 @@ -345,18 +380,19 @@ Partial Class frmEintragTvNew 'lblZeile2 ' Me.lblZeile2.AutoSize = True - Me.lblZeile2.Location = New System.Drawing.Point(42, 93) + Me.lblZeile2.Location = New System.Drawing.Point(42, 185) Me.lblZeile2.Name = "lblZeile2" Me.lblZeile2.Size = New System.Drawing.Size(42, 13) Me.lblZeile2.TabIndex = 4 Me.lblZeile2.Text = "Zeile 2:" ' - 'txtZeile1 + 'rtbZeile1 ' - Me.txtZeile1.Location = New System.Drawing.Point(100, 60) - Me.txtZeile1.Name = "txtZeile1" - Me.txtZeile1.Size = New System.Drawing.Size(871, 20) - Me.txtZeile1.TabIndex = 3 + Me.rtbZeile1.Location = New System.Drawing.Point(100, 66) + Me.rtbZeile1.Name = "rtbZeile1" + Me.rtbZeile1.Size = New System.Drawing.Size(871, 80) + Me.rtbZeile1.TabIndex = 3 + Me.rtbZeile1.Text = "" ' 'lblZeile1 ' @@ -388,7 +424,7 @@ Partial Class frmEintragTvNew 'lblPosition ' Me.lblPosition.AutoSize = True - Me.lblPosition.Location = New System.Drawing.Point(42, 156) + Me.lblPosition.Location = New System.Drawing.Point(57, 412) Me.lblPosition.Name = "lblPosition" Me.lblPosition.Size = New System.Drawing.Size(47, 13) Me.lblPosition.TabIndex = 21 @@ -399,14 +435,104 @@ Partial Class frmEintragTvNew Me.cmbPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbPosition.FormattingEnabled = True Me.cmbPosition.Items.AddRange(New Object() {"Top", "Middle", "Bottom"}) - Me.cmbPosition.Location = New System.Drawing.Point(100, 152) + Me.cmbPosition.Location = New System.Drawing.Point(113, 409) Me.cmbPosition.Name = "cmbPosition" Me.cmbPosition.Size = New System.Drawing.Size(177, 21) Me.cmbPosition.TabIndex = 22 ' + 'btnBold + ' + Me.btnBold.Location = New System.Drawing.Point(60, 287) + Me.btnBold.Name = "btnBold" + Me.btnBold.Size = New System.Drawing.Size(30, 30) + Me.btnBold.TabIndex = 23 + Me.btnBold.Text = "B" + Me.btnBold.UseVisualStyleBackColor = True + ' + 'btnItalic + ' + Me.btnItalic.Location = New System.Drawing.Point(100, 287) + Me.btnItalic.Name = "btnItalic" + Me.btnItalic.Size = New System.Drawing.Size(30, 30) + Me.btnItalic.TabIndex = 24 + Me.btnItalic.Text = "I" + Me.btnItalic.UseVisualStyleBackColor = True + ' + 'btnUnderline + ' + Me.btnUnderline.Location = New System.Drawing.Point(140, 287) + Me.btnUnderline.Name = "btnUnderline" + Me.btnUnderline.Size = New System.Drawing.Size(30, 30) + Me.btnUnderline.TabIndex = 25 + Me.btnUnderline.Text = "U" + Me.btnUnderline.UseVisualStyleBackColor = True + ' + 'btnTextColor + ' + Me.btnTextColor.Location = New System.Drawing.Point(180, 287) + Me.btnTextColor.Name = "btnTextColor" + Me.btnTextColor.Size = New System.Drawing.Size(30, 30) + Me.btnTextColor.TabIndex = 26 + Me.btnTextColor.Text = "A" + Me.btnTextColor.UseVisualStyleBackColor = True + ' + 'btnBackColor + ' + Me.btnBackColor.Location = New System.Drawing.Point(220, 287) + Me.btnBackColor.Name = "btnBackColor" + Me.btnBackColor.Size = New System.Drawing.Size(30, 30) + Me.btnBackColor.TabIndex = 27 + Me.btnBackColor.Text = "BG" + Me.btnBackColor.UseVisualStyleBackColor = True + ' + 'btnAlignLeft + ' + Me.btnAlignLeft.Location = New System.Drawing.Point(260, 287) + Me.btnAlignLeft.Name = "btnAlignLeft" + Me.btnAlignLeft.Size = New System.Drawing.Size(30, 30) + Me.btnAlignLeft.TabIndex = 28 + Me.btnAlignLeft.Text = "L" + Me.btnAlignLeft.UseVisualStyleBackColor = True + ' + 'btnAlignCenter + ' + Me.btnAlignCenter.Location = New System.Drawing.Point(300, 287) + Me.btnAlignCenter.Name = "btnAlignCenter" + Me.btnAlignCenter.Size = New System.Drawing.Size(30, 30) + Me.btnAlignCenter.TabIndex = 29 + Me.btnAlignCenter.Text = "C" + Me.btnAlignCenter.UseVisualStyleBackColor = True + ' + 'btnAlignRight + ' + Me.btnAlignRight.Location = New System.Drawing.Point(340, 287) + Me.btnAlignRight.Name = "btnAlignRight" + Me.btnAlignRight.Size = New System.Drawing.Size(30, 30) + Me.btnAlignRight.TabIndex = 30 + Me.btnAlignRight.Text = "R" + Me.btnAlignRight.UseVisualStyleBackColor = True + ' + 'cmbFontFamily + ' + Me.cmbFontFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontFamily.FormattingEnabled = True + Me.cmbFontFamily.Location = New System.Drawing.Point(380, 292) + Me.cmbFontFamily.Name = "cmbFontFamily" + Me.cmbFontFamily.Size = New System.Drawing.Size(150, 21) + Me.cmbFontFamily.TabIndex = 31 + ' + 'cmbFontSize + ' + Me.cmbFontSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontSize.FormattingEnabled = True + Me.cmbFontSize.Location = New System.Drawing.Point(540, 292) + Me.cmbFontSize.Name = "cmbFontSize" + Me.cmbFontSize.Size = New System.Drawing.Size(60, 21) + Me.cmbFontSize.TabIndex = 32 + ' 'btnSpeichern ' - Me.btnSpeichern.Location = New System.Drawing.Point(755, 708) + Me.btnSpeichern.Location = New System.Drawing.Point(1078, 862) Me.btnSpeichern.Name = "btnSpeichern" Me.btnSpeichern.Size = New System.Drawing.Size(75, 30) Me.btnSpeichern.TabIndex = 5 @@ -415,7 +541,7 @@ Partial Class frmEintragTvNew ' 'btnLoeschen ' - Me.btnLoeschen.Location = New System.Drawing.Point(836, 708) + Me.btnLoeschen.Location = New System.Drawing.Point(1159, 862) Me.btnLoeschen.Name = "btnLoeschen" Me.btnLoeschen.Size = New System.Drawing.Size(75, 30) Me.btnLoeschen.TabIndex = 6 @@ -424,7 +550,7 @@ Partial Class frmEintragTvNew ' 'btnAbbrechen ' - Me.btnAbbrechen.Location = New System.Drawing.Point(917, 708) + Me.btnAbbrechen.Location = New System.Drawing.Point(1240, 862) Me.btnAbbrechen.Name = "btnAbbrechen" Me.btnAbbrechen.Size = New System.Drawing.Size(75, 30) Me.btnAbbrechen.TabIndex = 7 @@ -443,7 +569,7 @@ Partial Class frmEintragTvNew ' 'frmEintragTvNew ' - Me.ClientSize = New System.Drawing.Size(1004, 750) + Me.ClientSize = New System.Drawing.Size(1337, 972) Me.Controls.Add(Me.chkShowInactive) Me.Controls.Add(Me.btnAbbrechen) Me.Controls.Add(Me.btnLoeschen) @@ -495,7 +621,6 @@ Partial Class frmEintragTvNew Friend WithEvents lblZeile3 As Label Friend WithEvents txtZeile2 As TextBox Friend WithEvents lblZeile2 As Label - Friend WithEvents txtZeile1 As TextBox Friend WithEvents lblZeile1 As Label Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox Friend WithEvents lblBezeichnung As Label @@ -506,4 +631,6 @@ Partial Class frmEintragTvNew Friend WithEvents btnAbbrechen As Button Friend WithEvents chkShowInactive As CheckBox + + End Class diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb index ea9d2c8..734edc2 100644 --- a/Aviso/frmEintragTvNew.vb +++ b/Aviso/frmEintragTvNew.vb @@ -14,6 +14,7 @@ Public Class frmEintragTvNew Public Sub New() InitializeComponent() + InitializeFontComboBoxes() Icon = cMeineFunktionenAVISO.GetProgrammIcon() End Sub @@ -90,7 +91,7 @@ Public Class frmEintragTvNew dgvAVISOTV.DataSource = gefilterteListe dgvAVISOTV.Columns("TvTextBezeichnungID").HeaderText = "ID" dgvAVISOTV.Columns("TvTextBezeichnung").HeaderText = "Bezeichnung" - dgvAVISOTV.Columns("FixeZeile1").HeaderText = "Zeile 1" + dgvAVISOTV.Columns("FixeZeile1RTF").HeaderText = "Zeile 1" dgvAVISOTV.Columns("FixeZeile2").HeaderText = "Zeile 2" dgvAVISOTV.Columns("FixeZeile3").HeaderText = "Zeile 3" dgvAVISOTV.Columns("Standort").Visible = False @@ -185,40 +186,7 @@ Public Class frmEintragTvNew End Function End Class - Private Sub LadeTvTextBezeichnungen() - isInitializing = True - Dim bezeichnungen As New List(Of cTvTextBezeichnung)() - Try - bezeichnungen = AvisoTvNewDAL.LadenAlleTvTextBezeichnungen() - Catch ex As Exception - MessageBox.Show("Fehler beim Laden der TvTextBezeichnungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) - isInitializing = False - Return - End Try - - Dim items As New List(Of ComboBoxItem)() - - For Each bezeichnung In bezeichnungen - items.Add(New ComboBoxItem() With { - .ID = bezeichnung.TvTextBezeichnungID, - .DisplayText = bezeichnung.TvTextBezeichnung - }) - Next - - cmbTvTextBezeichnungAuswahl.DataSource = items - cmbTvTextBezeichnungAuswahl.DisplayMember = "DisplayText" - cmbTvTextBezeichnungAuswahl.ValueMember = "ID" - cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 - cmbPosition.SelectedIndex = -1 - isInitializing = False - - Debug.WriteLine("TvTextBezeichnungen geladen:") - For Each item In items - Debug.WriteLine($"ID: {item.ID}, Text: {item.DisplayText}") - Next - End Sub Private Sub cmbTvTextBezeichnungAuswahl_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTvTextBezeichnungAuswahl.SelectedIndexChanged If isInitializing Then @@ -259,10 +227,10 @@ Public Class frmEintragTvNew Else Debug.WriteLine("Kein bestehender Eintrag gefunden. Neuer Eintrag wird erstellt.") myAvisoTvNew = New cAvisoTvNew() With { - .IsActive = True, - .StandortID = currentStandortID, - .Standort = currentStandort - } + .IsActive = True, + .StandortID = currentStandortID, + .Standort = currentStandort + } Neuanlage = True Me.Text = "Neuen Eintrag hinzufügen" End If @@ -273,6 +241,148 @@ Public Class frmEintragTvNew End Try End Sub + + Private Sub InitializeFontComboBoxes() + Dim fontFamilies As New List(Of String)() + For Each font As FontFamily In FontFamily.Families + fontFamilies.Add(font.Name) + Next + cmbFontFamily.DataSource = fontFamilies + cmbFontFamily.SelectedItem = rtbZeile1.Font.FontFamily.Name + + Dim sizes As Integer() = {8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72} + cmbFontSize.DataSource = sizes.Select(Function(s) s.ToString()).ToList() + cmbFontSize.SelectedItem = CInt(rtbZeile1.Font.Size).ToString() + + AddHandler cmbFontFamily.SelectedIndexChanged, AddressOf cmbFontFamily_SelectedIndexChanged + AddHandler cmbFontSize.SelectedIndexChanged, AddressOf cmbFontSize_SelectedIndexChanged + + End Sub + + + + ' Schriftfamilie ComboBox SelectionChanged + Private Sub cmbFontFamily_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont() + End Sub + + ' Schriftgröße ComboBox SelectionChanged + Private Sub cmbFontSize_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont() + End Sub + Private Sub UpdateFont() + Dim selectedFontFamily As String = If(cmbFontFamily.SelectedItem, rtbZeile1.Font.FontFamily.Name) + Dim selectedFontSize As Single + If Single.TryParse(cmbFontSize.SelectedItem, selectedFontSize) Then + rtbZeile1.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile1.Font.Style) + hatAenderung = True + End If + End Sub + + ' Methode zum Umschalten des Schriftstils + Private Sub ToggleFontStyle(style As FontStyle) + If rtbZeile1.SelectionFont IsNot Nothing Then + Dim currentFont As Font = rtbZeile1.SelectionFont + Dim newFontStyle As FontStyle + + If rtbZeile1.SelectionFont.Style.HasFlag(style) Then + ' Entferne den Stil + newFontStyle = currentFont.Style And Not style + Else + ' Füge den Stil hinzu + newFontStyle = currentFont.Style Or style + End If + + ' Setze die neue Schriftart + rtbZeile1.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) + hatAenderung = True + End If + End Sub + + ' Fett (Bold) Button Click + Private Sub btnBold_Click(sender As Object, e As EventArgs) Handles btnBold.Click + ToggleFontStyle(FontStyle.Bold) + End Sub + + ' Kursiv (Italic) Button Click + Private Sub btnItalic_Click(sender As Object, e As EventArgs) Handles btnItalic.Click + ToggleFontStyle(FontStyle.Italic) + End Sub + + ' Unterstrichen (Underline) Button Click + Private Sub btnUnderline_Click(sender As Object, e As EventArgs) Handles btnUnderline.Click + ToggleFontStyle(FontStyle.Underline) + End Sub + + ' Textfarbe ändern Button Click + Private Sub btnTextColor_Click(sender As Object, e As EventArgs) Handles btnTextColor.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile1.SelectionColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Hintergrundfarbe ändern Button Click + Private Sub btnBackColor_Click(sender As Object, e As EventArgs) Handles btnBackColor.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile1.SelectionBackColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Links ausrichten Button Click + Private Sub btnAlignLeft_Click(sender As Object, e As EventArgs) Handles btnAlignLeft.Click + rtbZeile1.SelectionAlignment = HorizontalAlignment.Left + hatAenderung = True + End Sub + + ' Mitte ausrichten Button Click + Private Sub btnAlignCenter_Click(sender As Object, e As EventArgs) Handles btnAlignCenter.Click + rtbZeile1.SelectionAlignment = HorizontalAlignment.Center + hatAenderung = True + End Sub + + ' Rechts ausrichten Button Click + Private Sub btnAlignRight_Click(sender As Object, e As EventArgs) Handles btnAlignRight.Click + rtbZeile1.SelectionAlignment = HorizontalAlignment.Right + hatAenderung = True + End Sub + + Private Sub LadeTvTextBezeichnungen() + isInitializing = True + Dim bezeichnungen As New List(Of cTvTextBezeichnung)() + + Try + bezeichnungen = AvisoTvNewDAL.LadenAlleTvTextBezeichnungen() + Catch ex As Exception + MessageBox.Show("Fehler beim Laden der TvTextBezeichnungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + isInitializing = False + Return + End Try + + Dim items As New List(Of ComboBoxItem)() + + For Each bezeichnung In bezeichnungen + items.Add(New ComboBoxItem() With { + .ID = bezeichnung.TvTextBezeichnungID, + .DisplayText = bezeichnung.TvTextBezeichnung + }) + Next + + cmbTvTextBezeichnungAuswahl.DataSource = items + cmbTvTextBezeichnungAuswahl.DisplayMember = "DisplayText" + cmbTvTextBezeichnungAuswahl.ValueMember = "ID" + cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + cmbPosition.SelectedIndex = -1 + isInitializing = False + + Debug.WriteLine("TvTextBezeichnungen geladen:") + For Each item In items + Debug.WriteLine($"ID: {item.ID}, Text: {item.DisplayText}") + Next + End Sub + Private Sub txtNeueTvTextBezeichnung_TextChanged(sender As Object, e As EventArgs) Handles txtNeueTvTextBezeichnung.TextChanged If Not String.IsNullOrWhiteSpace(txtNeueTvTextBezeichnung.Text) Then cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 @@ -295,7 +405,8 @@ Public Class frmEintragTvNew txtNeueTvTextBezeichnung.Text = "" - txtZeile1.Text = aviso.FixeZeile1 + ' Hier setzt du die Textzeilen, wenn vorhanden + rtbZeile1.Rtf = aviso.FixeZeile1RTF txtZeile2.Text = aviso.FixeZeile2 txtZeile3.Text = aviso.FixeZeile3 @@ -343,9 +454,116 @@ Public Class frmEintragTvNew chkIsActive.Checked = aviso.IsActive + ' Text-Einstellungen anwenden + cmbFontFamily.SelectedItem = aviso.FontFamily + cmbFontSize.SelectedItem = aviso.FontSize.ToString() + rtbZeile1.SelectionFont = New Font(aviso.FontFamily, aviso.FontSize, CType([Enum].Parse(GetType(FontStyle), aviso.FontStyle), FontStyle)) + rtbZeile1.SelectionColor = Color.FromName(aviso.TextColor) + rtbZeile1.BackColor = Color.FromName(aviso.BackColor) + + Select Case aviso.TextAlignment + Case "Left" + rtbZeile1.SelectionAlignment = HorizontalAlignment.Left + Case "Center" + rtbZeile1.SelectionAlignment = HorizontalAlignment.Center + Case "Right" + rtbZeile1.SelectionAlignment = HorizontalAlignment.Right + Case Else + rtbZeile1.SelectionAlignment = HorizontalAlignment.Left + End Select + grpWochentage.Enabled = chkIsRecurring.Checked End Sub + Private Function ConvertRtfToHtml(rtf As String) As String + Using rtb As New RichTextBox() + rtb.Rtf = rtf + Dim sb As New System.Text.StringBuilder() + + ' Initialisiere die HTML-Struktur + sb.Append("") + + Dim currentFont As System.Drawing.Font = rtb.SelectionFont + Dim currentColor As Color = rtb.SelectionColor + Dim currentAlignment As HorizontalAlignment = rtb.SelectionAlignment + + Dim text As String = rtb.Text + Dim index As Integer = 0 + + While index < text.Length + rtb.Select(index, 1) + Dim font As System.Drawing.Font = rtb.SelectionFont + Dim color As Color = rtb.SelectionColor + Dim alignment As HorizontalAlignment = rtb.SelectionAlignment + + ' Beginne neue Tags, wenn sich das Format ändert + If font IsNot currentFont Then + ' Schließe vorherige Font-Tags + If currentFont IsNot Nothing Then + sb.Append("") + End If + + ' Öffne neue Font-Tags + sb.Append("") + sb.Append("") + + currentFont = font + currentColor = color + End If + + If alignment <> currentAlignment Then + ' Schließe vorherige Ausrichtung + Select Case currentAlignment + Case HorizontalAlignment.Left, HorizontalAlignment.Center, HorizontalAlignment.Right + sb.Append("") + End Select + + ' Öffne neue Ausrichtung + Select Case alignment + Case HorizontalAlignment.Left + sb.Append("
") + Case HorizontalAlignment.Center + sb.Append("
") + Case HorizontalAlignment.Right + sb.Append("
") + End Select + + currentAlignment = alignment + End If + + ' Füge das aktuelle Zeichen hinzu (HTML-encodiert) + Dim currentChar As Char = text(index) + Select Case currentChar + Case "<" + sb.Append("<") + Case ">" + sb.Append(">") + Case "&" + sb.Append("&") + Case Else + sb.Append(currentChar) + End Select + + index += 1 + End While + + ' Schließe verbleibende Tags + If currentFont IsNot Nothing Then + sb.Append("") + End If + + Select Case currentAlignment + Case HorizontalAlignment.Left, HorizontalAlignment.Center, HorizontalAlignment.Right + sb.Append("
") + End Select + + sb.Append("") + Return sb.ToString() + End Using + End Function + + + Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click Dim verwendeteTvTextBezeichnung As String = "" Dim isNeueTvTextBezeichnung As Boolean = False @@ -376,6 +594,10 @@ Public Class frmEintragTvNew End If Try + ' Konvertiere RTF zu HTML + Dim rtfContent As String = rtbZeile1.Rtf + Dim htmlContent As String = ConvertRtfToHtml(rtfContent) + myAvisoTvNew.TvTextBezeichnung = verwendeteTvTextBezeichnung myAvisoTvNew.StandortID = currentStandortID If cmbPosition.SelectedIndex >= 0 Then @@ -393,7 +615,9 @@ Public Class frmEintragTvNew myAvisoTvNew.TvTextBezeichnungID = selectedTvTextBezeichnungID End If - myAvisoTvNew.FixeZeile1 = If(String.IsNullOrWhiteSpace(txtZeile1.Text), Nothing, txtZeile1.Text.Trim()) + ' Speichere den HTML-Inhalt + myAvisoTvNew.FixeZeile1RTF = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, rtfContent) + myAvisoTvNew.FixeZeile1HTML = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, htmlContent) myAvisoTvNew.FixeZeile2 = If(String.IsNullOrWhiteSpace(txtZeile2.Text), Nothing, txtZeile2.Text.Trim()) myAvisoTvNew.FixeZeile3 = If(String.IsNullOrWhiteSpace(txtZeile3.Text), Nothing, txtZeile3.Text.Trim()) @@ -415,6 +639,7 @@ Public Class frmEintragTvNew myAvisoTvNew.IsActive = chkIsActive.Checked + If Neuanlage Then myAvisoTvNew.Standort = cbxStandort.SelectedItem?.ToString() If String.IsNullOrEmpty(myAvisoTvNew.Standort) Then @@ -425,6 +650,7 @@ Public Class frmEintragTvNew Debug.WriteLine($"Speichern: TVID = {myAvisoTvNew.TVID}, TvTextBezeichnungID = {myAvisoTvNew.TvTextBezeichnungID}, StandortID = {myAvisoTvNew.StandortID}") + ' Speichern der Einstellungen AvisoTvNewDAL.SpeichernAvisoTvNew(myAvisoTvNew) LadeTvTextBezeichnungen() @@ -448,6 +674,8 @@ Public Class frmEintragTvNew End Try End Sub + + Private Sub btnLoeschen_Click(sender As Object, e As EventArgs) Handles btnLoeschen.Click If myAvisoTvNew Is Nothing OrElse myAvisoTvNew.TVID = 0 Then MessageBox.Show("Bitte wählen Sie einen Eintrag zum Deaktivieren aus.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information) @@ -493,7 +721,7 @@ Public Class frmEintragTvNew Me.Close() End Sub - Private Sub txt_TextChanged(sender As Object, e As EventArgs) Handles txtZeile1.TextChanged, txtZeile2.TextChanged, txtZeile3.TextChanged, dtpStartDate.ValueChanged, dtpEndDate.ValueChanged, dtpStartTime.ValueChanged, dtpEndTime.ValueChanged, chkIsRecurring.CheckedChanged, chkMonday.CheckedChanged, chkTuesday.CheckedChanged, chkWednesday.CheckedChanged, chkThursday.CheckedChanged, chkFriday.CheckedChanged, chkSaturday.CheckedChanged, chkSunday.CheckedChanged, chkIsActive.CheckedChanged, cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, txtNeueTvTextBezeichnung.TextChanged + Private Sub txt_TextChanged(sender As Object, e As EventArgs) Handles rtbZeile1.TextChanged, txtZeile2.TextChanged, txtZeile3.TextChanged, dtpStartDate.ValueChanged, dtpEndDate.ValueChanged, dtpStartTime.ValueChanged, dtpEndTime.ValueChanged, chkIsRecurring.CheckedChanged, chkMonday.CheckedChanged, chkTuesday.CheckedChanged, chkWednesday.CheckedChanged, chkThursday.CheckedChanged, chkFriday.CheckedChanged, chkSaturday.CheckedChanged, chkSunday.CheckedChanged, chkIsActive.CheckedChanged, cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, txtNeueTvTextBezeichnung.TextChanged hatAenderung = True End Sub @@ -512,7 +740,7 @@ Public Class frmEintragTvNew cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 cmbPosition.SelectedIndex = -1 txtNeueTvTextBezeichnung.Text = "" - txtZeile1.Text = "" + rtbZeile1.Text = "" txtZeile2.Text = "" txtZeile3.Text = "" dtpStartDate.Value = DateTime.Now From 101e7bf1dc89a973c6925ac9d3ef8d35de2b31d1 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Fri, 22 Nov 2024 16:41:27 +0100 Subject: [PATCH 4/7] TVAPP --- Aviso/frmEintragTvNew.Designer.vb | 368 ++++++++++++++++---- Aviso/frmEintragTvNew.vb | 539 ++++++++++++++++++++++++------ 2 files changed, 734 insertions(+), 173 deletions(-) diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb index 4414fca..c195513 100644 --- a/Aviso/frmEintragTvNew.Designer.vb +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -35,6 +35,28 @@ Partial Class frmEintragTvNew Me.lblStandort = New System.Windows.Forms.Label() Me.dgvAVISOTV = New System.Windows.Forms.DataGridView() Me.grpEingabe = New System.Windows.Forms.GroupBox() + Me.btnBold3 = New System.Windows.Forms.Button() + Me.btnItalic3 = New System.Windows.Forms.Button() + Me.btnUnderline3 = New System.Windows.Forms.Button() + Me.btnTextColor3 = New System.Windows.Forms.Button() + Me.btnBackColor3 = New System.Windows.Forms.Button() + Me.btnAlignLeft3 = New System.Windows.Forms.Button() + Me.btnAlignCenter3 = New System.Windows.Forms.Button() + Me.btnAlignRight3 = New System.Windows.Forms.Button() + Me.cmbFontFamily3 = New System.Windows.Forms.ComboBox() + Me.cmbFontSize3 = New System.Windows.Forms.ComboBox() + Me.btnBold2 = New System.Windows.Forms.Button() + Me.btnItalic2 = New System.Windows.Forms.Button() + Me.btnUnderline2 = New System.Windows.Forms.Button() + Me.btnTextColor2 = New System.Windows.Forms.Button() + Me.btnBackColor2 = New System.Windows.Forms.Button() + Me.btnAlignLeft2 = New System.Windows.Forms.Button() + Me.btnAlignCenter2 = New System.Windows.Forms.Button() + Me.btnAlignRight2 = New System.Windows.Forms.Button() + Me.cmbFontFamily2 = New System.Windows.Forms.ComboBox() + Me.cmbFontSize2 = New System.Windows.Forms.ComboBox() + Me.rtbZeile3 = New System.Windows.Forms.RichTextBox() + Me.rtbZeile2 = New System.Windows.Forms.RichTextBox() Me.lblNeueTvTextBezeichnung = New System.Windows.Forms.Label() Me.txtNeueTvTextBezeichnung = New System.Windows.Forms.TextBox() Me.chkIsActive = New System.Windows.Forms.CheckBox() @@ -55,9 +77,7 @@ Partial Class frmEintragTvNew Me.lblEndDate = New System.Windows.Forms.Label() Me.dtpStartDate = New System.Windows.Forms.DateTimePicker() Me.lblStartDate = New System.Windows.Forms.Label() - Me.txtZeile3 = New System.Windows.Forms.TextBox() Me.lblZeile3 = New System.Windows.Forms.Label() - Me.txtZeile2 = New System.Windows.Forms.TextBox() Me.lblZeile2 = New System.Windows.Forms.Label() Me.rtbZeile1 = New System.Windows.Forms.RichTextBox() Me.lblZeile1 = New System.Windows.Forms.Label() @@ -118,6 +138,28 @@ Partial Class frmEintragTvNew ' 'grpEingabe ' + Me.grpEingabe.Controls.Add(Me.btnBold3) + Me.grpEingabe.Controls.Add(Me.btnItalic3) + Me.grpEingabe.Controls.Add(Me.btnUnderline3) + Me.grpEingabe.Controls.Add(Me.btnTextColor3) + Me.grpEingabe.Controls.Add(Me.btnBackColor3) + Me.grpEingabe.Controls.Add(Me.btnAlignLeft3) + Me.grpEingabe.Controls.Add(Me.btnAlignCenter3) + Me.grpEingabe.Controls.Add(Me.btnAlignRight3) + Me.grpEingabe.Controls.Add(Me.cmbFontFamily3) + Me.grpEingabe.Controls.Add(Me.cmbFontSize3) + Me.grpEingabe.Controls.Add(Me.btnBold2) + Me.grpEingabe.Controls.Add(Me.btnItalic2) + Me.grpEingabe.Controls.Add(Me.btnUnderline2) + Me.grpEingabe.Controls.Add(Me.btnTextColor2) + Me.grpEingabe.Controls.Add(Me.btnBackColor2) + Me.grpEingabe.Controls.Add(Me.btnAlignLeft2) + Me.grpEingabe.Controls.Add(Me.btnAlignCenter2) + Me.grpEingabe.Controls.Add(Me.btnAlignRight2) + Me.grpEingabe.Controls.Add(Me.cmbFontFamily2) + Me.grpEingabe.Controls.Add(Me.cmbFontSize2) + Me.grpEingabe.Controls.Add(Me.rtbZeile3) + Me.grpEingabe.Controls.Add(Me.rtbZeile2) Me.grpEingabe.Controls.Add(Me.lblNeueTvTextBezeichnung) Me.grpEingabe.Controls.Add(Me.txtNeueTvTextBezeichnung) Me.grpEingabe.Controls.Add(Me.chkIsActive) @@ -131,9 +173,7 @@ Partial Class frmEintragTvNew Me.grpEingabe.Controls.Add(Me.lblEndDate) Me.grpEingabe.Controls.Add(Me.dtpStartDate) Me.grpEingabe.Controls.Add(Me.lblStartDate) - Me.grpEingabe.Controls.Add(Me.txtZeile3) Me.grpEingabe.Controls.Add(Me.lblZeile3) - Me.grpEingabe.Controls.Add(Me.txtZeile2) Me.grpEingabe.Controls.Add(Me.lblZeile2) Me.grpEingabe.Controls.Add(Me.rtbZeile1) Me.grpEingabe.Controls.Add(Me.lblZeile1) @@ -153,15 +193,211 @@ Partial Class frmEintragTvNew Me.grpEingabe.Controls.Add(Me.cmbFontSize) Me.grpEingabe.Location = New System.Drawing.Point(15, 275) Me.grpEingabe.Name = "grpEingabe" - Me.grpEingabe.Size = New System.Drawing.Size(1300, 570) + Me.grpEingabe.Size = New System.Drawing.Size(1300, 716) Me.grpEingabe.TabIndex = 3 Me.grpEingabe.TabStop = False Me.grpEingabe.Text = "Informationen eingeben" ' + 'btnBold3 + ' + Me.btnBold3.Location = New System.Drawing.Point(100, 449) + Me.btnBold3.Name = "btnBold3" + Me.btnBold3.Size = New System.Drawing.Size(30, 30) + Me.btnBold3.TabIndex = 45 + Me.btnBold3.Text = "B" + Me.btnBold3.UseVisualStyleBackColor = True + ' + 'btnItalic3 + ' + Me.btnItalic3.Location = New System.Drawing.Point(140, 449) + Me.btnItalic3.Name = "btnItalic3" + Me.btnItalic3.Size = New System.Drawing.Size(30, 30) + Me.btnItalic3.TabIndex = 46 + Me.btnItalic3.Text = "I" + Me.btnItalic3.UseVisualStyleBackColor = True + ' + 'btnUnderline3 + ' + Me.btnUnderline3.Location = New System.Drawing.Point(180, 449) + Me.btnUnderline3.Name = "btnUnderline3" + Me.btnUnderline3.Size = New System.Drawing.Size(30, 30) + Me.btnUnderline3.TabIndex = 47 + Me.btnUnderline3.Text = "U" + Me.btnUnderline3.UseVisualStyleBackColor = True + ' + 'btnTextColor3 + ' + Me.btnTextColor3.Location = New System.Drawing.Point(302, 449) + Me.btnTextColor3.Name = "btnTextColor3" + Me.btnTextColor3.Size = New System.Drawing.Size(30, 30) + Me.btnTextColor3.TabIndex = 48 + Me.btnTextColor3.Text = "A" + Me.btnTextColor3.UseVisualStyleBackColor = True + ' + 'btnBackColor3 + ' + Me.btnBackColor3.Location = New System.Drawing.Point(342, 449) + Me.btnBackColor3.Name = "btnBackColor3" + Me.btnBackColor3.Size = New System.Drawing.Size(30, 30) + Me.btnBackColor3.TabIndex = 49 + Me.btnBackColor3.Text = "BG" + Me.btnBackColor3.UseVisualStyleBackColor = True + ' + 'btnAlignLeft3 + ' + Me.btnAlignLeft3.Location = New System.Drawing.Point(471, 449) + Me.btnAlignLeft3.Name = "btnAlignLeft3" + Me.btnAlignLeft3.Size = New System.Drawing.Size(30, 30) + Me.btnAlignLeft3.TabIndex = 50 + Me.btnAlignLeft3.Text = "L" + Me.btnAlignLeft3.UseVisualStyleBackColor = True + ' + 'btnAlignCenter3 + ' + Me.btnAlignCenter3.Location = New System.Drawing.Point(511, 449) + Me.btnAlignCenter3.Name = "btnAlignCenter3" + Me.btnAlignCenter3.Size = New System.Drawing.Size(30, 30) + Me.btnAlignCenter3.TabIndex = 51 + Me.btnAlignCenter3.Text = "C" + Me.btnAlignCenter3.UseVisualStyleBackColor = True + ' + 'btnAlignRight3 + ' + Me.btnAlignRight3.Location = New System.Drawing.Point(551, 449) + Me.btnAlignRight3.Name = "btnAlignRight3" + Me.btnAlignRight3.Size = New System.Drawing.Size(30, 30) + Me.btnAlignRight3.TabIndex = 52 + Me.btnAlignRight3.Text = "R" + Me.btnAlignRight3.UseVisualStyleBackColor = True + ' + 'cmbFontFamily3 + ' + Me.cmbFontFamily3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontFamily3.FormattingEnabled = True + Me.cmbFontFamily3.Location = New System.Drawing.Point(734, 449) + Me.cmbFontFamily3.Name = "cmbFontFamily3" + Me.cmbFontFamily3.Size = New System.Drawing.Size(150, 21) + Me.cmbFontFamily3.TabIndex = 53 + ' + 'cmbFontSize3 + ' + Me.cmbFontSize3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontSize3.FormattingEnabled = True + Me.cmbFontSize3.Location = New System.Drawing.Point(911, 449) + Me.cmbFontSize3.Name = "cmbFontSize3" + Me.cmbFontSize3.Size = New System.Drawing.Size(60, 21) + Me.cmbFontSize3.TabIndex = 54 + ' + 'btnBold2 + ' + Me.btnBold2.Location = New System.Drawing.Point(101, 307) + Me.btnBold2.Name = "btnBold2" + Me.btnBold2.Size = New System.Drawing.Size(30, 30) + Me.btnBold2.TabIndex = 35 + Me.btnBold2.Text = "B" + Me.btnBold2.UseVisualStyleBackColor = True + ' + 'btnItalic2 + ' + Me.btnItalic2.Location = New System.Drawing.Point(141, 307) + Me.btnItalic2.Name = "btnItalic2" + Me.btnItalic2.Size = New System.Drawing.Size(30, 30) + Me.btnItalic2.TabIndex = 36 + Me.btnItalic2.Text = "I" + Me.btnItalic2.UseVisualStyleBackColor = True + ' + 'btnUnderline2 + ' + Me.btnUnderline2.Location = New System.Drawing.Point(181, 307) + Me.btnUnderline2.Name = "btnUnderline2" + Me.btnUnderline2.Size = New System.Drawing.Size(30, 30) + Me.btnUnderline2.TabIndex = 37 + Me.btnUnderline2.Text = "U" + Me.btnUnderline2.UseVisualStyleBackColor = True + ' + 'btnTextColor2 + ' + Me.btnTextColor2.Location = New System.Drawing.Point(303, 307) + Me.btnTextColor2.Name = "btnTextColor2" + Me.btnTextColor2.Size = New System.Drawing.Size(30, 30) + Me.btnTextColor2.TabIndex = 38 + Me.btnTextColor2.Text = "A" + Me.btnTextColor2.UseVisualStyleBackColor = True + ' + 'btnBackColor2 + ' + Me.btnBackColor2.Location = New System.Drawing.Point(343, 307) + Me.btnBackColor2.Name = "btnBackColor2" + Me.btnBackColor2.Size = New System.Drawing.Size(30, 30) + Me.btnBackColor2.TabIndex = 39 + Me.btnBackColor2.Text = "BG" + Me.btnBackColor2.UseVisualStyleBackColor = True + ' + 'btnAlignLeft2 + ' + Me.btnAlignLeft2.Location = New System.Drawing.Point(472, 307) + Me.btnAlignLeft2.Name = "btnAlignLeft2" + Me.btnAlignLeft2.Size = New System.Drawing.Size(30, 30) + Me.btnAlignLeft2.TabIndex = 40 + Me.btnAlignLeft2.Text = "L" + Me.btnAlignLeft2.UseVisualStyleBackColor = True + ' + 'btnAlignCenter2 + ' + Me.btnAlignCenter2.Location = New System.Drawing.Point(512, 307) + Me.btnAlignCenter2.Name = "btnAlignCenter2" + Me.btnAlignCenter2.Size = New System.Drawing.Size(30, 30) + Me.btnAlignCenter2.TabIndex = 41 + Me.btnAlignCenter2.Text = "C" + Me.btnAlignCenter2.UseVisualStyleBackColor = True + ' + 'btnAlignRight2 + ' + Me.btnAlignRight2.Location = New System.Drawing.Point(552, 307) + Me.btnAlignRight2.Name = "btnAlignRight2" + Me.btnAlignRight2.Size = New System.Drawing.Size(30, 30) + Me.btnAlignRight2.TabIndex = 42 + Me.btnAlignRight2.Text = "R" + Me.btnAlignRight2.UseVisualStyleBackColor = True + ' + 'cmbFontFamily2 + ' + Me.cmbFontFamily2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontFamily2.FormattingEnabled = True + Me.cmbFontFamily2.Location = New System.Drawing.Point(735, 307) + Me.cmbFontFamily2.Name = "cmbFontFamily2" + Me.cmbFontFamily2.Size = New System.Drawing.Size(150, 21) + Me.cmbFontFamily2.TabIndex = 43 + ' + 'cmbFontSize2 + ' + Me.cmbFontSize2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbFontSize2.FormattingEnabled = True + Me.cmbFontSize2.Location = New System.Drawing.Point(912, 307) + Me.cmbFontSize2.Name = "cmbFontSize2" + Me.cmbFontSize2.Size = New System.Drawing.Size(60, 21) + Me.cmbFontSize2.TabIndex = 44 + ' + 'rtbZeile3 + ' + Me.rtbZeile3.Location = New System.Drawing.Point(100, 363) + Me.rtbZeile3.Name = "rtbZeile3" + Me.rtbZeile3.Size = New System.Drawing.Size(1180, 80) + Me.rtbZeile3.TabIndex = 34 + Me.rtbZeile3.Text = "" + ' + 'rtbZeile2 + ' + Me.rtbZeile2.Location = New System.Drawing.Point(101, 221) + Me.rtbZeile2.Name = "rtbZeile2" + Me.rtbZeile2.Size = New System.Drawing.Size(1180, 80) + Me.rtbZeile2.TabIndex = 33 + Me.rtbZeile2.Text = "" + ' 'lblNeueTvTextBezeichnung ' Me.lblNeueTvTextBezeichnung.AutoSize = True - Me.lblNeueTvTextBezeichnung.Location = New System.Drawing.Point(300, 33) + Me.lblNeueTvTextBezeichnung.Location = New System.Drawing.Point(301, 39) Me.lblNeueTvTextBezeichnung.Name = "lblNeueTvTextBezeichnung" Me.lblNeueTvTextBezeichnung.Size = New System.Drawing.Size(135, 13) Me.lblNeueTvTextBezeichnung.TabIndex = 19 @@ -169,7 +405,7 @@ Partial Class frmEintragTvNew ' 'txtNeueTvTextBezeichnung ' - Me.txtNeueTvTextBezeichnung.Location = New System.Drawing.Point(460, 30) + Me.txtNeueTvTextBezeichnung.Location = New System.Drawing.Point(461, 36) Me.txtNeueTvTextBezeichnung.Name = "txtNeueTvTextBezeichnung" Me.txtNeueTvTextBezeichnung.Size = New System.Drawing.Size(200, 20) Me.txtNeueTvTextBezeichnung.TabIndex = 20 @@ -177,7 +413,7 @@ Partial Class frmEintragTvNew 'chkIsActive ' Me.chkIsActive.AutoSize = True - Me.chkIsActive.Location = New System.Drawing.Point(670, 32) + Me.chkIsActive.Location = New System.Drawing.Point(671, 38) Me.chkIsActive.Name = "chkIsActive" Me.chkIsActive.Size = New System.Drawing.Size(50, 17) Me.chkIsActive.TabIndex = 18 @@ -187,7 +423,7 @@ Partial Class frmEintragTvNew 'chkIsRecurring ' Me.chkIsRecurring.AutoSize = True - Me.chkIsRecurring.Location = New System.Drawing.Point(58, 439) + Me.chkIsRecurring.Location = New System.Drawing.Point(64, 627) Me.chkIsRecurring.Name = "chkIsRecurring" Me.chkIsRecurring.Size = New System.Drawing.Size(86, 17) Me.chkIsRecurring.TabIndex = 10 @@ -203,9 +439,9 @@ Partial Class frmEintragTvNew Me.grpWochentage.Controls.Add(Me.chkWednesday) Me.grpWochentage.Controls.Add(Me.chkTuesday) Me.grpWochentage.Controls.Add(Me.chkMonday) - Me.grpWochentage.Location = New System.Drawing.Point(60, 494) + Me.grpWochentage.Location = New System.Drawing.Point(66, 650) Me.grpWochentage.Name = "grpWochentage" - Me.grpWochentage.Size = New System.Drawing.Size(763, 57) + Me.grpWochentage.Size = New System.Drawing.Size(776, 57) Me.grpWochentage.TabIndex = 11 Me.grpWochentage.TabStop = False Me.grpWochentage.Text = "Wochentage" @@ -283,7 +519,7 @@ Partial Class frmEintragTvNew 'dtpEndTime ' Me.dtpEndTime.Format = System.Windows.Forms.DateTimePickerFormat.Time - Me.dtpEndTime.Location = New System.Drawing.Point(597, 382) + Me.dtpEndTime.Location = New System.Drawing.Point(722, 537) Me.dtpEndTime.Name = "dtpEndTime" Me.dtpEndTime.ShowCheckBox = True Me.dtpEndTime.ShowUpDown = True @@ -293,16 +529,16 @@ Partial Class frmEintragTvNew 'lblEndTime ' Me.lblEndTime.AutoSize = True - Me.lblEndTime.Location = New System.Drawing.Point(542, 385) + Me.lblEndTime.Location = New System.Drawing.Point(618, 543) Me.lblEndTime.Name = "lblEndTime" - Me.lblEndTime.Size = New System.Drawing.Size(45, 13) + Me.lblEndTime.Size = New System.Drawing.Size(91, 13) Me.lblEndTime.TabIndex = 14 - Me.lblEndTime.Text = "Endzeit:" + Me.lblEndTime.Text = "Endzeit (optional):" ' 'dtpStartTime ' Me.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Time - Me.dtpStartTime.Location = New System.Drawing.Point(597, 341) + Me.dtpStartTime.Location = New System.Drawing.Point(126, 538) Me.dtpStartTime.Name = "dtpStartTime" Me.dtpStartTime.ShowCheckBox = True Me.dtpStartTime.ShowUpDown = True @@ -312,7 +548,7 @@ Partial Class frmEintragTvNew 'lblStartTime ' Me.lblStartTime.AutoSize = True - Me.lblStartTime.Location = New System.Drawing.Point(542, 342) + Me.lblStartTime.Location = New System.Drawing.Point(61, 544) Me.lblStartTime.Name = "lblStartTime" Me.lblStartTime.Size = New System.Drawing.Size(48, 13) Me.lblStartTime.TabIndex = 12 @@ -321,7 +557,7 @@ Partial Class frmEintragTvNew 'dtpEndDate ' Me.dtpEndDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpEndDate.Location = New System.Drawing.Point(170, 382) + Me.dtpEndDate.Location = New System.Drawing.Point(721, 504) Me.dtpEndDate.Name = "dtpEndDate" Me.dtpEndDate.ShowCheckBox = True Me.dtpEndDate.Size = New System.Drawing.Size(201, 20) @@ -330,7 +566,7 @@ Partial Class frmEintragTvNew 'lblEndDate ' Me.lblEndDate.AutoSize = True - Me.lblEndDate.Location = New System.Drawing.Point(55, 385) + Me.lblEndDate.Location = New System.Drawing.Point(606, 507) Me.lblEndDate.Name = "lblEndDate" Me.lblEndDate.Size = New System.Drawing.Size(104, 13) Me.lblEndDate.TabIndex = 10 @@ -339,7 +575,7 @@ Partial Class frmEintragTvNew 'dtpStartDate ' Me.dtpStartDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short] - Me.dtpStartDate.Location = New System.Drawing.Point(171, 342) + Me.dtpStartDate.Location = New System.Drawing.Point(127, 504) Me.dtpStartDate.Name = "dtpStartDate" Me.dtpStartDate.ShowCheckBox = True Me.dtpStartDate.Size = New System.Drawing.Size(200, 20) @@ -348,39 +584,25 @@ Partial Class frmEintragTvNew 'lblStartDate ' Me.lblStartDate.AutoSize = True - Me.lblStartDate.Location = New System.Drawing.Point(57, 342) + Me.lblStartDate.Location = New System.Drawing.Point(45, 507) Me.lblStartDate.Name = "lblStartDate" - Me.lblStartDate.Size = New System.Drawing.Size(107, 13) + Me.lblStartDate.Size = New System.Drawing.Size(64, 13) Me.lblStartDate.TabIndex = 8 - Me.lblStartDate.Text = "Startdatum (optional):" - ' - 'txtZeile3 - ' - Me.txtZeile3.Location = New System.Drawing.Point(90, 242) - Me.txtZeile3.Name = "txtZeile3" - Me.txtZeile3.Size = New System.Drawing.Size(871, 20) - Me.txtZeile3.TabIndex = 5 + Me.lblStartDate.Text = "Startdatum: " ' 'lblZeile3 ' Me.lblZeile3.AutoSize = True - Me.lblZeile3.Location = New System.Drawing.Point(42, 245) + Me.lblZeile3.Location = New System.Drawing.Point(42, 388) Me.lblZeile3.Name = "lblZeile3" Me.lblZeile3.Size = New System.Drawing.Size(42, 13) Me.lblZeile3.TabIndex = 6 Me.lblZeile3.Text = "Zeile 3:" ' - 'txtZeile2 - ' - Me.txtZeile2.Location = New System.Drawing.Point(90, 182) - Me.txtZeile2.Name = "txtZeile2" - Me.txtZeile2.Size = New System.Drawing.Size(871, 20) - Me.txtZeile2.TabIndex = 4 - ' 'lblZeile2 ' Me.lblZeile2.AutoSize = True - Me.lblZeile2.Location = New System.Drawing.Point(42, 185) + Me.lblZeile2.Location = New System.Drawing.Point(43, 255) Me.lblZeile2.Name = "lblZeile2" Me.lblZeile2.Size = New System.Drawing.Size(42, 13) Me.lblZeile2.TabIndex = 4 @@ -388,16 +610,16 @@ Partial Class frmEintragTvNew ' 'rtbZeile1 ' - Me.rtbZeile1.Location = New System.Drawing.Point(100, 66) + Me.rtbZeile1.Location = New System.Drawing.Point(100, 79) Me.rtbZeile1.Name = "rtbZeile1" - Me.rtbZeile1.Size = New System.Drawing.Size(871, 80) + Me.rtbZeile1.Size = New System.Drawing.Size(1180, 80) Me.rtbZeile1.TabIndex = 3 Me.rtbZeile1.Text = "" ' 'lblZeile1 ' Me.lblZeile1.AutoSize = True - Me.lblZeile1.Location = New System.Drawing.Point(42, 63) + Me.lblZeile1.Location = New System.Drawing.Point(42, 109) Me.lblZeile1.Name = "lblZeile1" Me.lblZeile1.Size = New System.Drawing.Size(42, 13) Me.lblZeile1.TabIndex = 2 @@ -407,7 +629,7 @@ Partial Class frmEintragTvNew ' Me.cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbTvTextBezeichnungAuswahl.FormattingEnabled = True - Me.cmbTvTextBezeichnungAuswahl.Location = New System.Drawing.Point(100, 30) + Me.cmbTvTextBezeichnungAuswahl.Location = New System.Drawing.Point(101, 36) Me.cmbTvTextBezeichnungAuswahl.Name = "cmbTvTextBezeichnungAuswahl" Me.cmbTvTextBezeichnungAuswahl.Size = New System.Drawing.Size(177, 21) Me.cmbTvTextBezeichnungAuswahl.TabIndex = 2 @@ -415,7 +637,7 @@ Partial Class frmEintragTvNew 'lblBezeichnung ' Me.lblBezeichnung.AutoSize = True - Me.lblBezeichnung.Location = New System.Drawing.Point(17, 33) + Me.lblBezeichnung.Location = New System.Drawing.Point(13, 39) Me.lblBezeichnung.Name = "lblBezeichnung" Me.lblBezeichnung.Size = New System.Drawing.Size(72, 13) Me.lblBezeichnung.TabIndex = 0 @@ -424,7 +646,7 @@ Partial Class frmEintragTvNew 'lblPosition ' Me.lblPosition.AutoSize = True - Me.lblPosition.Location = New System.Drawing.Point(57, 412) + Me.lblPosition.Location = New System.Drawing.Point(62, 584) Me.lblPosition.Name = "lblPosition" Me.lblPosition.Size = New System.Drawing.Size(47, 13) Me.lblPosition.TabIndex = 21 @@ -435,14 +657,14 @@ Partial Class frmEintragTvNew Me.cmbPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbPosition.FormattingEnabled = True Me.cmbPosition.Items.AddRange(New Object() {"Top", "Middle", "Bottom"}) - Me.cmbPosition.Location = New System.Drawing.Point(113, 409) + Me.cmbPosition.Location = New System.Drawing.Point(125, 576) Me.cmbPosition.Name = "cmbPosition" Me.cmbPosition.Size = New System.Drawing.Size(177, 21) Me.cmbPosition.TabIndex = 22 ' 'btnBold ' - Me.btnBold.Location = New System.Drawing.Point(60, 287) + Me.btnBold.Location = New System.Drawing.Point(100, 165) Me.btnBold.Name = "btnBold" Me.btnBold.Size = New System.Drawing.Size(30, 30) Me.btnBold.TabIndex = 23 @@ -451,7 +673,7 @@ Partial Class frmEintragTvNew ' 'btnItalic ' - Me.btnItalic.Location = New System.Drawing.Point(100, 287) + Me.btnItalic.Location = New System.Drawing.Point(140, 165) Me.btnItalic.Name = "btnItalic" Me.btnItalic.Size = New System.Drawing.Size(30, 30) Me.btnItalic.TabIndex = 24 @@ -460,7 +682,7 @@ Partial Class frmEintragTvNew ' 'btnUnderline ' - Me.btnUnderline.Location = New System.Drawing.Point(140, 287) + Me.btnUnderline.Location = New System.Drawing.Point(180, 165) Me.btnUnderline.Name = "btnUnderline" Me.btnUnderline.Size = New System.Drawing.Size(30, 30) Me.btnUnderline.TabIndex = 25 @@ -469,7 +691,7 @@ Partial Class frmEintragTvNew ' 'btnTextColor ' - Me.btnTextColor.Location = New System.Drawing.Point(180, 287) + Me.btnTextColor.Location = New System.Drawing.Point(302, 165) Me.btnTextColor.Name = "btnTextColor" Me.btnTextColor.Size = New System.Drawing.Size(30, 30) Me.btnTextColor.TabIndex = 26 @@ -478,7 +700,7 @@ Partial Class frmEintragTvNew ' 'btnBackColor ' - Me.btnBackColor.Location = New System.Drawing.Point(220, 287) + Me.btnBackColor.Location = New System.Drawing.Point(342, 165) Me.btnBackColor.Name = "btnBackColor" Me.btnBackColor.Size = New System.Drawing.Size(30, 30) Me.btnBackColor.TabIndex = 27 @@ -487,7 +709,7 @@ Partial Class frmEintragTvNew ' 'btnAlignLeft ' - Me.btnAlignLeft.Location = New System.Drawing.Point(260, 287) + Me.btnAlignLeft.Location = New System.Drawing.Point(471, 165) Me.btnAlignLeft.Name = "btnAlignLeft" Me.btnAlignLeft.Size = New System.Drawing.Size(30, 30) Me.btnAlignLeft.TabIndex = 28 @@ -496,7 +718,7 @@ Partial Class frmEintragTvNew ' 'btnAlignCenter ' - Me.btnAlignCenter.Location = New System.Drawing.Point(300, 287) + Me.btnAlignCenter.Location = New System.Drawing.Point(511, 165) Me.btnAlignCenter.Name = "btnAlignCenter" Me.btnAlignCenter.Size = New System.Drawing.Size(30, 30) Me.btnAlignCenter.TabIndex = 29 @@ -505,7 +727,7 @@ Partial Class frmEintragTvNew ' 'btnAlignRight ' - Me.btnAlignRight.Location = New System.Drawing.Point(340, 287) + Me.btnAlignRight.Location = New System.Drawing.Point(551, 165) Me.btnAlignRight.Name = "btnAlignRight" Me.btnAlignRight.Size = New System.Drawing.Size(30, 30) Me.btnAlignRight.TabIndex = 30 @@ -516,7 +738,7 @@ Partial Class frmEintragTvNew ' Me.cmbFontFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbFontFamily.FormattingEnabled = True - Me.cmbFontFamily.Location = New System.Drawing.Point(380, 292) + Me.cmbFontFamily.Location = New System.Drawing.Point(734, 165) Me.cmbFontFamily.Name = "cmbFontFamily" Me.cmbFontFamily.Size = New System.Drawing.Size(150, 21) Me.cmbFontFamily.TabIndex = 31 @@ -525,14 +747,14 @@ Partial Class frmEintragTvNew ' Me.cmbFontSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbFontSize.FormattingEnabled = True - Me.cmbFontSize.Location = New System.Drawing.Point(540, 292) + Me.cmbFontSize.Location = New System.Drawing.Point(911, 165) Me.cmbFontSize.Name = "cmbFontSize" Me.cmbFontSize.Size = New System.Drawing.Size(60, 21) Me.cmbFontSize.TabIndex = 32 ' 'btnSpeichern ' - Me.btnSpeichern.Location = New System.Drawing.Point(1078, 862) + Me.btnSpeichern.Location = New System.Drawing.Point(1078, 1010) Me.btnSpeichern.Name = "btnSpeichern" Me.btnSpeichern.Size = New System.Drawing.Size(75, 30) Me.btnSpeichern.TabIndex = 5 @@ -541,7 +763,7 @@ Partial Class frmEintragTvNew ' 'btnLoeschen ' - Me.btnLoeschen.Location = New System.Drawing.Point(1159, 862) + Me.btnLoeschen.Location = New System.Drawing.Point(1159, 1010) Me.btnLoeschen.Name = "btnLoeschen" Me.btnLoeschen.Size = New System.Drawing.Size(75, 30) Me.btnLoeschen.TabIndex = 6 @@ -550,7 +772,7 @@ Partial Class frmEintragTvNew ' 'btnAbbrechen ' - Me.btnAbbrechen.Location = New System.Drawing.Point(1240, 862) + Me.btnAbbrechen.Location = New System.Drawing.Point(1240, 1010) Me.btnAbbrechen.Name = "btnAbbrechen" Me.btnAbbrechen.Size = New System.Drawing.Size(75, 30) Me.btnAbbrechen.TabIndex = 7 @@ -569,7 +791,7 @@ Partial Class frmEintragTvNew ' 'frmEintragTvNew ' - Me.ClientSize = New System.Drawing.Size(1337, 972) + Me.ClientSize = New System.Drawing.Size(1342, 1052) Me.Controls.Add(Me.chkShowInactive) Me.Controls.Add(Me.btnAbbrechen) Me.Controls.Add(Me.btnLoeschen) @@ -617,9 +839,7 @@ Partial Class frmEintragTvNew Friend WithEvents lblEndDate As Label Friend WithEvents dtpStartDate As DateTimePicker Friend WithEvents lblStartDate As Label - Friend WithEvents txtZeile3 As TextBox Friend WithEvents lblZeile3 As Label - Friend WithEvents txtZeile2 As TextBox Friend WithEvents lblZeile2 As Label Friend WithEvents lblZeile1 As Label Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox @@ -630,7 +850,27 @@ Partial Class frmEintragTvNew Friend WithEvents btnLoeschen As Button Friend WithEvents btnAbbrechen As Button Friend WithEvents chkShowInactive As CheckBox - - + Private WithEvents rtbZeile3 As RichTextBox + Private WithEvents rtbZeile2 As RichTextBox + Private WithEvents btnBold3 As Button + Private WithEvents btnItalic3 As Button + Private WithEvents btnUnderline3 As Button + Private WithEvents btnTextColor3 As Button + Private WithEvents btnBackColor3 As Button + Private WithEvents btnAlignLeft3 As Button + Private WithEvents btnAlignCenter3 As Button + Private WithEvents btnAlignRight3 As Button + Private WithEvents cmbFontFamily3 As ComboBox + Private WithEvents cmbFontSize3 As ComboBox + Private WithEvents btnBold2 As Button + Private WithEvents btnItalic2 As Button + Private WithEvents btnUnderline2 As Button + Private WithEvents btnTextColor2 As Button + Private WithEvents btnBackColor2 As Button + Private WithEvents btnAlignLeft2 As Button + Private WithEvents btnAlignCenter2 As Button + Private WithEvents btnAlignRight2 As Button + Private WithEvents cmbFontFamily2 As ComboBox + Private WithEvents cmbFontSize2 As ComboBox End Class diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb index 734edc2..0f4b29d 100644 --- a/Aviso/frmEintragTvNew.vb +++ b/Aviso/frmEintragTvNew.vb @@ -12,6 +12,9 @@ Public Class frmEintragTvNew Private isInitializing As Boolean = False + ' **Neue Klassenvariable zur Speicherung der zuletzt ausgewählten TVID** + Private lastSelectedTVID As Integer = 0 + Public Sub New() InitializeComponent() InitializeFontComboBoxes() @@ -89,11 +92,13 @@ Public Class frmEintragTvNew If gefilterteListe.Count > 0 Then dgvAVISOTV.DataSource = gefilterteListe + + ' Anpassen der Spaltenüberschriften dgvAVISOTV.Columns("TvTextBezeichnungID").HeaderText = "ID" dgvAVISOTV.Columns("TvTextBezeichnung").HeaderText = "Bezeichnung" - dgvAVISOTV.Columns("FixeZeile1RTF").HeaderText = "Zeile 1" - dgvAVISOTV.Columns("FixeZeile2").HeaderText = "Zeile 2" - dgvAVISOTV.Columns("FixeZeile3").HeaderText = "Zeile 3" + dgvAVISOTV.Columns("FixeZeile1RTF").HeaderText = "Zeile 1 (Text)" + dgvAVISOTV.Columns("FixeZeile2RTF").HeaderText = "Zeile 2 (Text)" + dgvAVISOTV.Columns("FixeZeile3RTF").HeaderText = "Zeile 3 (Text)" dgvAVISOTV.Columns("Standort").Visible = False dgvAVISOTV.Columns("Art").Visible = False dgvAVISOTV.Columns("StartDate").HeaderText = "Startdatum" @@ -110,11 +115,30 @@ Public Class frmEintragTvNew dgvAVISOTV.Columns("IsSaturday").Visible = False dgvAVISOTV.Columns("IsSunday").Visible = False + ' Hinzufügen des CellFormatting-Handlers + AddHandler dgvAVISOTV.CellFormatting, AddressOf dgvAVISOTV_CellFormatting + dgvAVISOTV.AutoResizeColumns() AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged - If dgvAVISOTV.Rows.Count > 0 Then + ' **Wiederherstellung der Auswahl basierend auf lastSelectedTVID** + If lastSelectedTVID <> 0 Then + Dim rowToSelect = dgvAVISOTV.Rows.Cast(Of DataGridViewRow)().FirstOrDefault(Function(r) CType(r.DataBoundItem, cAvisoTvNew).TvTextBezeichnungID = lastSelectedTVID) + If rowToSelect IsNot Nothing Then + rowToSelect.Selected = True + + dgvAVISOTV.FirstDisplayedScrollingRowIndex = rowToSelect.Index + dgvAVISOTV.CurrentCell = rowToSelect.Cells(0) + Else + ' Falls die TVID nicht gefunden wird, wähle die erste Zeile aus + If dgvAVISOTV.Rows.Count > 0 Then + dgvAVISOTV.Rows(0).Selected = True + dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) + dgvAVISOTV_SelectionChanged(Nothing, Nothing) + End If + End If + ElseIf dgvAVISOTV.Rows.Count > 0 Then dgvAVISOTV.Rows(0).Selected = True dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) dgvAVISOTV_SelectionChanged(Nothing, Nothing) @@ -133,6 +157,27 @@ Public Class frmEintragTvNew End Try End Sub + Private Sub dgvAVISOTV_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) + ' Definieren Sie die Namen der RTF-Spalten + Dim rtfColumns As String() = {"FixeZeile1RTF", "FixeZeile2RTF", "FixeZeile3RTF"} + + ' Überprüfen Sie, ob die aktuelle Spalte eine der RTF-Spalten ist + If rtfColumns.Contains(dgvAVISOTV.Columns(e.ColumnIndex).Name) AndAlso e.Value IsNot Nothing Then + Try + ' Konvertieren Sie den RTF-Text in normalen Text + Using rtb As New RichTextBox() + rtb.Rtf = e.Value.ToString() + e.Value = rtb.Text + e.FormattingApplied = True + End Using + Catch ex As Exception + ' Falls das RTF ungültig ist, zeigen Sie den Originalwert an + e.Value = e.Value.ToString() + e.FormattingApplied = True + End Try + End If + End Sub + Private Sub cbxStandort_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxStandort.SelectedValueChanged If list IsNot Nothing Then list.Clear() @@ -186,8 +231,6 @@ Public Class frmEintragTvNew End Function End Class - - Private Sub cmbTvTextBezeichnungAuswahl_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTvTextBezeichnungAuswahl.SelectedIndexChanged If isInitializing Then Return @@ -218,7 +261,7 @@ Public Class frmEintragTvNew Dim currentStandortID As Integer = AvisoTvNewDAL.GetStandortID(currentStandort) If selectedAviso IsNot Nothing Then - Debug.WriteLine("Gefundenes Aviso: TVID = " & selectedAviso.TVID) + Debug.WriteLine("Gefundenes Aviso: TVID = " & selectedAviso.TvTextBezeichnungID) myAvisoTvNew = selectedAviso Neuanlage = False FillFieldsFromAviso(selectedAviso) @@ -241,12 +284,13 @@ Public Class frmEintragTvNew End Try End Sub - Private Sub InitializeFontComboBoxes() Dim fontFamilies As New List(Of String)() For Each font As FontFamily In FontFamily.Families fontFamilies.Add(font.Name) Next + + ' Initialisierung für Zeile 1 cmbFontFamily.DataSource = fontFamilies cmbFontFamily.SelectedItem = rtbZeile1.Font.FontFamily.Name @@ -257,10 +301,27 @@ Public Class frmEintragTvNew AddHandler cmbFontFamily.SelectedIndexChanged, AddressOf cmbFontFamily_SelectedIndexChanged AddHandler cmbFontSize.SelectedIndexChanged, AddressOf cmbFontSize_SelectedIndexChanged + ' Initialisierung für Zeile 2 + cmbFontFamily2.DataSource = New List(Of String)(fontFamilies) + cmbFontFamily2.SelectedItem = rtbZeile2.Font.FontFamily.Name + + cmbFontSize2.DataSource = sizes.Select(Function(s) s.ToString()).ToList() + cmbFontSize2.SelectedItem = CInt(rtbZeile2.Font.Size).ToString() + + AddHandler cmbFontFamily2.SelectedIndexChanged, AddressOf cmbFontFamily2_SelectedIndexChanged + AddHandler cmbFontSize2.SelectedIndexChanged, AddressOf cmbFontSize2_SelectedIndexChanged + + ' Initialisierung für Zeile 3 + cmbFontFamily3.DataSource = New List(Of String)(fontFamilies) + cmbFontFamily3.SelectedItem = rtbZeile3.Font.FontFamily.Name + + cmbFontSize3.DataSource = sizes.Select(Function(s) s.ToString()).ToList() + cmbFontSize3.SelectedItem = CInt(rtbZeile3.Font.Size).ToString() + + AddHandler cmbFontFamily3.SelectedIndexChanged, AddressOf cmbFontFamily3_SelectedIndexChanged + AddHandler cmbFontSize3.SelectedIndexChanged, AddressOf cmbFontSize3_SelectedIndexChanged End Sub - - ' Schriftfamilie ComboBox SelectionChanged Private Sub cmbFontFamily_SelectedIndexChanged(sender As Object, e As EventArgs) UpdateFont() @@ -270,11 +331,25 @@ Public Class frmEintragTvNew Private Sub cmbFontSize_SelectedIndexChanged(sender As Object, e As EventArgs) UpdateFont() End Sub + Private Sub UpdateFont() - Dim selectedFontFamily As String = If(cmbFontFamily.SelectedItem, rtbZeile1.Font.FontFamily.Name) + Dim selectedFontFamily As String = If(cmbFontFamily.SelectedItem, rtbZeile1.SelectionFont?.FontFamily.Name) Dim selectedFontSize As Single If Single.TryParse(cmbFontSize.SelectedItem, selectedFontSize) Then - rtbZeile1.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile1.Font.Style) + ' Überprüfen, ob eine Auswahl vorhanden ist + If rtbZeile1.SelectionLength > 0 Then + ' Erstellen einer neuen Schriftart basierend auf der Auswahl + Dim currentFont As Font = rtbZeile1.SelectionFont + If currentFont IsNot Nothing Then + rtbZeile1.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) + Else + ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen + rtbZeile1.SelectionFont = New Font(selectedFontFamily, selectedFontSize) + End If + Else + ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox + rtbZeile1.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile1.Font.Style) + End If hatAenderung = True End If End Sub @@ -348,6 +423,208 @@ Public Class frmEintragTvNew hatAenderung = True End Sub + ' Schriftfamilie ComboBox SelectionChanged + Private Sub cmbFontFamily2_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont2() + End Sub + + ' Schriftgröße ComboBox SelectionChanged + Private Sub cmbFontSize2_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont2() + End Sub + + Private Sub UpdateFont2() + Dim selectedFontFamily As String = If(cmbFontFamily2.SelectedItem, rtbZeile2.SelectionFont?.FontFamily.Name) + Dim selectedFontSize As Single + If Single.TryParse(cmbFontSize2.SelectedItem, selectedFontSize) Then + ' Überprüfen, ob eine Auswahl vorhanden ist + If rtbZeile2.SelectionLength > 0 Then + ' Erstellen einer neuen Schriftart basierend auf der Auswahl + Dim currentFont As Font = rtbZeile2.SelectionFont + If currentFont IsNot Nothing Then + rtbZeile2.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) + Else + ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen + rtbZeile2.SelectionFont = New Font(selectedFontFamily, selectedFontSize) + End If + Else + ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox + rtbZeile2.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile2.Font.Style) + End If + hatAenderung = True + End If + End Sub + + ' Methode zum Umschalten des Schriftstils + Private Sub ToggleFontStyle2(style As FontStyle) + If rtbZeile2.SelectionFont IsNot Nothing Then + Dim currentFont As Font = rtbZeile2.SelectionFont + Dim newFontStyle As FontStyle + + If rtbZeile2.SelectionFont.Style.HasFlag(style) Then + ' Entferne den Stil + newFontStyle = currentFont.Style And Not style + Else + ' Füge den Stil hinzu + newFontStyle = currentFont.Style Or style + End If + + ' Setze die neue Schriftart + rtbZeile2.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) + hatAenderung = True + End If + End Sub + + ' Fett (Bold) Button Click + Private Sub btnBold2_Click(sender As Object, e As EventArgs) Handles btnBold2.Click + ToggleFontStyle2(FontStyle.Bold) + End Sub + + ' Kursiv (Italic) Button Click + Private Sub btnItalic2_Click(sender As Object, e As EventArgs) Handles btnItalic2.Click + ToggleFontStyle2(FontStyle.Italic) + End Sub + + ' Unterstrichen (Underline) Button Click + Private Sub btnUnderline2_Click(sender As Object, e As EventArgs) Handles btnUnderline2.Click + ToggleFontStyle2(FontStyle.Underline) + End Sub + + ' Textfarbe ändern Button Click + Private Sub btnTextColor2_Click(sender As Object, e As EventArgs) Handles btnTextColor2.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile2.SelectionColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Hintergrundfarbe ändern Button Click + Private Sub btnBackColor2_Click(sender As Object, e As EventArgs) Handles btnBackColor2.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile2.SelectionBackColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Links ausrichten Button Click + Private Sub btnAlignLeft2_Click(sender As Object, e As EventArgs) Handles btnAlignLeft2.Click + rtbZeile2.SelectionAlignment = HorizontalAlignment.Left + hatAenderung = True + End Sub + + ' Mitte ausrichten Button Click + Private Sub btnAlignCenter2_Click(sender As Object, e As EventArgs) Handles btnAlignCenter2.Click + rtbZeile2.SelectionAlignment = HorizontalAlignment.Center + hatAenderung = True + End Sub + + ' Rechts ausrichten Button Click + Private Sub btnAlignRight2_Click(sender As Object, e As EventArgs) Handles btnAlignRight2.Click + rtbZeile2.SelectionAlignment = HorizontalAlignment.Right + hatAenderung = True + End Sub + + ' Schriftfamilie ComboBox SelectionChanged + Private Sub cmbFontFamily3_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont3() + End Sub + + ' Schriftgröße ComboBox SelectionChanged + Private Sub cmbFontSize3_SelectedIndexChanged(sender As Object, e As EventArgs) + UpdateFont3() + End Sub + + Private Sub UpdateFont3() + Dim selectedFontFamily As String = If(cmbFontFamily3.SelectedItem, rtbZeile3.SelectionFont?.FontFamily.Name) + Dim selectedFontSize As Single + If Single.TryParse(cmbFontSize3.SelectedItem, selectedFontSize) Then + ' Überprüfen, ob eine Auswahl vorhanden ist + If rtbZeile3.SelectionLength > 0 Then + ' Erstellen einer neuen Schriftart basierend auf der Auswahl + Dim currentFont As Font = rtbZeile3.SelectionFont + If currentFont IsNot Nothing Then + rtbZeile3.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) + Else + ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen + rtbZeile3.SelectionFont = New Font(selectedFontFamily, selectedFontSize) + End If + Else + ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox + rtbZeile3.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile3.Font.Style) + End If + hatAenderung = True + End If + End Sub + + ' Methode zum Umschalten des Schriftstils + Private Sub ToggleFontStyle3(style As FontStyle) + If rtbZeile3.SelectionFont IsNot Nothing Then + Dim currentFont As Font = rtbZeile3.SelectionFont + Dim newFontStyle As FontStyle + + If rtbZeile3.SelectionFont.Style.HasFlag(style) Then + ' Entferne den Stil + newFontStyle = currentFont.Style And Not style + Else + ' Füge den Stil hinzu + newFontStyle = currentFont.Style Or style + End If + + ' Setze die neue Schriftart + rtbZeile3.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) + hatAenderung = True + End If + End Sub + + ' Fett (Bold) Button Click + Private Sub btnBold3_Click(sender As Object, e As EventArgs) Handles btnBold3.Click + ToggleFontStyle3(FontStyle.Bold) + End Sub + + ' Kursiv (Italic) Button Click + Private Sub btnItalic3_Click(sender As Object, e As EventArgs) Handles btnItalic3.Click + ToggleFontStyle3(FontStyle.Italic) + End Sub + + ' Unterstrichen (Underline) Button Click + Private Sub btnUnderline3_Click(sender As Object, e As EventArgs) Handles btnUnderline3.Click + ToggleFontStyle3(FontStyle.Underline) + End Sub + + ' Textfarbe ändern Button Click + Private Sub btnTextColor3_Click(sender As Object, e As EventArgs) Handles btnTextColor3.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile3.SelectionColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Hintergrundfarbe ändern Button Click + Private Sub btnBackColor3_Click(sender As Object, e As EventArgs) Handles btnBackColor3.Click + If colorDialogText.ShowDialog() = DialogResult.OK Then + rtbZeile3.SelectionBackColor = colorDialogText.Color + hatAenderung = True + End If + End Sub + + ' Links ausrichten Button Click + Private Sub btnAlignLeft3_Click(sender As Object, e As EventArgs) Handles btnAlignLeft3.Click + rtbZeile3.SelectionAlignment = HorizontalAlignment.Left + hatAenderung = True + End Sub + + ' Mitte ausrichten Button Click + Private Sub btnAlignCenter3_Click(sender As Object, e As EventArgs) Handles btnAlignCenter3.Click + rtbZeile3.SelectionAlignment = HorizontalAlignment.Center + hatAenderung = True + End Sub + + ' Rechts ausrichten Button Click + Private Sub btnAlignRight3_Click(sender As Object, e As EventArgs) Handles btnAlignRight3.Click + rtbZeile3.SelectionAlignment = HorizontalAlignment.Right + hatAenderung = True + End Sub + Private Sub LadeTvTextBezeichnungen() isInitializing = True Dim bezeichnungen As New List(Of cTvTextBezeichnung)() @@ -407,8 +684,8 @@ Public Class frmEintragTvNew ' Hier setzt du die Textzeilen, wenn vorhanden rtbZeile1.Rtf = aviso.FixeZeile1RTF - txtZeile2.Text = aviso.FixeZeile2 - txtZeile3.Text = aviso.FixeZeile3 + rtbZeile2.Rtf = aviso.FixeZeile2RTF + rtbZeile3.Rtf = aviso.FixeZeile3RTF chkIsRecurring.Checked = aviso.IsRecurring.GetValueOrDefault(False) @@ -454,23 +731,6 @@ Public Class frmEintragTvNew chkIsActive.Checked = aviso.IsActive - ' Text-Einstellungen anwenden - cmbFontFamily.SelectedItem = aviso.FontFamily - cmbFontSize.SelectedItem = aviso.FontSize.ToString() - rtbZeile1.SelectionFont = New Font(aviso.FontFamily, aviso.FontSize, CType([Enum].Parse(GetType(FontStyle), aviso.FontStyle), FontStyle)) - rtbZeile1.SelectionColor = Color.FromName(aviso.TextColor) - rtbZeile1.BackColor = Color.FromName(aviso.BackColor) - - Select Case aviso.TextAlignment - Case "Left" - rtbZeile1.SelectionAlignment = HorizontalAlignment.Left - Case "Center" - rtbZeile1.SelectionAlignment = HorizontalAlignment.Center - Case "Right" - rtbZeile1.SelectionAlignment = HorizontalAlignment.Right - Case Else - rtbZeile1.SelectionAlignment = HorizontalAlignment.Left - End Select grpWochentage.Enabled = chkIsRecurring.Checked End Sub @@ -483,87 +743,135 @@ Public Class frmEintragTvNew ' Initialisiere die HTML-Struktur sb.Append("") - Dim currentFont As System.Drawing.Font = rtb.SelectionFont - Dim currentColor As Color = rtb.SelectionColor - Dim currentAlignment As HorizontalAlignment = rtb.SelectionAlignment + ' Teile den Text in Absätze auf + Dim paragraphs As String() = rtb.Text.Split(New String() {vbCrLf, vbLf}, StringSplitOptions.None) - Dim text As String = rtb.Text - Dim index As Integer = 0 + Dim charIndex As Integer = 0 - While index < text.Length - rtb.Select(index, 1) - Dim font As System.Drawing.Font = rtb.SelectionFont - Dim color As Color = rtb.SelectionColor + For Each paragraph As String In paragraphs + ' Wähle den aktuellen Absatz aus + rtb.Select(charIndex, paragraph.Length) + + ' Erhalte die Ausrichtung des aktuellen Absatzes Dim alignment As HorizontalAlignment = rtb.SelectionAlignment - ' Beginne neue Tags, wenn sich das Format ändert - If font IsNot currentFont Then - ' Schließe vorherige Font-Tags - If currentFont IsNot Nothing Then - sb.Append("") - End If - - ' Öffne neue Font-Tags - sb.Append("") - sb.Append("") - - currentFont = font - currentColor = color - End If - - If alignment <> currentAlignment Then - ' Schließe vorherige Ausrichtung - Select Case currentAlignment - Case HorizontalAlignment.Left, HorizontalAlignment.Center, HorizontalAlignment.Right - sb.Append("
") - End Select - - ' Öffne neue Ausrichtung - Select Case alignment - Case HorizontalAlignment.Left - sb.Append("
") - Case HorizontalAlignment.Center - sb.Append("
") - Case HorizontalAlignment.Right - sb.Append("
") - End Select - - currentAlignment = alignment - End If - - ' Füge das aktuelle Zeichen hinzu (HTML-encodiert) - Dim currentChar As Char = text(index) - Select Case currentChar - Case "<" - sb.Append("<") - Case ">" - sb.Append(">") - Case "&" - sb.Append("&") + ' Öffne einen Div-Tag mit der entsprechenden Textausrichtung + Select Case alignment + Case HorizontalAlignment.Left + sb.Append("
") + Case HorizontalAlignment.Center + sb.Append("
") + Case HorizontalAlignment.Right + sb.Append("
") Case Else - sb.Append(currentChar) + sb.Append("
") End Select - index += 1 - End While + ' Setze die aktuellen Formatierungsvariablen auf Nothing/Empty, um beim ersten Zeichen zu starten + Dim currentFont As System.Drawing.Font = Nothing + Dim currentColor As Color = Color.Empty + Dim currentBackColor As Color = Color.Empty + Dim currentBold As Boolean = False + Dim currentItalic As Boolean = False + Dim currentUnderline As Boolean = False - ' Schließe verbleibende Tags - If currentFont IsNot Nothing Then - sb.Append("") - End If + ' Iteriere durch die Zeichen im Absatz + For i As Integer = 0 To paragraph.Length - 1 + Dim globalIndex As Integer = charIndex + i + rtb.Select(globalIndex, 1) + Dim font As System.Drawing.Font = rtb.SelectionFont + Dim color As Color = rtb.SelectionColor + Dim backColor As Color = rtb.SelectionBackColor - Select Case currentAlignment - Case HorizontalAlignment.Left, HorizontalAlignment.Center, HorizontalAlignment.Right - sb.Append("
") - End Select + ' Bestimme die Schriftstile + Dim isBold As Boolean = font IsNot Nothing AndAlso font.Bold + Dim isItalic As Boolean = font IsNot Nothing AndAlso font.Italic + Dim isUnderline As Boolean = font IsNot Nothing AndAlso font.Underline + + ' Überprüfe, ob sich die Formatierung geändert hat + If font IsNot currentFont OrElse color <> currentColor OrElse backColor <> currentBackColor OrElse isBold <> currentBold OrElse isItalic <> currentItalic OrElse isUnderline <> currentUnderline Then + ' Schließe vorherige Font-, Farb- und Hintergrundfarb-Tags + If currentFont IsNot Nothing OrElse color <> Color.Empty OrElse backColor <> Color.Empty OrElse currentBold OrElse currentItalic OrElse currentUnderline Then + sb.Append("") + End If + + ' Öffne ein neues Span-Tag mit den aktuellen Stilen + Dim style As New System.Text.StringBuilder() + + If font IsNot Nothing Then + style.Append($"font-family:{font.FontFamily.Name}; ") + style.Append($"font-size:{font.SizeInPoints}pt; ") + End If + + If color <> Color.Empty Then + style.Append($"color:{ColorTranslator.ToHtml(color)}; ") + End If + + If backColor <> Color.Empty Then + style.Append($"background-color:{ColorTranslator.ToHtml(backColor)}; ") + End If + + If isBold Then + style.Append($"font-weight:bold; ") + End If + + If isItalic Then + style.Append($"font-style:italic; ") + End If + + If isUnderline Then + style.Append($"text-decoration:underline; ") + End If + + If style.Length > 0 Then + sb.Append($"") + End If + + ' Aktualisiere die aktuellen Formatierungsvariablen + currentFont = font + currentColor = color + currentBackColor = backColor + currentBold = isBold + currentItalic = isItalic + currentUnderline = isUnderline + End If + + ' Füge das aktuelle Zeichen hinzu (HTML-encodiert) + Dim currentChar As Char = paragraph(i) + Select Case currentChar + Case "<" + sb.Append("<") + Case ">" + sb.Append(">") + Case "&" + sb.Append("&") + Case Else + sb.Append(currentChar) + End Select + Next + + ' Schließe verbleibende Tags im Absatz + If currentFont IsNot Nothing OrElse currentColor <> Color.Empty OrElse currentBackColor <> Color.Empty OrElse currentBold OrElse currentItalic OrElse currentUnderline Then + sb.Append("") + End If + + ' Schließe den Div-Tag für den Absatz + sb.Append("
") + + ' Aktualisiere den charIndex für den nächsten Absatz (+2 für vbCrLf, könnte je nach Zeilenumbrüchen variieren) + ' Überprüfe den tatsächlichen Zeilenumbruch und passe gegebenenfalls an + If charIndex + paragraph.Length + 2 <= rtb.Text.Length Then + charIndex += paragraph.Length + 2 ' Annahme: \r\n als Zeilenumbruch + Else + charIndex += paragraph.Length + End If + Next sb.Append("") Return sb.ToString() End Using End Function - - Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click Dim verwendeteTvTextBezeichnung As String = "" Dim isNeueTvTextBezeichnung As Boolean = False @@ -594,10 +902,21 @@ Public Class frmEintragTvNew End If Try + ' **Speichern der TVID der aktuell ausgewählten Zeile** + If dgvAVISOTV.CurrentRow IsNot Nothing AndAlso dgvAVISOTV.CurrentRow.DataBoundItem IsNot Nothing Then + Dim selectedAviso As cAvisoTvNew = CType(dgvAVISOTV.CurrentRow.DataBoundItem, cAvisoTvNew) + If selectedAviso IsNot Nothing Then + lastSelectedTVID = selectedAviso.TvTextBezeichnungID + End If + End If + ' Konvertiere RTF zu HTML Dim rtfContent As String = rtbZeile1.Rtf Dim htmlContent As String = ConvertRtfToHtml(rtfContent) - + Dim rtfContent2 As String = rtbZeile2.Rtf + Dim htmlContent2 As String = ConvertRtfToHtml(rtfContent2) + Dim rtfContent3 As String = rtbZeile3.Rtf + Dim htmlContent3 As String = ConvertRtfToHtml(rtfContent3) myAvisoTvNew.TvTextBezeichnung = verwendeteTvTextBezeichnung myAvisoTvNew.StandortID = currentStandortID If cmbPosition.SelectedIndex >= 0 Then @@ -618,8 +937,10 @@ Public Class frmEintragTvNew ' Speichere den HTML-Inhalt myAvisoTvNew.FixeZeile1RTF = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, rtfContent) myAvisoTvNew.FixeZeile1HTML = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, htmlContent) - myAvisoTvNew.FixeZeile2 = If(String.IsNullOrWhiteSpace(txtZeile2.Text), Nothing, txtZeile2.Text.Trim()) - myAvisoTvNew.FixeZeile3 = If(String.IsNullOrWhiteSpace(txtZeile3.Text), Nothing, txtZeile3.Text.Trim()) + myAvisoTvNew.FixeZeile2RTF = If(String.IsNullOrWhiteSpace(rtbZeile2.Text), Nothing, rtfContent2) + myAvisoTvNew.FixeZeile2HTML = If(String.IsNullOrWhiteSpace(rtbZeile2.Text), Nothing, htmlContent2) + myAvisoTvNew.FixeZeile3RTF = If(String.IsNullOrWhiteSpace(rtbZeile3.Text), Nothing, rtfContent3) + myAvisoTvNew.FixeZeile3HTML = If(String.IsNullOrWhiteSpace(rtbZeile3.Text), Nothing, htmlContent3) myAvisoTvNew.IsRecurring = chkIsRecurring.Checked @@ -639,7 +960,6 @@ Public Class frmEintragTvNew myAvisoTvNew.IsActive = chkIsActive.Checked - If Neuanlage Then myAvisoTvNew.Standort = cbxStandort.SelectedItem?.ToString() If String.IsNullOrEmpty(myAvisoTvNew.Standort) Then @@ -648,7 +968,7 @@ Public Class frmEintragTvNew End If End If - Debug.WriteLine($"Speichern: TVID = {myAvisoTvNew.TVID}, TvTextBezeichnungID = {myAvisoTvNew.TvTextBezeichnungID}, StandortID = {myAvisoTvNew.StandortID}") + Debug.WriteLine($"Speichern: TVID = {myAvisoTvNew.TvTextBezeichnungID}, TvTextBezeichnungID = {myAvisoTvNew.TvTextBezeichnungID}, StandortID = {myAvisoTvNew.StandortID}") ' Speichern der Einstellungen AvisoTvNewDAL.SpeichernAvisoTvNew(myAvisoTvNew) @@ -658,10 +978,13 @@ Public Class frmEintragTvNew list.Clear() AvisoTvNewDAL.LesenAvisoTvNew(0, "", currentStandort, list) + ' **Nach dem Speichern und Neuladen der Daten** initdgv() hatAenderung = False If isNeueTvTextBezeichnung Then + ' **Setze lastSelectedTVID auf die TVID des neuen Eintrags** + lastSelectedTVID = myAvisoTvNew.TvTextBezeichnungID MessageBox.Show("Die neue TvTextBezeichnung wurde erfolgreich gespeichert.", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) cmbTvTextBezeichnungAuswahl.SelectedValue = myAvisoTvNew.TvTextBezeichnungID txtNeueTvTextBezeichnung.Text = "" @@ -674,10 +997,8 @@ Public Class frmEintragTvNew End Try End Sub - - Private Sub btnLoeschen_Click(sender As Object, e As EventArgs) Handles btnLoeschen.Click - If myAvisoTvNew Is Nothing OrElse myAvisoTvNew.TVID = 0 Then + If myAvisoTvNew Is Nothing OrElse myAvisoTvNew.TvTextBezeichnungID = 0 Then MessageBox.Show("Bitte wählen Sie einen Eintrag zum Deaktivieren aus.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information) Return End If @@ -685,7 +1006,7 @@ Public Class frmEintragTvNew Dim antwort As DialogResult = MessageBox.Show("Möchten Sie den ausgewählten Eintrag wirklich deaktivieren?", "Deaktivieren bestätigen", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) If antwort = DialogResult.Yes Then Try - AvisoTvNewDAL.SetzeAufInaktiv(myAvisoTvNew.TVID) + AvisoTvNewDAL.SetzeAufInaktiv(myAvisoTvNew.TvTextBezeichnungID) list.Clear() AvisoTvNewDAL.LesenAvisoTvNew(0, "", cbxStandort.SelectedItem?.ToString(), list) initdgv() @@ -721,7 +1042,7 @@ Public Class frmEintragTvNew Me.Close() End Sub - Private Sub txt_TextChanged(sender As Object, e As EventArgs) Handles rtbZeile1.TextChanged, txtZeile2.TextChanged, txtZeile3.TextChanged, dtpStartDate.ValueChanged, dtpEndDate.ValueChanged, dtpStartTime.ValueChanged, dtpEndTime.ValueChanged, chkIsRecurring.CheckedChanged, chkMonday.CheckedChanged, chkTuesday.CheckedChanged, chkWednesday.CheckedChanged, chkThursday.CheckedChanged, chkFriday.CheckedChanged, chkSaturday.CheckedChanged, chkSunday.CheckedChanged, chkIsActive.CheckedChanged, cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, txtNeueTvTextBezeichnung.TextChanged + Private Sub txt_TextChanged(sender As Object, e As EventArgs) Handles rtbZeile1.TextChanged, dtpStartDate.ValueChanged, dtpEndDate.ValueChanged, dtpStartTime.ValueChanged, dtpEndTime.ValueChanged, chkIsRecurring.CheckedChanged, chkMonday.CheckedChanged, chkTuesday.CheckedChanged, chkWednesday.CheckedChanged, chkThursday.CheckedChanged, chkFriday.CheckedChanged, chkSaturday.CheckedChanged, chkSunday.CheckedChanged, chkIsActive.CheckedChanged, cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, txtNeueTvTextBezeichnung.TextChanged hatAenderung = True End Sub @@ -741,8 +1062,8 @@ Public Class frmEintragTvNew cmbPosition.SelectedIndex = -1 txtNeueTvTextBezeichnung.Text = "" rtbZeile1.Text = "" - txtZeile2.Text = "" - txtZeile3.Text = "" + rtbZeile2.Text = "" + rtbZeile3.Text = "" dtpStartDate.Value = DateTime.Now dtpStartDate.Checked = False dtpEndDate.Value = DateTime.Now From 3f74e845bb431bcfa70a29d850c495726b759bec Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Mon, 9 Dec 2024 17:43:40 +0100 Subject: [PATCH 5/7] TvSettingsNew --- Aviso/App.config | 70 +- Aviso/Aviso.vbproj | 9 + Aviso/My Project/AssemblyInfo.vb | 4 +- Aviso/bin/Debug/Resources/ambar_boarder.png | Bin 23129 -> 0 bytes Aviso/frmEintragTvNew.Designer.vb | 495 ++++------- Aviso/frmEintragTvNew.resx | 3 + Aviso/frmEintragTvNew.vb | 888 ++++++++++---------- Aviso/frmTvSettings.Designer.vb | 286 +++++++ Aviso/frmTvSettings.resx | 120 +++ Aviso/frmTvSettings.vb | 139 +++ AvisoTV/frmAnzeige.vb | 2 +- 11 files changed, 1194 insertions(+), 822 deletions(-) delete mode 100644 Aviso/bin/Debug/Resources/ambar_boarder.png create mode 100644 Aviso/frmTvSettings.Designer.vb create mode 100644 Aviso/frmTvSettings.resx create mode 100644 Aviso/frmTvSettings.vb diff --git a/Aviso/App.config b/Aviso/App.config index a1e778d..5a90c87 100644 --- a/Aviso/App.config +++ b/Aviso/App.config @@ -1,15 +1,15 @@ - + -
+
- + - + @@ -21,55 +21,75 @@ 200, 200 - + - + - + - - + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/Aviso/Aviso.vbproj b/Aviso/Aviso.vbproj index 8a1a7be..1fd998b 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -964,6 +964,12 @@ Form + + frmTvSettings.vb + + + Form + frmWarenbezeichnungBegriffe.vb @@ -1414,6 +1420,9 @@ frmTv.vb + + frmTvSettings.vb + frmWarenbezeichnungBegriffe.vb diff --git a/Aviso/My Project/AssemblyInfo.vb b/Aviso/My Project/AssemblyInfo.vb index 25d4a6f..4f4f35e 100644 --- a/Aviso/My Project/AssemblyInfo.vb +++ b/Aviso/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Aviso/bin/Debug/Resources/ambar_boarder.png b/Aviso/bin/Debug/Resources/ambar_boarder.png deleted file mode 100644 index bc0c10130a2833f84f81c8447fa0a8181ce1eef0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23129 zcmV)&K#aeMP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXfS?)7e@Xx5}D2KVk|`Biod=-bco4KO}l z8EJumhHdrNf>s7sLv;M1zsWWy z?whT?>o;JkSPh<@o;Y#h1j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50QUU8j8I8(IZEx90YdlJ1U`Jxdq z4qv)Hfy55PV@XIJOJ-uqC+q8w$(iPf$LgS}NzH=SCwL4i=;+rk4m>ya=Xp7Tv++B( zF;^PF`{G0zpPAnYo}161KMO}d7B*x@=ihjJK6Al20*;pYJK}wFUp@;n(C}~8;Pdc! z>xoU$gV*8p^ylMoJRj+zzXO5-llQ<(K?P}56nHM{cR~74+tb1KK=qdA?qP-q=6%YZJV8 z-#b1cbbe74XiCD}Fn;Nw-A`OX2G(vnj_+E}!}ISAkr8_Up84BgJpb-6yzu@=FbeOf zHwI$<3J+xp?Gbyv$FS9?{`MgJ*nR;V9FHSiOq~aXVpV->aD<{=T2MtUM>!}YM~nK- zf+<6X428RxFaJ%jb|VKRPDXQ{fkjwL18NJLv*2X*e+!wJ88FAiBPu!;QN}n#o8m-B zly2_jexlTjUygE=<9`R`j9-p&`~gwU_~j_a9}d9(0r2+UZ|o}wt^fc407*qoM6N<$ Ef)~5i_y7O^ diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb index c195513..51297e9 100644 --- a/Aviso/frmEintragTvNew.Designer.vb +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -15,48 +15,80 @@ Partial Class frmEintragTvNew Private components As System.ComponentModel.IContainer + ' Deklaration der Steuerelemente + Friend WithEvents cbxStandort As ComboBox + Friend WithEvents lblStandort As Label + Friend WithEvents dgvAVISOTV As DataGridView + Friend WithEvents grpEingabe As GroupBox + Friend WithEvents lblNeueTvTextBezeichnung As Label + Friend WithEvents txtNeueTvTextBezeichnung As TextBox + Friend WithEvents chkIsActive As CheckBox + Friend WithEvents chkIsRecurring As CheckBox + Friend WithEvents grpWochentage As GroupBox + Friend WithEvents chkSunday As CheckBox + Friend WithEvents chkSaturday As CheckBox + Friend WithEvents chkFriday As CheckBox + Friend WithEvents chkThursday As CheckBox + Friend WithEvents chkWednesday As CheckBox + Friend WithEvents chkTuesday As CheckBox + Friend WithEvents chkMonday As CheckBox + Friend WithEvents dtpEndTime As DateTimePicker + Friend WithEvents lblEndTime As Label + Friend WithEvents dtpStartTime As DateTimePicker + Friend WithEvents lblStartTime As Label + Friend WithEvents dtpEndDate As DateTimePicker + Friend WithEvents lblEndDate As Label + Friend WithEvents dtpStartDate As DateTimePicker + Friend WithEvents lblStartDate As Label + Friend WithEvents lblZeile1 As Label + Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox + Friend WithEvents lblBezeichnung As Label + Friend WithEvents lblPosition As Label + Friend WithEvents cmbPosition As ComboBox + Friend WithEvents btnSpeichern As Button + Friend WithEvents btnLoeschen As Button + Friend WithEvents btnAbbrechen As Button + Friend WithEvents chkShowInactive As CheckBox + ' Neue Komponenten für Textformatierung - Private WithEvents btnBold As Button - Private WithEvents btnItalic As Button - Private WithEvents btnUnderline As Button - Private WithEvents btnTextColor As Button - Private WithEvents btnBackColor As Button - Private WithEvents btnAlignLeft As Button - Private WithEvents btnAlignCenter As Button - Private WithEvents btnAlignRight As Button - Private WithEvents cmbFontFamily As ComboBox - Private WithEvents cmbFontSize As ComboBox - Private WithEvents colorDialogText As ColorDialog - Private WithEvents rtbZeile1 As RichTextBox ' Geänderte TextBox zu RichTextBox + Friend WithEvents btnBold As Button + Friend WithEvents btnItalic As Button + Friend WithEvents btnUnderline As Button + Friend WithEvents btnTextColor As Button + Friend WithEvents btnBackColor As Button + Friend WithEvents btnAlignLeft As Button + Friend WithEvents btnAlignCenter As Button + Friend WithEvents btnAlignRight As Button + Friend WithEvents cmbFontFamily As ComboBox + Friend WithEvents cmbFontSize As ComboBox + Friend WithEvents colorDialogText As ColorDialog + + ' TabControl und RichTextBoxen + Friend WithEvents tabControlZeilen As TabControl + Friend WithEvents tabPageZeile1 As TabPage + Friend WithEvents tabPageZeile2 As TabPage + Friend WithEvents tabPageZeile3 As TabPage + Friend WithEvents rtbZeile1 As RichTextBox + Friend WithEvents rtbZeile2 As RichTextBox + Friend WithEvents rtbZeile3 As RichTextBox + + Friend WithEvents btnOpenSettings As Button + Private Sub InitializeComponent() + Me.btnOpenSettings = New System.Windows.Forms.Button() Me.cbxStandort = New System.Windows.Forms.ComboBox() Me.lblStandort = New System.Windows.Forms.Label() Me.dgvAVISOTV = New System.Windows.Forms.DataGridView() Me.grpEingabe = New System.Windows.Forms.GroupBox() - Me.btnBold3 = New System.Windows.Forms.Button() - Me.btnItalic3 = New System.Windows.Forms.Button() - Me.btnUnderline3 = New System.Windows.Forms.Button() - Me.btnTextColor3 = New System.Windows.Forms.Button() - Me.btnBackColor3 = New System.Windows.Forms.Button() - Me.btnAlignLeft3 = New System.Windows.Forms.Button() - Me.btnAlignCenter3 = New System.Windows.Forms.Button() - Me.btnAlignRight3 = New System.Windows.Forms.Button() - Me.cmbFontFamily3 = New System.Windows.Forms.ComboBox() - Me.cmbFontSize3 = New System.Windows.Forms.ComboBox() - Me.btnBold2 = New System.Windows.Forms.Button() - Me.btnItalic2 = New System.Windows.Forms.Button() - Me.btnUnderline2 = New System.Windows.Forms.Button() - Me.btnTextColor2 = New System.Windows.Forms.Button() - Me.btnBackColor2 = New System.Windows.Forms.Button() - Me.btnAlignLeft2 = New System.Windows.Forms.Button() - Me.btnAlignCenter2 = New System.Windows.Forms.Button() - Me.btnAlignRight2 = New System.Windows.Forms.Button() - Me.cmbFontFamily2 = New System.Windows.Forms.ComboBox() - Me.cmbFontSize2 = New System.Windows.Forms.ComboBox() - Me.rtbZeile3 = New System.Windows.Forms.RichTextBox() + Me.tabControlZeilen = New System.Windows.Forms.TabControl() + Me.tabPageZeile1 = New System.Windows.Forms.TabPage() + Me.rtbZeile1 = New System.Windows.Forms.RichTextBox() + Me.tabPageZeile2 = New System.Windows.Forms.TabPage() Me.rtbZeile2 = New System.Windows.Forms.RichTextBox() + Me.tabPageZeile3 = New System.Windows.Forms.TabPage() + Me.rtbZeile3 = New System.Windows.Forms.RichTextBox() Me.lblNeueTvTextBezeichnung = New System.Windows.Forms.Label() Me.txtNeueTvTextBezeichnung = New System.Windows.Forms.TextBox() Me.chkIsActive = New System.Windows.Forms.CheckBox() @@ -77,9 +109,6 @@ Partial Class frmEintragTvNew Me.lblEndDate = New System.Windows.Forms.Label() Me.dtpStartDate = New System.Windows.Forms.DateTimePicker() Me.lblStartDate = New System.Windows.Forms.Label() - Me.lblZeile3 = New System.Windows.Forms.Label() - Me.lblZeile2 = New System.Windows.Forms.Label() - Me.rtbZeile1 = New System.Windows.Forms.RichTextBox() Me.lblZeile1 = New System.Windows.Forms.Label() Me.cmbTvTextBezeichnungAuswahl = New System.Windows.Forms.ComboBox() Me.lblBezeichnung = New System.Windows.Forms.Label() @@ -102,8 +131,21 @@ Partial Class frmEintragTvNew Me.colorDialogText = New System.Windows.Forms.ColorDialog() CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpEingabe.SuspendLayout() + Me.tabControlZeilen.SuspendLayout() + Me.tabPageZeile1.SuspendLayout() + Me.tabPageZeile2.SuspendLayout() + Me.tabPageZeile3.SuspendLayout() Me.grpWochentage.SuspendLayout() Me.SuspendLayout() + + Me.btnOpenSettings.Location = New System.Drawing.Point(15, 1010) + Me.btnOpenSettings.Name = "btnOpenSettings" + Me.btnOpenSettings.Size = New System.Drawing.Size(150, 30) + Me.btnOpenSettings.TabIndex = 8 + Me.btnOpenSettings.Text = "TV Einstellungen" + Me.btnOpenSettings.UseVisualStyleBackColor = True + + ' 'cbxStandort ' @@ -138,28 +180,7 @@ Partial Class frmEintragTvNew ' 'grpEingabe ' - Me.grpEingabe.Controls.Add(Me.btnBold3) - Me.grpEingabe.Controls.Add(Me.btnItalic3) - Me.grpEingabe.Controls.Add(Me.btnUnderline3) - Me.grpEingabe.Controls.Add(Me.btnTextColor3) - Me.grpEingabe.Controls.Add(Me.btnBackColor3) - Me.grpEingabe.Controls.Add(Me.btnAlignLeft3) - Me.grpEingabe.Controls.Add(Me.btnAlignCenter3) - Me.grpEingabe.Controls.Add(Me.btnAlignRight3) - Me.grpEingabe.Controls.Add(Me.cmbFontFamily3) - Me.grpEingabe.Controls.Add(Me.cmbFontSize3) - Me.grpEingabe.Controls.Add(Me.btnBold2) - Me.grpEingabe.Controls.Add(Me.btnItalic2) - Me.grpEingabe.Controls.Add(Me.btnUnderline2) - Me.grpEingabe.Controls.Add(Me.btnTextColor2) - Me.grpEingabe.Controls.Add(Me.btnBackColor2) - Me.grpEingabe.Controls.Add(Me.btnAlignLeft2) - Me.grpEingabe.Controls.Add(Me.btnAlignCenter2) - Me.grpEingabe.Controls.Add(Me.btnAlignRight2) - Me.grpEingabe.Controls.Add(Me.cmbFontFamily2) - Me.grpEingabe.Controls.Add(Me.cmbFontSize2) - Me.grpEingabe.Controls.Add(Me.rtbZeile3) - Me.grpEingabe.Controls.Add(Me.rtbZeile2) + Me.grpEingabe.Controls.Add(Me.tabControlZeilen) Me.grpEingabe.Controls.Add(Me.lblNeueTvTextBezeichnung) Me.grpEingabe.Controls.Add(Me.txtNeueTvTextBezeichnung) Me.grpEingabe.Controls.Add(Me.chkIsActive) @@ -173,9 +194,6 @@ Partial Class frmEintragTvNew Me.grpEingabe.Controls.Add(Me.lblEndDate) Me.grpEingabe.Controls.Add(Me.dtpStartDate) Me.grpEingabe.Controls.Add(Me.lblStartDate) - Me.grpEingabe.Controls.Add(Me.lblZeile3) - Me.grpEingabe.Controls.Add(Me.lblZeile2) - Me.grpEingabe.Controls.Add(Me.rtbZeile1) Me.grpEingabe.Controls.Add(Me.lblZeile1) Me.grpEingabe.Controls.Add(Me.cmbTvTextBezeichnungAuswahl) Me.grpEingabe.Controls.Add(Me.lblBezeichnung) @@ -198,202 +216,77 @@ Partial Class frmEintragTvNew Me.grpEingabe.TabStop = False Me.grpEingabe.Text = "Informationen eingeben" ' - 'btnBold3 + 'tabControlZeilen ' - Me.btnBold3.Location = New System.Drawing.Point(100, 449) - Me.btnBold3.Name = "btnBold3" - Me.btnBold3.Size = New System.Drawing.Size(30, 30) - Me.btnBold3.TabIndex = 45 - Me.btnBold3.Text = "B" - Me.btnBold3.UseVisualStyleBackColor = True + Me.tabControlZeilen.Controls.Add(Me.tabPageZeile1) + Me.tabControlZeilen.Controls.Add(Me.tabPageZeile2) + Me.tabControlZeilen.Controls.Add(Me.tabPageZeile3) + Me.tabControlZeilen.Location = New System.Drawing.Point(40, 100) + Me.tabControlZeilen.Name = "tabControlZeilen" + Me.tabControlZeilen.SelectedIndex = 0 + Me.tabControlZeilen.Size = New System.Drawing.Size(1235, 332) + Me.tabControlZeilen.TabIndex = 35 ' - 'btnItalic3 + 'tabPageZeile1 ' - Me.btnItalic3.Location = New System.Drawing.Point(140, 449) - Me.btnItalic3.Name = "btnItalic3" - Me.btnItalic3.Size = New System.Drawing.Size(30, 30) - Me.btnItalic3.TabIndex = 46 - Me.btnItalic3.Text = "I" - Me.btnItalic3.UseVisualStyleBackColor = True + Me.tabPageZeile1.Controls.Add(Me.rtbZeile1) + Me.tabPageZeile1.Location = New System.Drawing.Point(4, 22) + Me.tabPageZeile1.Name = "tabPageZeile1" + Me.tabPageZeile1.Padding = New System.Windows.Forms.Padding(3) + Me.tabPageZeile1.Size = New System.Drawing.Size(1227, 306) + Me.tabPageZeile1.TabIndex = 0 + Me.tabPageZeile1.Text = "Deutsch" + Me.tabPageZeile1.UseVisualStyleBackColor = True ' - 'btnUnderline3 + 'rtbZeile1 ' - Me.btnUnderline3.Location = New System.Drawing.Point(180, 449) - Me.btnUnderline3.Name = "btnUnderline3" - Me.btnUnderline3.Size = New System.Drawing.Size(30, 30) - Me.btnUnderline3.TabIndex = 47 - Me.btnUnderline3.Text = "U" - Me.btnUnderline3.UseVisualStyleBackColor = True + Me.rtbZeile1.Dock = System.Windows.Forms.DockStyle.Fill + Me.rtbZeile1.Location = New System.Drawing.Point(3, 3) + Me.rtbZeile1.Name = "rtbZeile1" + Me.rtbZeile1.Size = New System.Drawing.Size(1221, 300) + Me.rtbZeile1.TabIndex = 0 + Me.rtbZeile1.Text = "" ' - 'btnTextColor3 + 'tabPageZeile2 ' - Me.btnTextColor3.Location = New System.Drawing.Point(302, 449) - Me.btnTextColor3.Name = "btnTextColor3" - Me.btnTextColor3.Size = New System.Drawing.Size(30, 30) - Me.btnTextColor3.TabIndex = 48 - Me.btnTextColor3.Text = "A" - Me.btnTextColor3.UseVisualStyleBackColor = True - ' - 'btnBackColor3 - ' - Me.btnBackColor3.Location = New System.Drawing.Point(342, 449) - Me.btnBackColor3.Name = "btnBackColor3" - Me.btnBackColor3.Size = New System.Drawing.Size(30, 30) - Me.btnBackColor3.TabIndex = 49 - Me.btnBackColor3.Text = "BG" - Me.btnBackColor3.UseVisualStyleBackColor = True - ' - 'btnAlignLeft3 - ' - Me.btnAlignLeft3.Location = New System.Drawing.Point(471, 449) - Me.btnAlignLeft3.Name = "btnAlignLeft3" - Me.btnAlignLeft3.Size = New System.Drawing.Size(30, 30) - Me.btnAlignLeft3.TabIndex = 50 - Me.btnAlignLeft3.Text = "L" - Me.btnAlignLeft3.UseVisualStyleBackColor = True - ' - 'btnAlignCenter3 - ' - Me.btnAlignCenter3.Location = New System.Drawing.Point(511, 449) - Me.btnAlignCenter3.Name = "btnAlignCenter3" - Me.btnAlignCenter3.Size = New System.Drawing.Size(30, 30) - Me.btnAlignCenter3.TabIndex = 51 - Me.btnAlignCenter3.Text = "C" - Me.btnAlignCenter3.UseVisualStyleBackColor = True - ' - 'btnAlignRight3 - ' - Me.btnAlignRight3.Location = New System.Drawing.Point(551, 449) - Me.btnAlignRight3.Name = "btnAlignRight3" - Me.btnAlignRight3.Size = New System.Drawing.Size(30, 30) - Me.btnAlignRight3.TabIndex = 52 - Me.btnAlignRight3.Text = "R" - Me.btnAlignRight3.UseVisualStyleBackColor = True - ' - 'cmbFontFamily3 - ' - Me.cmbFontFamily3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbFontFamily3.FormattingEnabled = True - Me.cmbFontFamily3.Location = New System.Drawing.Point(734, 449) - Me.cmbFontFamily3.Name = "cmbFontFamily3" - Me.cmbFontFamily3.Size = New System.Drawing.Size(150, 21) - Me.cmbFontFamily3.TabIndex = 53 - ' - 'cmbFontSize3 - ' - Me.cmbFontSize3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbFontSize3.FormattingEnabled = True - Me.cmbFontSize3.Location = New System.Drawing.Point(911, 449) - Me.cmbFontSize3.Name = "cmbFontSize3" - Me.cmbFontSize3.Size = New System.Drawing.Size(60, 21) - Me.cmbFontSize3.TabIndex = 54 - ' - 'btnBold2 - ' - Me.btnBold2.Location = New System.Drawing.Point(101, 307) - Me.btnBold2.Name = "btnBold2" - Me.btnBold2.Size = New System.Drawing.Size(30, 30) - Me.btnBold2.TabIndex = 35 - Me.btnBold2.Text = "B" - Me.btnBold2.UseVisualStyleBackColor = True - ' - 'btnItalic2 - ' - Me.btnItalic2.Location = New System.Drawing.Point(141, 307) - Me.btnItalic2.Name = "btnItalic2" - Me.btnItalic2.Size = New System.Drawing.Size(30, 30) - Me.btnItalic2.TabIndex = 36 - Me.btnItalic2.Text = "I" - Me.btnItalic2.UseVisualStyleBackColor = True - ' - 'btnUnderline2 - ' - Me.btnUnderline2.Location = New System.Drawing.Point(181, 307) - Me.btnUnderline2.Name = "btnUnderline2" - Me.btnUnderline2.Size = New System.Drawing.Size(30, 30) - Me.btnUnderline2.TabIndex = 37 - Me.btnUnderline2.Text = "U" - Me.btnUnderline2.UseVisualStyleBackColor = True - ' - 'btnTextColor2 - ' - Me.btnTextColor2.Location = New System.Drawing.Point(303, 307) - Me.btnTextColor2.Name = "btnTextColor2" - Me.btnTextColor2.Size = New System.Drawing.Size(30, 30) - Me.btnTextColor2.TabIndex = 38 - Me.btnTextColor2.Text = "A" - Me.btnTextColor2.UseVisualStyleBackColor = True - ' - 'btnBackColor2 - ' - Me.btnBackColor2.Location = New System.Drawing.Point(343, 307) - Me.btnBackColor2.Name = "btnBackColor2" - Me.btnBackColor2.Size = New System.Drawing.Size(30, 30) - Me.btnBackColor2.TabIndex = 39 - Me.btnBackColor2.Text = "BG" - Me.btnBackColor2.UseVisualStyleBackColor = True - ' - 'btnAlignLeft2 - ' - Me.btnAlignLeft2.Location = New System.Drawing.Point(472, 307) - Me.btnAlignLeft2.Name = "btnAlignLeft2" - Me.btnAlignLeft2.Size = New System.Drawing.Size(30, 30) - Me.btnAlignLeft2.TabIndex = 40 - Me.btnAlignLeft2.Text = "L" - Me.btnAlignLeft2.UseVisualStyleBackColor = True - ' - 'btnAlignCenter2 - ' - Me.btnAlignCenter2.Location = New System.Drawing.Point(512, 307) - Me.btnAlignCenter2.Name = "btnAlignCenter2" - Me.btnAlignCenter2.Size = New System.Drawing.Size(30, 30) - Me.btnAlignCenter2.TabIndex = 41 - Me.btnAlignCenter2.Text = "C" - Me.btnAlignCenter2.UseVisualStyleBackColor = True - ' - 'btnAlignRight2 - ' - Me.btnAlignRight2.Location = New System.Drawing.Point(552, 307) - Me.btnAlignRight2.Name = "btnAlignRight2" - Me.btnAlignRight2.Size = New System.Drawing.Size(30, 30) - Me.btnAlignRight2.TabIndex = 42 - Me.btnAlignRight2.Text = "R" - Me.btnAlignRight2.UseVisualStyleBackColor = True - ' - 'cmbFontFamily2 - ' - Me.cmbFontFamily2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbFontFamily2.FormattingEnabled = True - Me.cmbFontFamily2.Location = New System.Drawing.Point(735, 307) - Me.cmbFontFamily2.Name = "cmbFontFamily2" - Me.cmbFontFamily2.Size = New System.Drawing.Size(150, 21) - Me.cmbFontFamily2.TabIndex = 43 - ' - 'cmbFontSize2 - ' - Me.cmbFontSize2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbFontSize2.FormattingEnabled = True - Me.cmbFontSize2.Location = New System.Drawing.Point(912, 307) - Me.cmbFontSize2.Name = "cmbFontSize2" - Me.cmbFontSize2.Size = New System.Drawing.Size(60, 21) - Me.cmbFontSize2.TabIndex = 44 - ' - 'rtbZeile3 - ' - Me.rtbZeile3.Location = New System.Drawing.Point(100, 363) - Me.rtbZeile3.Name = "rtbZeile3" - Me.rtbZeile3.Size = New System.Drawing.Size(1180, 80) - Me.rtbZeile3.TabIndex = 34 - Me.rtbZeile3.Text = "" + Me.tabPageZeile2.Controls.Add(Me.rtbZeile2) + Me.tabPageZeile2.Location = New System.Drawing.Point(4, 22) + Me.tabPageZeile2.Name = "tabPageZeile2" + Me.tabPageZeile2.Padding = New System.Windows.Forms.Padding(3) + Me.tabPageZeile2.Size = New System.Drawing.Size(1227, 306) + Me.tabPageZeile2.TabIndex = 1 + Me.tabPageZeile2.Text = "Englisch" + Me.tabPageZeile2.UseVisualStyleBackColor = True ' 'rtbZeile2 ' - Me.rtbZeile2.Location = New System.Drawing.Point(101, 221) + Me.rtbZeile2.Dock = System.Windows.Forms.DockStyle.Fill + Me.rtbZeile2.Location = New System.Drawing.Point(3, 3) Me.rtbZeile2.Name = "rtbZeile2" - Me.rtbZeile2.Size = New System.Drawing.Size(1180, 80) - Me.rtbZeile2.TabIndex = 33 + Me.rtbZeile2.Size = New System.Drawing.Size(1221, 300) + Me.rtbZeile2.TabIndex = 0 Me.rtbZeile2.Text = "" ' + 'tabPageZeile3 + ' + Me.tabPageZeile3.Controls.Add(Me.rtbZeile3) + Me.tabPageZeile3.Location = New System.Drawing.Point(4, 22) + Me.tabPageZeile3.Name = "tabPageZeile3" + Me.tabPageZeile3.Padding = New System.Windows.Forms.Padding(3) + Me.tabPageZeile3.Size = New System.Drawing.Size(1227, 306) + Me.tabPageZeile3.TabIndex = 2 + Me.tabPageZeile3.Text = "Türkisch" + Me.tabPageZeile3.UseVisualStyleBackColor = True + ' + 'rtbZeile3 + ' + Me.rtbZeile3.Dock = System.Windows.Forms.DockStyle.Fill + Me.rtbZeile3.Location = New System.Drawing.Point(3, 3) + Me.rtbZeile3.Name = "rtbZeile3" + Me.rtbZeile3.Size = New System.Drawing.Size(1221, 300) + Me.rtbZeile3.TabIndex = 0 + Me.rtbZeile3.Text = "" + ' 'lblNeueTvTextBezeichnung ' Me.lblNeueTvTextBezeichnung.AutoSize = True @@ -590,32 +483,6 @@ Partial Class frmEintragTvNew Me.lblStartDate.TabIndex = 8 Me.lblStartDate.Text = "Startdatum: " ' - 'lblZeile3 - ' - Me.lblZeile3.AutoSize = True - Me.lblZeile3.Location = New System.Drawing.Point(42, 388) - Me.lblZeile3.Name = "lblZeile3" - Me.lblZeile3.Size = New System.Drawing.Size(42, 13) - Me.lblZeile3.TabIndex = 6 - Me.lblZeile3.Text = "Zeile 3:" - ' - 'lblZeile2 - ' - Me.lblZeile2.AutoSize = True - Me.lblZeile2.Location = New System.Drawing.Point(43, 255) - Me.lblZeile2.Name = "lblZeile2" - Me.lblZeile2.Size = New System.Drawing.Size(42, 13) - Me.lblZeile2.TabIndex = 4 - Me.lblZeile2.Text = "Zeile 2:" - ' - 'rtbZeile1 - ' - Me.rtbZeile1.Location = New System.Drawing.Point(100, 79) - Me.rtbZeile1.Name = "rtbZeile1" - Me.rtbZeile1.Size = New System.Drawing.Size(1180, 80) - Me.rtbZeile1.TabIndex = 3 - Me.rtbZeile1.Text = "" - ' 'lblZeile1 ' Me.lblZeile1.AutoSize = True @@ -664,7 +531,7 @@ Partial Class frmEintragTvNew ' 'btnBold ' - Me.btnBold.Location = New System.Drawing.Point(100, 165) + Me.btnBold.Location = New System.Drawing.Point(40, 438) Me.btnBold.Name = "btnBold" Me.btnBold.Size = New System.Drawing.Size(30, 30) Me.btnBold.TabIndex = 23 @@ -673,7 +540,7 @@ Partial Class frmEintragTvNew ' 'btnItalic ' - Me.btnItalic.Location = New System.Drawing.Point(140, 165) + Me.btnItalic.Location = New System.Drawing.Point(80, 438) Me.btnItalic.Name = "btnItalic" Me.btnItalic.Size = New System.Drawing.Size(30, 30) Me.btnItalic.TabIndex = 24 @@ -682,7 +549,7 @@ Partial Class frmEintragTvNew ' 'btnUnderline ' - Me.btnUnderline.Location = New System.Drawing.Point(180, 165) + Me.btnUnderline.Location = New System.Drawing.Point(120, 438) Me.btnUnderline.Name = "btnUnderline" Me.btnUnderline.Size = New System.Drawing.Size(30, 30) Me.btnUnderline.TabIndex = 25 @@ -691,7 +558,7 @@ Partial Class frmEintragTvNew ' 'btnTextColor ' - Me.btnTextColor.Location = New System.Drawing.Point(302, 165) + Me.btnTextColor.Location = New System.Drawing.Point(200, 438) Me.btnTextColor.Name = "btnTextColor" Me.btnTextColor.Size = New System.Drawing.Size(30, 30) Me.btnTextColor.TabIndex = 26 @@ -700,16 +567,16 @@ Partial Class frmEintragTvNew ' 'btnBackColor ' - Me.btnBackColor.Location = New System.Drawing.Point(342, 165) + Me.btnBackColor.Location = New System.Drawing.Point(240, 438) Me.btnBackColor.Name = "btnBackColor" - Me.btnBackColor.Size = New System.Drawing.Size(30, 30) + Me.btnBackColor.Size = New System.Drawing.Size(50, 30) Me.btnBackColor.TabIndex = 27 Me.btnBackColor.Text = "BG" Me.btnBackColor.UseVisualStyleBackColor = True ' 'btnAlignLeft ' - Me.btnAlignLeft.Location = New System.Drawing.Point(471, 165) + Me.btnAlignLeft.Location = New System.Drawing.Point(310, 438) Me.btnAlignLeft.Name = "btnAlignLeft" Me.btnAlignLeft.Size = New System.Drawing.Size(30, 30) Me.btnAlignLeft.TabIndex = 28 @@ -718,7 +585,7 @@ Partial Class frmEintragTvNew ' 'btnAlignCenter ' - Me.btnAlignCenter.Location = New System.Drawing.Point(511, 165) + Me.btnAlignCenter.Location = New System.Drawing.Point(350, 438) Me.btnAlignCenter.Name = "btnAlignCenter" Me.btnAlignCenter.Size = New System.Drawing.Size(30, 30) Me.btnAlignCenter.TabIndex = 29 @@ -727,7 +594,7 @@ Partial Class frmEintragTvNew ' 'btnAlignRight ' - Me.btnAlignRight.Location = New System.Drawing.Point(551, 165) + Me.btnAlignRight.Location = New System.Drawing.Point(390, 438) Me.btnAlignRight.Name = "btnAlignRight" Me.btnAlignRight.Size = New System.Drawing.Size(30, 30) Me.btnAlignRight.TabIndex = 30 @@ -738,7 +605,7 @@ Partial Class frmEintragTvNew ' Me.cmbFontFamily.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbFontFamily.FormattingEnabled = True - Me.cmbFontFamily.Location = New System.Drawing.Point(734, 165) + Me.cmbFontFamily.Location = New System.Drawing.Point(495, 438) Me.cmbFontFamily.Name = "cmbFontFamily" Me.cmbFontFamily.Size = New System.Drawing.Size(150, 21) Me.cmbFontFamily.TabIndex = 31 @@ -747,7 +614,7 @@ Partial Class frmEintragTvNew ' Me.cmbFontSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbFontSize.FormattingEnabled = True - Me.cmbFontSize.Location = New System.Drawing.Point(911, 165) + Me.cmbFontSize.Location = New System.Drawing.Point(670, 438) Me.cmbFontSize.Name = "cmbFontSize" Me.cmbFontSize.Size = New System.Drawing.Size(60, 21) Me.cmbFontSize.TabIndex = 32 @@ -782,7 +649,7 @@ Partial Class frmEintragTvNew 'chkShowInactive ' Me.chkShowInactive.AutoSize = True - Me.chkShowInactive.Location = New System.Drawing.Point(230, 27) + Me.chkShowInactive.Location = New System.Drawing.Point(1205, 29) Me.chkShowInactive.Name = "chkShowInactive" Me.chkShowInactive.Size = New System.Drawing.Size(110, 17) Me.chkShowInactive.TabIndex = 1 @@ -800,6 +667,7 @@ Partial Class frmEintragTvNew Me.Controls.Add(Me.dgvAVISOTV) Me.Controls.Add(Me.lblStandort) Me.Controls.Add(Me.cbxStandort) + Me.Controls.Add(Me.btnOpenSettings) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.Name = "frmEintragTvNew" @@ -808,69 +676,14 @@ Partial Class frmEintragTvNew CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).EndInit() Me.grpEingabe.ResumeLayout(False) Me.grpEingabe.PerformLayout() + Me.tabControlZeilen.ResumeLayout(False) + Me.tabPageZeile1.ResumeLayout(False) + Me.tabPageZeile2.ResumeLayout(False) + Me.tabPageZeile3.ResumeLayout(False) Me.grpWochentage.ResumeLayout(False) Me.grpWochentage.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub - - Friend WithEvents cbxStandort As ComboBox - Friend WithEvents lblStandort As Label - Friend WithEvents dgvAVISOTV As DataGridView - Friend WithEvents grpEingabe As GroupBox - Friend WithEvents lblNeueTvTextBezeichnung As Label - Friend WithEvents txtNeueTvTextBezeichnung As TextBox - Friend WithEvents chkIsActive As CheckBox - Friend WithEvents chkIsRecurring As CheckBox - Friend WithEvents grpWochentage As GroupBox - Friend WithEvents chkSunday As CheckBox - Friend WithEvents chkSaturday As CheckBox - Friend WithEvents chkFriday As CheckBox - Friend WithEvents chkThursday As CheckBox - Friend WithEvents chkWednesday As CheckBox - Friend WithEvents chkTuesday As CheckBox - Friend WithEvents chkMonday As CheckBox - Friend WithEvents dtpEndTime As DateTimePicker - Friend WithEvents lblEndTime As Label - Friend WithEvents dtpStartTime As DateTimePicker - Friend WithEvents lblStartTime As Label - Friend WithEvents dtpEndDate As DateTimePicker - Friend WithEvents lblEndDate As Label - Friend WithEvents dtpStartDate As DateTimePicker - Friend WithEvents lblStartDate As Label - Friend WithEvents lblZeile3 As Label - Friend WithEvents lblZeile2 As Label - Friend WithEvents lblZeile1 As Label - Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox - Friend WithEvents lblBezeichnung As Label - Friend WithEvents lblPosition As Label - Friend WithEvents cmbPosition As ComboBox - Friend WithEvents btnSpeichern As Button - Friend WithEvents btnLoeschen As Button - Friend WithEvents btnAbbrechen As Button - Friend WithEvents chkShowInactive As CheckBox - Private WithEvents rtbZeile3 As RichTextBox - Private WithEvents rtbZeile2 As RichTextBox - Private WithEvents btnBold3 As Button - Private WithEvents btnItalic3 As Button - Private WithEvents btnUnderline3 As Button - Private WithEvents btnTextColor3 As Button - Private WithEvents btnBackColor3 As Button - Private WithEvents btnAlignLeft3 As Button - Private WithEvents btnAlignCenter3 As Button - Private WithEvents btnAlignRight3 As Button - Private WithEvents cmbFontFamily3 As ComboBox - Private WithEvents cmbFontSize3 As ComboBox - Private WithEvents btnBold2 As Button - Private WithEvents btnItalic2 As Button - Private WithEvents btnUnderline2 As Button - Private WithEvents btnTextColor2 As Button - Private WithEvents btnBackColor2 As Button - Private WithEvents btnAlignLeft2 As Button - Private WithEvents btnAlignCenter2 As Button - Private WithEvents btnAlignRight2 As Button - Private WithEvents cmbFontFamily2 As ComboBox - Private WithEvents cmbFontSize2 As ComboBox - End Class diff --git a/Aviso/frmEintragTvNew.resx b/Aviso/frmEintragTvNew.resx index 1af7de1..0a3bfe1 100644 --- a/Aviso/frmEintragTvNew.resx +++ b/Aviso/frmEintragTvNew.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb index 0f4b29d..811a7d4 100644 --- a/Aviso/frmEintragTvNew.vb +++ b/Aviso/frmEintragTvNew.vb @@ -23,8 +23,11 @@ Public Class frmEintragTvNew Private Sub frmEintragTvNew_Load(sender As Object, e As EventArgs) Handles MyBase.Load LadeStandorte() - LadeTvTextBezeichnungen() + ' Erst alle Einträge laden, damit listAll bereits gefüllt ist LadenAlleEintraege() + ' Dann erst die Bezeichnungen laden + LadeTvTextBezeichnungen() + grpWochentage.Enabled = chkIsRecurring.Checked dgvAVISOTV.SelectionMode = DataGridViewSelectionMode.FullRowSelect dgvAVISOTV.MultiSelect = False @@ -35,6 +38,7 @@ Public Class frmEintragTvNew chkIsActive.Checked = True End Sub + Private Sub LadenAlleEintraege() Try AvisoTvNewDAL.LesenAlleAvisoTvNew(listAll) @@ -53,11 +57,11 @@ Public Class frmEintragTvNew Return End If - Dim sql As String = "SELECT DISTINCT Standort FROM StandorteTV ORDER BY Standort" + Dim sql As String = "SELECT DISTINCT StandortBezeichnung FROM StandorteTV ORDER BY StandortBezeichnung" Using cmd As New SqlCommand(sql, conn) Using dr As SqlDataReader = cmd.ExecuteReader() While dr.Read() - Dim standort As String = Convert.ToString(dr("Standort")) + Dim standort As String = Convert.ToString(dr("StandortBezeichnung")) standorte.Add(standort) End While End Using @@ -73,78 +77,56 @@ Public Class frmEintragTvNew If cbxStandort.Items.Count > 0 Then cbxStandort.SelectedIndex = 0 End Sub + ' Neue parameterlose initdgv-Methode Private Sub initdgv() - Try - RemoveHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + Dim selectedStandort As String = If(cbxStandort.SelectedItem IsNot Nothing, cbxStandort.SelectedItem.ToString(), "") + initdgv(selectedStandort) + End Sub + + Private Sub initdgv(selectedStandort As String) + Try + ' Entfernen Sie vorhandene Event-Handler, um Doppelbindungen zu vermeiden + RemoveHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + RemoveHandler dgvAVISOTV.CellFormatting, AddressOf dgvAVISOTV_CellFormatting + + Dim standortID As Integer = AvisoTvNewDAL.GetStandortID(selectedStandort) - Dim standort As String = cbxStandort.SelectedItem?.ToString() Dim showInactive As Boolean = chkShowInactive.Checked Dim gefilterteListe As List(Of cAvisoTvNew) If showInactive Then - gefilterteListe = list.Where(Function(x) x.Standort = standort).ToList() + gefilterteListe = list.Where(Function(x) x.StandortID = standortID).ToList() Else - gefilterteListe = list.Where(Function(x) x.Standort = standort AndAlso x.IsActive).ToList() + gefilterteListe = list.Where(Function(x) x.StandortID = standortID AndAlso x.IsActive).ToList() End If + ' Zurücksetzen der DataSource und Löschen der Zeilen dgvAVISOTV.DataSource = Nothing dgvAVISOTV.Rows.Clear() If gefilterteListe.Count > 0 Then dgvAVISOTV.DataSource = gefilterteListe - ' Anpassen der Spaltenüberschriften - dgvAVISOTV.Columns("TvTextBezeichnungID").HeaderText = "ID" - dgvAVISOTV.Columns("TvTextBezeichnung").HeaderText = "Bezeichnung" - dgvAVISOTV.Columns("FixeZeile1RTF").HeaderText = "Zeile 1 (Text)" - dgvAVISOTV.Columns("FixeZeile2RTF").HeaderText = "Zeile 2 (Text)" - dgvAVISOTV.Columns("FixeZeile3RTF").HeaderText = "Zeile 3 (Text)" - dgvAVISOTV.Columns("Standort").Visible = False - dgvAVISOTV.Columns("Art").Visible = False - dgvAVISOTV.Columns("StartDate").HeaderText = "Startdatum" - dgvAVISOTV.Columns("EndDate").HeaderText = "Enddatum" - dgvAVISOTV.Columns("StartTime").HeaderText = "Startzeit" - dgvAVISOTV.Columns("EndTime").HeaderText = "Endzeit" - dgvAVISOTV.Columns("IsRecurring").HeaderText = "Wiederholen" - dgvAVISOTV.Columns("IsActive").HeaderText = "Aktiv" - dgvAVISOTV.Columns("IsMonday").Visible = False - dgvAVISOTV.Columns("IsTuesday").Visible = False - dgvAVISOTV.Columns("IsWednesday").Visible = False - dgvAVISOTV.Columns("IsThursday").Visible = False - dgvAVISOTV.Columns("IsFriday").Visible = False - dgvAVISOTV.Columns("IsSaturday").Visible = False - dgvAVISOTV.Columns("IsSunday").Visible = False + ' Anpassen der Spaltenüberschriften und Sichtbarkeiten + ConfigureDataGridViewColumns() - ' Hinzufügen des CellFormatting-Handlers - AddHandler dgvAVISOTV.CellFormatting, AddressOf dgvAVISOTV_CellFormatting + AddFixeZeileTextColumns() + + ' Konvertieren von RTF-Inhalten zu reinem Text + ConvertRtfToPlainText() dgvAVISOTV.AutoResizeColumns() + ' Wiederhinzufügen der Event-Handler AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged - ' **Wiederherstellung der Auswahl basierend auf lastSelectedTVID** - If lastSelectedTVID <> 0 Then - Dim rowToSelect = dgvAVISOTV.Rows.Cast(Of DataGridViewRow)().FirstOrDefault(Function(r) CType(r.DataBoundItem, cAvisoTvNew).TvTextBezeichnungID = lastSelectedTVID) - If rowToSelect IsNot Nothing Then - rowToSelect.Selected = True - - dgvAVISOTV.FirstDisplayedScrollingRowIndex = rowToSelect.Index - dgvAVISOTV.CurrentCell = rowToSelect.Cells(0) - Else - ' Falls die TVID nicht gefunden wird, wähle die erste Zeile aus - If dgvAVISOTV.Rows.Count > 0 Then - dgvAVISOTV.Rows(0).Selected = True - dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) - dgvAVISOTV_SelectionChanged(Nothing, Nothing) - End If - End If - ElseIf dgvAVISOTV.Rows.Count > 0 Then - dgvAVISOTV.Rows(0).Selected = True - dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) - dgvAVISOTV_SelectionChanged(Nothing, Nothing) - End If + ' Wiederherstellung der Auswahl basierend auf lastSelectedTVID + RestoreSelection() Else + ' Wiederhinzufügen der Event-Handler AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + + ' Felder leeren und Auswahl zurücksetzen ClearFields() myAvisoTvNew = Nothing End If @@ -157,6 +139,129 @@ Public Class frmEintragTvNew End Try End Sub + ' Neue Methode zum Konfigurieren der Spaltenüberschriften und Sichtbarkeiten + Private Sub ConfigureDataGridViewColumns() + ' Anpassen der Spaltenüberschriften + Dim headerTexts As New Dictionary(Of String, String) From { + {"TvTextBezeichnungID", "ID"}, + {"TvTextBezeichnung", "Bezeichnung"}, + {"StartDate", "Startdatum"}, + {"EndDate", "Enddatum"}, + {"StartTime", "Startzeit"}, + {"EndTime", "Endzeit"}, + {"IsRecurring", "Wiederholen"}, + {"IsActive", "Aktiv"} + } + + For Each columnName As String In headerTexts.Keys + If dgvAVISOTV.Columns.Contains(columnName) Then + dgvAVISOTV.Columns(columnName).HeaderText = headerTexts(columnName) + End If + Next + + ' Verstecken der unnötigen Spalten + Dim columnsToHide As String() = { + "FixeZeile1RTF", "FixeZeile2RTF", "FixeZeile3RTF", + "Standort", "Art", + "IsMonday", "IsTuesday", "IsWednesday", + "IsThursday", "IsFriday", "IsSaturday", "IsSunday", "StandortID", "FixeZeile1HTML", "FixeZeile2HTML", "FixeZeile3HTML" + } + + For Each columnName As String In columnsToHide + If dgvAVISOTV.Columns.Contains(columnName) Then + dgvAVISOTV.Columns(columnName).Visible = False + End If + Next + End Sub + + Private Sub AddFixeZeileTextColumns() + Dim textColumns As New List(Of DataGridViewTextBoxColumn) From { + New DataGridViewTextBoxColumn() With { + .Name = "FixeZeile1Text", + .HeaderText = "Deutsch", + .ReadOnly = True + }, + New DataGridViewTextBoxColumn() With { + .Name = "FixeZeile2Text", + .HeaderText = "Englisch", + .ReadOnly = True + }, + New DataGridViewTextBoxColumn() With { + .Name = "FixeZeile3Text", + .HeaderText = "Türkisch", + .ReadOnly = True + } + } + + For Each col As DataGridViewTextBoxColumn In textColumns + If Not dgvAVISOTV.Columns.Contains(col.Name) Then + dgvAVISOTV.Columns.Add(col) + End If + Next + End Sub + + ' Neue Methode zur Konvertierung von RTF zu reinem Text + Private Sub ConvertRtfToPlainText() + For Each row As DataGridViewRow In dgvAVISOTV.Rows + If Not row.IsNewRow Then + Dim rtfValue1 As String = If(row.Cells("FixeZeile1RTF").Value?.ToString(), String.Empty) + Dim rtfValue2 As String = If(row.Cells("FixeZeile2RTF").Value?.ToString(), String.Empty) + Dim rtfValue3 As String = If(row.Cells("FixeZeile3RTF").Value?.ToString(), String.Empty) + + row.Cells("FixeZeile1Text").Value = RtfToPlainText(rtfValue1) + row.Cells("FixeZeile2Text").Value = RtfToPlainText(rtfValue2) + row.Cells("FixeZeile3Text").Value = RtfToPlainText(rtfValue3) + End If + Next + End Sub + + ' Neue Methode zur Wiederherstellung der Auswahl + Private Sub RestoreSelection() + If lastSelectedTVID <> 0 Then + Dim rowToSelect = dgvAVISOTV.Rows.Cast(Of DataGridViewRow)().FirstOrDefault(Function(r) CType(r.DataBoundItem, cAvisoTvNew).TvTextBezeichnungID = lastSelectedTVID) + If rowToSelect IsNot Nothing Then + rowToSelect.Selected = True + dgvAVISOTV.FirstDisplayedScrollingRowIndex = rowToSelect.Index + dgvAVISOTV.CurrentCell = rowToSelect.Cells(0) + Dim selectedAviso As cAvisoTvNew = listAll.FirstOrDefault(Function(x) x.TvTextBezeichnungID = lastSelectedTVID AndAlso x.IsActive) + FillFieldsFromAviso(selectedAviso) + Else + ' Falls die TVID nicht gefunden wird, wähle die erste Zeile aus + SelectFirstRow() + End If + Else + ' Wenn keine letzte Auswahl vorhanden ist, wähle die erste Zeile aus + If dgvAVISOTV.Rows.Count > 0 Then + SelectFirstRow() + End If + End If + lastSelectedTVID = 0 + End Sub + + ' Hilfsmethode zum Auswählen der ersten Zeile + Private Sub SelectFirstRow() + If dgvAVISOTV.Rows.Count > 0 Then + dgvAVISOTV.Rows(0).Selected = True + dgvAVISOTV.CurrentCell = dgvAVISOTV.Rows(0).Cells(0) + dgvAVISOTV_SelectionChanged(Nothing, Nothing) + End If + End Sub + + ' Beispielhafte Implementierung der RtfToPlainText-Methode + Private Function RtfToPlainText(rtf As String) As String + If String.IsNullOrEmpty(rtf) Then Return String.Empty + Using rtb As New RichTextBox() + Try + rtb.Rtf = rtf + Return rtb.Text + Catch ex As Exception + ' Handle invalid RTF format + Return String.Empty + End Try + End Using + End Function + + Private Sub dgvAVISOTV_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) ' Definieren Sie die Namen der RTF-Spalten Dim rtfColumns As String() = {"FixeZeile1RTF", "FixeZeile2RTF", "FixeZeile3RTF"} @@ -191,9 +296,27 @@ Public Class frmEintragTvNew End Try LadeTvTextBezeichnungen() - initdgv() + initdgv(selectedStandort) End Sub + Private Sub btnOpenSettings_Click(sender As Object, e As EventArgs) Handles btnOpenSettings.Click + Dim currentStandort As String = cbxStandort.SelectedItem?.ToString() + Dim currentStandortID As Integer = 0 + + If Not String.IsNullOrEmpty(currentStandort) Then + currentStandortID = AvisoTvNewDAL.GetStandortID(currentStandort) + End If + + If currentStandortID = 0 Then + MessageBox.Show("Bitte wählen Sie einen gültigen Standort aus.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Return + End If + + Dim settingsForm As New frmTvSettings(currentStandortID) + settingsForm.ShowDialog() + End Sub + + Private Sub btnNeu_Click(sender As Object, e As EventArgs) Dim standort As String = cbxStandort.SelectedItem?.ToString() If String.IsNullOrEmpty(standort) Then @@ -232,11 +355,12 @@ Public Class frmEintragTvNew End Class Private Sub cmbTvTextBezeichnungAuswahl_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTvTextBezeichnungAuswahl.SelectedIndexChanged - If isInitializing Then + If isInitializing OrElse cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 Then Return End If - If cmbTvTextBezeichnungAuswahl.SelectedValue Is Nothing OrElse cmbTvTextBezeichnungAuswahl.SelectedValue Is DBNull.Value Then + If listAll Is Nothing OrElse Not listAll.Any() Then + MessageBox.Show("Die Liste aller AvisoEinträge ist nicht geladen oder leer.", "Datenfehler", MessageBoxButtons.OK, MessageBoxIcon.Error) Return End If @@ -284,184 +408,198 @@ Public Class frmEintragTvNew End Try End Sub - Private Sub InitializeFontComboBoxes() - Dim fontFamilies As New List(Of String)() - For Each font As FontFamily In FontFamily.Families - fontFamilies.Add(font.Name) - Next - - ' Initialisierung für Zeile 1 - cmbFontFamily.DataSource = fontFamilies - cmbFontFamily.SelectedItem = rtbZeile1.Font.FontFamily.Name - - Dim sizes As Integer() = {8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72} - cmbFontSize.DataSource = sizes.Select(Function(s) s.ToString()).ToList() - cmbFontSize.SelectedItem = CInt(rtbZeile1.Font.Size).ToString() - - AddHandler cmbFontFamily.SelectedIndexChanged, AddressOf cmbFontFamily_SelectedIndexChanged - AddHandler cmbFontSize.SelectedIndexChanged, AddressOf cmbFontSize_SelectedIndexChanged - - ' Initialisierung für Zeile 2 - cmbFontFamily2.DataSource = New List(Of String)(fontFamilies) - cmbFontFamily2.SelectedItem = rtbZeile2.Font.FontFamily.Name - - cmbFontSize2.DataSource = sizes.Select(Function(s) s.ToString()).ToList() - cmbFontSize2.SelectedItem = CInt(rtbZeile2.Font.Size).ToString() - - AddHandler cmbFontFamily2.SelectedIndexChanged, AddressOf cmbFontFamily2_SelectedIndexChanged - AddHandler cmbFontSize2.SelectedIndexChanged, AddressOf cmbFontSize2_SelectedIndexChanged - - ' Initialisierung für Zeile 3 - cmbFontFamily3.DataSource = New List(Of String)(fontFamilies) - cmbFontFamily3.SelectedItem = rtbZeile3.Font.FontFamily.Name - - cmbFontSize3.DataSource = sizes.Select(Function(s) s.ToString()).ToList() - cmbFontSize3.SelectedItem = CInt(rtbZeile3.Font.Size).ToString() - - AddHandler cmbFontFamily3.SelectedIndexChanged, AddressOf cmbFontFamily3_SelectedIndexChanged - AddHandler cmbFontSize3.SelectedIndexChanged, AddressOf cmbFontSize3_SelectedIndexChanged + Private Sub tabControlZeilen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles tabControlZeilen.SelectedIndexChanged + InitializeFontComboBoxes() End Sub + Private Sub InitializeFontComboBoxes() + Try + isInitializing = True + + ' Schritt 1: Font-Familien sammeln + Dim fontFamilies As New List(Of String)() + For Each font As FontFamily In FontFamily.Families + fontFamilies.Add(font.Name) + Next + + ' Schritt 2: cmbFontFamily initialisieren + cmbFontFamily.Items.Clear() + cmbFontFamily.Items.AddRange(fontFamilies.ToArray()) + + ' Schritt 3: Schriftgrößen sammeln + Dim sizes As Integer() = {8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72} + cmbFontSize.Items.Clear() + cmbFontSize.Items.AddRange(sizes.Select(Function(s) s.ToString()).ToArray()) + + ' Schritt 4: Aktuelle Schriftfamilie und Schriftgröße aus der RichTextBox lesen + If AktuelleRichTextBox IsNot Nothing Then + Dim selectedFont As Font = AktuelleRichTextBox.SelectionFont + + If selectedFont IsNot Nothing Then + ' Setze die Schriftfamilie + If fontFamilies.Contains(selectedFont.FontFamily.Name) Then + cmbFontFamily.SelectedItem = selectedFont.FontFamily.Name + ElseIf cmbFontFamily.Items.Count > 0 Then + cmbFontFamily.SelectedIndex = 0 ' Standard auf erste Schriftart setzen + End If + + ' Setze die Schriftgröße + Dim fontSizeInt As Integer = CInt(Math.Round(selectedFont.Size)) + Dim fontSizeStr As String = fontSizeInt.ToString() + If cmbFontSize.Items.Contains(fontSizeStr) Then + cmbFontSize.SelectedItem = fontSizeStr + ElseIf cmbFontSize.Items.Count > 0 Then + cmbFontSize.SelectedItem = "12" ' Standard auf 12 setzen + End If + Else + ' Falls keine spezifische Schrift ausgewählt ist, setze Standardwerte + If cmbFontFamily.Items.Count > 0 Then + cmbFontFamily.SelectedIndex = 0 + End If + If cmbFontSize.Items.Count > 0 Then + cmbFontSize.SelectedItem = "12" + End If + End If + Else + ' Falls AktuelleRichTextBox nicht gesetzt ist, setze Standardwerte + If cmbFontFamily.Items.Count > 0 Then + cmbFontFamily.SelectedIndex = 0 + End If + If cmbFontSize.Items.Count > 0 Then + cmbFontSize.SelectedItem = "12" + End If + End If + + ' Schritt 5: Event-Handler aktualisieren + ' Entferne alte Event-Handler, um Doppelbindungen zu vermeiden + RemoveHandler cmbFontFamily.SelectedIndexChanged, AddressOf cmbFontFamily_SelectedIndexChanged + RemoveHandler cmbFontSize.SelectedIndexChanged, AddressOf cmbFontSize_SelectedIndexChanged + + ' Füge neue Event-Handler hinzu + AddHandler cmbFontFamily.SelectedIndexChanged, AddressOf cmbFontFamily_SelectedIndexChanged + AddHandler cmbFontSize.SelectedIndexChanged, AddressOf cmbFontSize_SelectedIndexChanged + + isInitializing = False + Catch ex As Exception + MessageBox.Show("Fehler beim Initialisieren der Schriftart-ComboBoxes: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + Finally + isInitializing = False + End Try + End Sub + + + ' Schriftfamilie ComboBox SelectionChanged Private Sub cmbFontFamily_SelectedIndexChanged(sender As Object, e As EventArgs) + If isInitializing Then Return UpdateFont() End Sub ' Schriftgröße ComboBox SelectionChanged Private Sub cmbFontSize_SelectedIndexChanged(sender As Object, e As EventArgs) + If isInitializing Then Return UpdateFont() End Sub Private Sub UpdateFont() - Dim selectedFontFamily As String = If(cmbFontFamily.SelectedItem, rtbZeile1.SelectionFont?.FontFamily.Name) + If isInitializing Then Return + + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + + Dim selectedFontFamily As String = If(cmbFontFamily.SelectedItem, AktuelleRichTextBox.SelectionFont?.FontFamily.Name) Dim selectedFontSize As Single If Single.TryParse(cmbFontSize.SelectedItem, selectedFontSize) Then - ' Überprüfen, ob eine Auswahl vorhanden ist - If rtbZeile1.SelectionLength > 0 Then - ' Erstellen einer neuen Schriftart basierend auf der Auswahl - Dim currentFont As Font = rtbZeile1.SelectionFont - If currentFont IsNot Nothing Then - rtbZeile1.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) - Else - ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen - rtbZeile1.SelectionFont = New Font(selectedFontFamily, selectedFontSize) - End If + ' Erstellen einer neuen Schriftart basierend auf der Auswahl + Dim currentFont As Font = AktuelleRichTextBox.SelectionFont + If currentFont IsNot Nothing Then + AktuelleRichTextBox.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) Else - ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox - rtbZeile1.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile1.Font.Style) + ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen + AktuelleRichTextBox.SelectionFont = New Font(selectedFontFamily, selectedFontSize) End If hatAenderung = True End If End Sub - ' Methode zum Umschalten des Schriftstils - Private Sub ToggleFontStyle(style As FontStyle) - If rtbZeile1.SelectionFont IsNot Nothing Then - Dim currentFont As Font = rtbZeile1.SelectionFont - Dim newFontStyle As FontStyle - - If rtbZeile1.SelectionFont.Style.HasFlag(style) Then - ' Entferne den Stil - newFontStyle = currentFont.Style And Not style - Else - ' Füge den Stil hinzu - newFontStyle = currentFont.Style Or style - End If - - ' Setze die neue Schriftart - rtbZeile1.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) - hatAenderung = True - End If - End Sub - - ' Fett (Bold) Button Click Private Sub btnBold_Click(sender As Object, e As EventArgs) Handles btnBold.Click + If isInitializing Then Return ToggleFontStyle(FontStyle.Bold) End Sub - ' Kursiv (Italic) Button Click Private Sub btnItalic_Click(sender As Object, e As EventArgs) Handles btnItalic.Click + If isInitializing Then Return ToggleFontStyle(FontStyle.Italic) End Sub - ' Unterstrichen (Underline) Button Click Private Sub btnUnderline_Click(sender As Object, e As EventArgs) Handles btnUnderline.Click + If isInitializing Then Return ToggleFontStyle(FontStyle.Underline) End Sub - ' Textfarbe ändern Button Click Private Sub btnTextColor_Click(sender As Object, e As EventArgs) Handles btnTextColor.Click + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile1.SelectionColor = colorDialogText.Color - hatAenderung = True + AktuelleRichTextBox.SelectionColor = colorDialogText.Color End If End Sub - ' Hintergrundfarbe ändern Button Click Private Sub btnBackColor_Click(sender As Object, e As EventArgs) Handles btnBackColor.Click + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile1.SelectionBackColor = colorDialogText.Color - hatAenderung = True + AktuelleRichTextBox.SelectionBackColor = colorDialogText.Color End If End Sub - ' Links ausrichten Button Click Private Sub btnAlignLeft_Click(sender As Object, e As EventArgs) Handles btnAlignLeft.Click - rtbZeile1.SelectionAlignment = HorizontalAlignment.Left - hatAenderung = True + If isInitializing Then Return + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + AktuelleRichTextBox.SelectionAlignment = HorizontalAlignment.Left End Sub - ' Mitte ausrichten Button Click Private Sub btnAlignCenter_Click(sender As Object, e As EventArgs) Handles btnAlignCenter.Click - rtbZeile1.SelectionAlignment = HorizontalAlignment.Center - hatAenderung = True + If isInitializing Then Return + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + AktuelleRichTextBox.SelectionAlignment = HorizontalAlignment.Center End Sub - ' Rechts ausrichten Button Click Private Sub btnAlignRight_Click(sender As Object, e As EventArgs) Handles btnAlignRight.Click - rtbZeile1.SelectionAlignment = HorizontalAlignment.Right - hatAenderung = True - End Sub - - ' Schriftfamilie ComboBox SelectionChanged - Private Sub cmbFontFamily2_SelectedIndexChanged(sender As Object, e As EventArgs) - UpdateFont2() - End Sub - - ' Schriftgröße ComboBox SelectionChanged - Private Sub cmbFontSize2_SelectedIndexChanged(sender As Object, e As EventArgs) - UpdateFont2() - End Sub - - Private Sub UpdateFont2() - Dim selectedFontFamily As String = If(cmbFontFamily2.SelectedItem, rtbZeile2.SelectionFont?.FontFamily.Name) - Dim selectedFontSize As Single - If Single.TryParse(cmbFontSize2.SelectedItem, selectedFontSize) Then - ' Überprüfen, ob eine Auswahl vorhanden ist - If rtbZeile2.SelectionLength > 0 Then - ' Erstellen einer neuen Schriftart basierend auf der Auswahl - Dim currentFont As Font = rtbZeile2.SelectionFont - If currentFont IsNot Nothing Then - rtbZeile2.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) - Else - ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen - rtbZeile2.SelectionFont = New Font(selectedFontFamily, selectedFontSize) - End If - Else - ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox - rtbZeile2.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile2.Font.Style) - End If - hatAenderung = True + If isInitializing Then Return + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return End If + AktuelleRichTextBox.SelectionAlignment = HorizontalAlignment.Right End Sub - ' Methode zum Umschalten des Schriftstils - Private Sub ToggleFontStyle2(style As FontStyle) - If rtbZeile2.SelectionFont IsNot Nothing Then - Dim currentFont As Font = rtbZeile2.SelectionFont + Private Sub ToggleFontStyle(style As FontStyle) + If isInitializing Then Return + ' Nur anwenden, wenn tatsächlich etwas markiert ist + If AktuelleRichTextBox.SelectionLength <= 0 Then + Return + End If + + If AktuelleRichTextBox.SelectionFont IsNot Nothing Then + Dim currentFont As Font = AktuelleRichTextBox.SelectionFont Dim newFontStyle As FontStyle - If rtbZeile2.SelectionFont.Style.HasFlag(style) Then + If AktuelleRichTextBox.SelectionFont.Style.HasFlag(style) Then ' Entferne den Stil newFontStyle = currentFont.Style And Not style Else @@ -470,163 +608,18 @@ Public Class frmEintragTvNew End If ' Setze die neue Schriftart - rtbZeile2.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) + AktuelleRichTextBox.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) hatAenderung = True End If End Sub - ' Fett (Bold) Button Click - Private Sub btnBold2_Click(sender As Object, e As EventArgs) Handles btnBold2.Click - ToggleFontStyle2(FontStyle.Bold) - End Sub - - ' Kursiv (Italic) Button Click - Private Sub btnItalic2_Click(sender As Object, e As EventArgs) Handles btnItalic2.Click - ToggleFontStyle2(FontStyle.Italic) - End Sub - - ' Unterstrichen (Underline) Button Click - Private Sub btnUnderline2_Click(sender As Object, e As EventArgs) Handles btnUnderline2.Click - ToggleFontStyle2(FontStyle.Underline) - End Sub - - ' Textfarbe ändern Button Click - Private Sub btnTextColor2_Click(sender As Object, e As EventArgs) Handles btnTextColor2.Click - If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile2.SelectionColor = colorDialogText.Color - hatAenderung = True - End If - End Sub - - ' Hintergrundfarbe ändern Button Click - Private Sub btnBackColor2_Click(sender As Object, e As EventArgs) Handles btnBackColor2.Click - If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile2.SelectionBackColor = colorDialogText.Color - hatAenderung = True - End If - End Sub - - ' Links ausrichten Button Click - Private Sub btnAlignLeft2_Click(sender As Object, e As EventArgs) Handles btnAlignLeft2.Click - rtbZeile2.SelectionAlignment = HorizontalAlignment.Left - hatAenderung = True - End Sub - - ' Mitte ausrichten Button Click - Private Sub btnAlignCenter2_Click(sender As Object, e As EventArgs) Handles btnAlignCenter2.Click - rtbZeile2.SelectionAlignment = HorizontalAlignment.Center - hatAenderung = True - End Sub - - ' Rechts ausrichten Button Click - Private Sub btnAlignRight2_Click(sender As Object, e As EventArgs) Handles btnAlignRight2.Click - rtbZeile2.SelectionAlignment = HorizontalAlignment.Right - hatAenderung = True - End Sub - - ' Schriftfamilie ComboBox SelectionChanged - Private Sub cmbFontFamily3_SelectedIndexChanged(sender As Object, e As EventArgs) - UpdateFont3() - End Sub - - ' Schriftgröße ComboBox SelectionChanged - Private Sub cmbFontSize3_SelectedIndexChanged(sender As Object, e As EventArgs) - UpdateFont3() - End Sub - - Private Sub UpdateFont3() - Dim selectedFontFamily As String = If(cmbFontFamily3.SelectedItem, rtbZeile3.SelectionFont?.FontFamily.Name) - Dim selectedFontSize As Single - If Single.TryParse(cmbFontSize3.SelectedItem, selectedFontSize) Then - ' Überprüfen, ob eine Auswahl vorhanden ist - If rtbZeile3.SelectionLength > 0 Then - ' Erstellen einer neuen Schriftart basierend auf der Auswahl - Dim currentFont As Font = rtbZeile3.SelectionFont - If currentFont IsNot Nothing Then - rtbZeile3.SelectionFont = New Font(selectedFontFamily, selectedFontSize, currentFont.Style) - Else - ' Wenn die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen - rtbZeile3.SelectionFont = New Font(selectedFontFamily, selectedFontSize) - End If - Else - ' Wenn keine Auswahl vorhanden ist, setzen Sie die Standard-Schriftart der RichTextBox - rtbZeile3.Font = New Font(selectedFontFamily, selectedFontSize, rtbZeile3.Font.Style) - End If - hatAenderung = True - End If - End Sub - - ' Methode zum Umschalten des Schriftstils - Private Sub ToggleFontStyle3(style As FontStyle) - If rtbZeile3.SelectionFont IsNot Nothing Then - Dim currentFont As Font = rtbZeile3.SelectionFont - Dim newFontStyle As FontStyle - - If rtbZeile3.SelectionFont.Style.HasFlag(style) Then - ' Entferne den Stil - newFontStyle = currentFont.Style And Not style - Else - ' Füge den Stil hinzu - newFontStyle = currentFont.Style Or style - End If - - ' Setze die neue Schriftart - rtbZeile3.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) - hatAenderung = True - End If - End Sub - - ' Fett (Bold) Button Click - Private Sub btnBold3_Click(sender As Object, e As EventArgs) Handles btnBold3.Click - ToggleFontStyle3(FontStyle.Bold) - End Sub - - ' Kursiv (Italic) Button Click - Private Sub btnItalic3_Click(sender As Object, e As EventArgs) Handles btnItalic3.Click - ToggleFontStyle3(FontStyle.Italic) - End Sub - - ' Unterstrichen (Underline) Button Click - Private Sub btnUnderline3_Click(sender As Object, e As EventArgs) Handles btnUnderline3.Click - ToggleFontStyle3(FontStyle.Underline) - End Sub - - ' Textfarbe ändern Button Click - Private Sub btnTextColor3_Click(sender As Object, e As EventArgs) Handles btnTextColor3.Click - If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile3.SelectionColor = colorDialogText.Color - hatAenderung = True - End If - End Sub - - ' Hintergrundfarbe ändern Button Click - Private Sub btnBackColor3_Click(sender As Object, e As EventArgs) Handles btnBackColor3.Click - If colorDialogText.ShowDialog() = DialogResult.OK Then - rtbZeile3.SelectionBackColor = colorDialogText.Color - hatAenderung = True - End If - End Sub - - ' Links ausrichten Button Click - Private Sub btnAlignLeft3_Click(sender As Object, e As EventArgs) Handles btnAlignLeft3.Click - rtbZeile3.SelectionAlignment = HorizontalAlignment.Left - hatAenderung = True - End Sub - - ' Mitte ausrichten Button Click - Private Sub btnAlignCenter3_Click(sender As Object, e As EventArgs) Handles btnAlignCenter3.Click - rtbZeile3.SelectionAlignment = HorizontalAlignment.Center - hatAenderung = True - End Sub - - ' Rechts ausrichten Button Click - Private Sub btnAlignRight3_Click(sender As Object, e As EventArgs) Handles btnAlignRight3.Click - rtbZeile3.SelectionAlignment = HorizontalAlignment.Right - hatAenderung = True - End Sub Private Sub LadeTvTextBezeichnungen() isInitializing = True + + ' Event-Handler entfernen, um zu verhindern, dass SelectedIndexChanged zu früh feuert + RemoveHandler cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, AddressOf cmbTvTextBezeichnungAuswahl_SelectedIndexChanged + Dim bezeichnungen As New List(Of cTvTextBezeichnung)() Try @@ -634,32 +627,34 @@ Public Class frmEintragTvNew Catch ex As Exception MessageBox.Show("Fehler beim Laden der TvTextBezeichnungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) isInitializing = False + ' Event-Handler wieder hinzufügen, bevor wir verlassen + AddHandler cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, AddressOf cmbTvTextBezeichnungAuswahl_SelectedIndexChanged Return End Try Dim items As New List(Of ComboBoxItem)() - For Each bezeichnung In bezeichnungen items.Add(New ComboBoxItem() With { - .ID = bezeichnung.TvTextBezeichnungID, - .DisplayText = bezeichnung.TvTextBezeichnung - }) + .ID = bezeichnung.TvTextBezeichnungID, + .DisplayText = bezeichnung.TvTextBezeichnung + }) Next + cmbTvTextBezeichnungAuswahl.DataSource = Nothing cmbTvTextBezeichnungAuswahl.DataSource = items cmbTvTextBezeichnungAuswahl.DisplayMember = "DisplayText" cmbTvTextBezeichnungAuswahl.ValueMember = "ID" cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 cmbPosition.SelectedIndex = -1 + isInitializing = False - Debug.WriteLine("TvTextBezeichnungen geladen:") - For Each item In items - Debug.WriteLine($"ID: {item.ID}, Text: {item.DisplayText}") - Next + ' Event-Handler jetzt, nachdem alles fertig ist, wieder hinzufügen + AddHandler cmbTvTextBezeichnungAuswahl.SelectedIndexChanged, AddressOf cmbTvTextBezeichnungAuswahl_SelectedIndexChanged End Sub + Private Sub txtNeueTvTextBezeichnung_TextChanged(sender As Object, e As EventArgs) Handles txtNeueTvTextBezeichnung.TextChanged If Not String.IsNullOrWhiteSpace(txtNeueTvTextBezeichnung.Text) Then cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 @@ -731,7 +726,6 @@ Public Class frmEintragTvNew chkIsActive.Checked = aviso.IsActive - grpWochentage.Enabled = chkIsRecurring.Checked End Sub @@ -740,138 +734,110 @@ Public Class frmEintragTvNew rtb.Rtf = rtf Dim sb As New System.Text.StringBuilder() - ' Initialisiere die HTML-Struktur - sb.Append("") - - ' Teile den Text in Absätze auf - Dim paragraphs As String() = rtb.Text.Split(New String() {vbCrLf, vbLf}, StringSplitOptions.None) - + Dim defaultFont As System.Drawing.Font = rtb.Font + Dim totalLength As Integer = rtb.TextLength Dim charIndex As Integer = 0 - For Each paragraph As String In paragraphs - ' Wähle den aktuellen Absatz aus - rtb.Select(charIndex, paragraph.Length) + While charIndex < totalLength + ' Wähle das aktuelle Zeichen aus + rtb.Select(charIndex, 1) - ' Erhalte die Ausrichtung des aktuellen Absatzes - Dim alignment As HorizontalAlignment = rtb.SelectionAlignment + ' Hole die Formatierung des aktuellen Zeichens + Dim startFont As System.Drawing.Font = rtb.SelectionFont + Dim startColor As Color = rtb.SelectionColor + Dim startBackColor As Color = rtb.SelectionBackColor + Dim startAlignment As HorizontalAlignment = rtb.SelectionAlignment - ' Öffne einen Div-Tag mit der entsprechenden Textausrichtung - Select Case alignment - Case HorizontalAlignment.Left - sb.Append("
") - Case HorizontalAlignment.Center - sb.Append("
") - Case HorizontalAlignment.Right - sb.Append("
") - Case Else - sb.Append("
") - End Select + If startFont Is Nothing Then + startFont = defaultFont + End If - ' Setze die aktuellen Formatierungsvariablen auf Nothing/Empty, um beim ersten Zeichen zu starten - Dim currentFont As System.Drawing.Font = Nothing - Dim currentColor As Color = Color.Empty - Dim currentBackColor As Color = Color.Empty - Dim currentBold As Boolean = False - Dim currentItalic As Boolean = False - Dim currentUnderline As Boolean = False + ' Initialisiere die Lauf-Länge + Dim runLength As Integer = 1 - ' Iteriere durch die Zeichen im Absatz - For i As Integer = 0 To paragraph.Length - 1 - Dim globalIndex As Integer = charIndex + i - rtb.Select(globalIndex, 1) - Dim font As System.Drawing.Font = rtb.SelectionFont - Dim color As Color = rtb.SelectionColor - Dim backColor As Color = rtb.SelectionBackColor + ' Finde die Länge des Laufs + While (charIndex + runLength < totalLength) + rtb.Select(charIndex + runLength, 1) + Dim currentFont As System.Drawing.Font = rtb.SelectionFont + Dim currentColor As Color = rtb.SelectionColor + Dim currentBackColor As Color = rtb.SelectionBackColor + Dim currentAlignment As HorizontalAlignment = rtb.SelectionAlignment - ' Bestimme die Schriftstile - Dim isBold As Boolean = font IsNot Nothing AndAlso font.Bold - Dim isItalic As Boolean = font IsNot Nothing AndAlso font.Italic - Dim isUnderline As Boolean = font IsNot Nothing AndAlso font.Underline - - ' Überprüfe, ob sich die Formatierung geändert hat - If font IsNot currentFont OrElse color <> currentColor OrElse backColor <> currentBackColor OrElse isBold <> currentBold OrElse isItalic <> currentItalic OrElse isUnderline <> currentUnderline Then - ' Schließe vorherige Font-, Farb- und Hintergrundfarb-Tags - If currentFont IsNot Nothing OrElse color <> Color.Empty OrElse backColor <> Color.Empty OrElse currentBold OrElse currentItalic OrElse currentUnderline Then - sb.Append("") - End If - - ' Öffne ein neues Span-Tag mit den aktuellen Stilen - Dim style As New System.Text.StringBuilder() - - If font IsNot Nothing Then - style.Append($"font-family:{font.FontFamily.Name}; ") - style.Append($"font-size:{font.SizeInPoints}pt; ") - End If - - If color <> Color.Empty Then - style.Append($"color:{ColorTranslator.ToHtml(color)}; ") - End If - - If backColor <> Color.Empty Then - style.Append($"background-color:{ColorTranslator.ToHtml(backColor)}; ") - End If - - If isBold Then - style.Append($"font-weight:bold; ") - End If - - If isItalic Then - style.Append($"font-style:italic; ") - End If - - If isUnderline Then - style.Append($"text-decoration:underline; ") - End If - - If style.Length > 0 Then - sb.Append($"") - End If - - ' Aktualisiere die aktuellen Formatierungsvariablen - currentFont = font - currentColor = color - currentBackColor = backColor - currentBold = isBold - currentItalic = isItalic - currentUnderline = isUnderline + If currentFont Is Nothing Then + currentFont = defaultFont End If - ' Füge das aktuelle Zeichen hinzu (HTML-encodiert) - Dim currentChar As Char = paragraph(i) - Select Case currentChar - Case "<" - sb.Append("<") - Case ">" - sb.Append(">") - Case "&" - sb.Append("&") - Case Else - sb.Append(currentChar) - End Select - Next + ' Überprüfe, ob die Formatierung gleich ist + If Not FontsAreEqual(startFont, currentFont) OrElse + startColor <> currentColor OrElse + startBackColor <> currentBackColor OrElse + startAlignment <> currentAlignment Then + Exit While + End If - ' Schließe verbleibende Tags im Absatz - If currentFont IsNot Nothing OrElse currentColor <> Color.Empty OrElse currentBackColor <> Color.Empty OrElse currentBold OrElse currentItalic OrElse currentUnderline Then - sb.Append("") + runLength += 1 + End While + + ' Hole den Text des Laufs + Dim runText As String = rtb.Text.Substring(charIndex, runLength) + Dim style As New System.Text.StringBuilder() + + Select Case startAlignment + Case HorizontalAlignment.Left + ' nichts hinzufügen, da Standard + Case HorizontalAlignment.Center + style.Append("text-align:center;") + Case HorizontalAlignment.Right + style.Append("text-align:right;") + End Select + + If startFont IsNot Nothing Then + style.Append($"font-family:{startFont.FontFamily.Name};") + style.Append($"font-size:{startFont.SizeInPoints}pt;") + If startFont.Bold Then + style.Append("font-weight:bold;") + End If + If startFont.Italic Then + style.Append("font-style:italic;") + End If + If startFont.Underline Then + style.Append("text-decoration:underline;") + End If End If - ' Schließe den Div-Tag für den Absatz + If startColor <> Color.Empty Then + style.Append($"color:{ColorTranslator.ToHtml(startColor)};") + End If + + If startBackColor <> Color.Empty Then + style.Append($"background-color:{ColorTranslator.ToHtml(startBackColor)};") + End If + + If style.Length > 0 Then + sb.Append($"
") + Else + sb.Append("
") + End If + + Dim encodedText As String = System.Net.WebUtility.HtmlEncode(runText) + sb.Append(encodedText) + sb.Append("
") - ' Aktualisiere den charIndex für den nächsten Absatz (+2 für vbCrLf, könnte je nach Zeilenumbrüchen variieren) - ' Überprüfe den tatsächlichen Zeilenumbruch und passe gegebenenfalls an - If charIndex + paragraph.Length + 2 <= rtb.Text.Length Then - charIndex += paragraph.Length + 2 ' Annahme: \r\n als Zeilenumbruch - Else - charIndex += paragraph.Length - End If - Next + charIndex += runLength + End While - sb.Append("") Return sb.ToString() End Using End Function + Private Function FontsAreEqual(font1 As System.Drawing.Font, font2 As System.Drawing.Font) As Boolean + Return font1.FontFamily.Name = font2.FontFamily.Name AndAlso + font1.SizeInPoints = font2.SizeInPoints AndAlso + font1.Style = font2.Style + End Function + + Private Sub btnSpeichern_Click(sender As Object, e As EventArgs) Handles btnSpeichern.Click Dim verwendeteTvTextBezeichnung As String = "" Dim isNeueTvTextBezeichnung As Boolean = False @@ -978,12 +944,12 @@ Public Class frmEintragTvNew list.Clear() AvisoTvNewDAL.LesenAvisoTvNew(0, "", currentStandort, list) - ' **Nach dem Speichern und Neuladen der Daten** + ' Nach dem Speichern und Neuladen der Daten initdgv() hatAenderung = False If isNeueTvTextBezeichnung Then - ' **Setze lastSelectedTVID auf die TVID des neuen Eintrags** + ' Setze lastSelectedTVID auf die TVID des neuen Eintrags lastSelectedTVID = myAvisoTvNew.TvTextBezeichnungID MessageBox.Show("Die neue TvTextBezeichnung wurde erfolgreich gespeichert.", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) cmbTvTextBezeichnungAuswahl.SelectedValue = myAvisoTvNew.TvTextBezeichnungID @@ -1009,7 +975,7 @@ Public Class frmEintragTvNew AvisoTvNewDAL.SetzeAufInaktiv(myAvisoTvNew.TvTextBezeichnungID) list.Clear() AvisoTvNewDAL.LesenAvisoTvNew(0, "", cbxStandort.SelectedItem?.ToString(), list) - initdgv() + initdgv() ' Verwende jetzt die parameterlose Methode ClearFields() myAvisoTvNew = Nothing Neuanlage = False @@ -1057,6 +1023,22 @@ Public Class frmEintragTvNew grpWochentage.Enabled = chkIsRecurring.Checked End Sub + Private ReadOnly Property AktuelleRichTextBox As RichTextBox + Get + Select Case tabControlZeilen.SelectedIndex + Case 0 + Return rtbZeile1 + Case 1 + Return rtbZeile2 + Case 2 + Return rtbZeile3 + Case Else + Return rtbZeile1 + End Select + End Get + End Property + + Private Sub ClearFields() cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 cmbPosition.SelectedIndex = -1 diff --git a/Aviso/frmTvSettings.Designer.vb b/Aviso/frmTvSettings.Designer.vb new file mode 100644 index 0000000..8d41e74 --- /dev/null +++ b/Aviso/frmTvSettings.Designer.vb @@ -0,0 +1,286 @@ + +Partial Class frmTvSettings + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Wird vom Windows Form-Designer benötigt. + Private components As System.ComponentModel.IContainer + + 'Die folgenden Steuerelemente werden benötigt. + Private WithEvents lblTileWidth As Label + Private WithEvents lblTileHeight As Label + Private WithEvents lblFontSizeLkwNummer As Label + Private WithEvents lblFontSizeDateTime As Label + Private WithEvents lblSeitenwechsel As Label + Private WithEvents lblTextBalkenHeight As Label ' Neues Label + Private WithEvents lblLogoSelection As Label ' Neues Label für Logo-Auswahl + Private WithEvents numTileWidth As NumericUpDown + Private WithEvents numTileHeight As NumericUpDown + Private WithEvents numFontSizeLkwNummer As NumericUpDown + Private WithEvents numFontSizeDateTime As NumericUpDown + Private WithEvents numSeitenwechsel As NumericUpDown + Private WithEvents numTextBalkenHeight As NumericUpDown ' Neues NumericUpDown + Private WithEvents cmbLogoSelection As ComboBox ' Neue ComboBox für Logo-Auswahl + Private WithEvents btnSave As Button + + 'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich. + 'Das Bearbeiten ist mit dem Windows Form-Designer möglich. + 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. + + Private Sub InitializeComponent() + Me.lblTileWidth = New System.Windows.Forms.Label() + Me.lblTileHeight = New System.Windows.Forms.Label() + Me.lblFontSizeLkwNummer = New System.Windows.Forms.Label() + Me.lblFontSizeDateTime = New System.Windows.Forms.Label() + Me.lblSeitenwechsel = New System.Windows.Forms.Label() + Me.lblTextBalkenHeight = New System.Windows.Forms.Label() + Me.lblLogoSelection = New System.Windows.Forms.Label() + Me.numTileWidth = New System.Windows.Forms.NumericUpDown() + Me.numTileHeight = New System.Windows.Forms.NumericUpDown() + Me.numFontSizeLkwNummer = New System.Windows.Forms.NumericUpDown() + Me.numFontSizeDateTime = New System.Windows.Forms.NumericUpDown() + Me.numSeitenwechsel = New System.Windows.Forms.NumericUpDown() + Me.numTextBalkenHeight = New System.Windows.Forms.NumericUpDown() + Me.cmbLogoSelection = New System.Windows.Forms.ComboBox() + Me.btnSave = New System.Windows.Forms.Button() + Me.numKachelRowGapInPercent = New System.Windows.Forms.NumericUpDown() + Me.Label1 = New System.Windows.Forms.Label() + CType(Me.numTileWidth, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numTileHeight, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numFontSizeLkwNummer, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numFontSizeDateTime, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numSeitenwechsel, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numTextBalkenHeight, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numKachelRowGapInPercent, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblTileWidth + ' + Me.lblTileWidth.AutoSize = True + Me.lblTileWidth.Location = New System.Drawing.Point(22, 66) + Me.lblTileWidth.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblTileWidth.Name = "lblTileWidth" + Me.lblTileWidth.Size = New System.Drawing.Size(87, 13) + Me.lblTileWidth.TabIndex = 0 + Me.lblTileWidth.Text = "Kachel Breite (%)" + ' + 'lblTileHeight + ' + Me.lblTileHeight.AutoSize = True + Me.lblTileHeight.Location = New System.Drawing.Point(21, 27) + Me.lblTileHeight.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblTileHeight.Name = "lblTileHeight" + Me.lblTileHeight.Size = New System.Drawing.Size(86, 13) + Me.lblTileHeight.TabIndex = 1 + Me.lblTileHeight.Text = "Kachel Höhe (%)" + ' + 'lblFontSizeLkwNummer + ' + Me.lblFontSizeLkwNummer.AutoSize = True + Me.lblFontSizeLkwNummer.Location = New System.Drawing.Point(21, 151) + Me.lblFontSizeLkwNummer.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblFontSizeLkwNummer.Name = "lblFontSizeLkwNummer" + Me.lblFontSizeLkwNummer.Size = New System.Drawing.Size(133, 13) + Me.lblFontSizeLkwNummer.TabIndex = 2 + Me.lblFontSizeLkwNummer.Text = "Schriftgröße LKW Nummer" + ' + 'lblFontSizeDateTime + ' + Me.lblFontSizeDateTime.AutoSize = True + Me.lblFontSizeDateTime.Location = New System.Drawing.Point(21, 191) + Me.lblFontSizeDateTime.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblFontSizeDateTime.Name = "lblFontSizeDateTime" + Me.lblFontSizeDateTime.Size = New System.Drawing.Size(121, 13) + Me.lblFontSizeDateTime.TabIndex = 3 + Me.lblFontSizeDateTime.Text = "Schriftgröße Datum/Zeit" + ' + 'lblSeitenwechsel + ' + Me.lblSeitenwechsel.AutoSize = True + Me.lblSeitenwechsel.Location = New System.Drawing.Point(21, 232) + Me.lblSeitenwechsel.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblSeitenwechsel.Name = "lblSeitenwechsel" + Me.lblSeitenwechsel.Size = New System.Drawing.Size(134, 13) + Me.lblSeitenwechsel.TabIndex = 4 + Me.lblSeitenwechsel.Text = "Seitenwechsel (Sekunden)" + ' + 'lblTextBalkenHeight + ' + Me.lblTextBalkenHeight.AutoSize = True + Me.lblTextBalkenHeight.Location = New System.Drawing.Point(21, 273) + Me.lblTextBalkenHeight.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblTextBalkenHeight.Name = "lblTextBalkenHeight" + Me.lblTextBalkenHeight.Size = New System.Drawing.Size(110, 13) + Me.lblTextBalkenHeight.TabIndex = 5 + Me.lblTextBalkenHeight.Text = "Text Balken Höhe (%)" + ' + 'lblLogoSelection + ' + Me.lblLogoSelection.AutoSize = True + Me.lblLogoSelection.Location = New System.Drawing.Point(21, 313) + Me.lblLogoSelection.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.lblLogoSelection.Name = "lblLogoSelection" + Me.lblLogoSelection.Size = New System.Drawing.Size(85, 13) + Me.lblLogoSelection.TabIndex = 13 + Me.lblLogoSelection.Text = "Logo auswählen" + ' + 'numTileWidth + ' + Me.numTileWidth.DecimalPlaces = 2 + Me.numTileWidth.Location = New System.Drawing.Point(165, 66) + Me.numTileWidth.Margin = New System.Windows.Forms.Padding(2) + Me.numTileWidth.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numTileWidth.Name = "numTileWidth" + Me.numTileWidth.Size = New System.Drawing.Size(90, 20) + Me.numTileWidth.TabIndex = 6 + Me.numTileWidth.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'numTileHeight + ' + Me.numTileHeight.DecimalPlaces = 2 + Me.numTileHeight.Location = New System.Drawing.Point(164, 25) + Me.numTileHeight.Margin = New System.Windows.Forms.Padding(2) + Me.numTileHeight.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numTileHeight.Name = "numTileHeight" + Me.numTileHeight.Size = New System.Drawing.Size(90, 20) + Me.numTileHeight.TabIndex = 7 + Me.numTileHeight.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'numFontSizeLkwNummer + ' + Me.numFontSizeLkwNummer.DecimalPlaces = 2 + Me.numFontSizeLkwNummer.Location = New System.Drawing.Point(164, 149) + Me.numFontSizeLkwNummer.Margin = New System.Windows.Forms.Padding(2) + Me.numFontSizeLkwNummer.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numFontSizeLkwNummer.Name = "numFontSizeLkwNummer" + Me.numFontSizeLkwNummer.Size = New System.Drawing.Size(90, 20) + Me.numFontSizeLkwNummer.TabIndex = 8 + Me.numFontSizeLkwNummer.Value = New Decimal(New Integer() {12, 0, 0, 0}) + ' + 'numFontSizeDateTime + ' + Me.numFontSizeDateTime.DecimalPlaces = 2 + Me.numFontSizeDateTime.Location = New System.Drawing.Point(164, 190) + Me.numFontSizeDateTime.Margin = New System.Windows.Forms.Padding(2) + Me.numFontSizeDateTime.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numFontSizeDateTime.Name = "numFontSizeDateTime" + Me.numFontSizeDateTime.Size = New System.Drawing.Size(90, 20) + Me.numFontSizeDateTime.TabIndex = 9 + Me.numFontSizeDateTime.Value = New Decimal(New Integer() {12, 0, 0, 0}) + ' + 'numSeitenwechsel + ' + Me.numSeitenwechsel.Location = New System.Drawing.Point(164, 230) + Me.numSeitenwechsel.Margin = New System.Windows.Forms.Padding(2) + Me.numSeitenwechsel.Maximum = New Decimal(New Integer() {3600, 0, 0, 0}) + Me.numSeitenwechsel.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numSeitenwechsel.Name = "numSeitenwechsel" + Me.numSeitenwechsel.Size = New System.Drawing.Size(90, 20) + Me.numSeitenwechsel.TabIndex = 10 + Me.numSeitenwechsel.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'numTextBalkenHeight + ' + Me.numTextBalkenHeight.DecimalPlaces = 2 + Me.numTextBalkenHeight.Location = New System.Drawing.Point(164, 271) + Me.numTextBalkenHeight.Margin = New System.Windows.Forms.Padding(2) + Me.numTextBalkenHeight.Name = "numTextBalkenHeight" + Me.numTextBalkenHeight.Size = New System.Drawing.Size(90, 20) + Me.numTextBalkenHeight.TabIndex = 11 + Me.numTextBalkenHeight.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'cmbLogoSelection + ' + Me.cmbLogoSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbLogoSelection.FormattingEnabled = True + Me.cmbLogoSelection.Location = New System.Drawing.Point(164, 311) + Me.cmbLogoSelection.Margin = New System.Windows.Forms.Padding(2) + Me.cmbLogoSelection.Name = "cmbLogoSelection" + Me.cmbLogoSelection.Size = New System.Drawing.Size(91, 21) + Me.cmbLogoSelection.TabIndex = 14 + ' + 'btnSave + ' + Me.btnSave.Location = New System.Drawing.Point(164, 346) + Me.btnSave.Margin = New System.Windows.Forms.Padding(2) + Me.btnSave.Name = "btnSave" + Me.btnSave.Size = New System.Drawing.Size(90, 24) + Me.btnSave.TabIndex = 15 + Me.btnSave.Text = "Speichern" + Me.btnSave.UseVisualStyleBackColor = True + ' + 'numKachelRowGapInPercent + ' + Me.numKachelRowGapInPercent.DecimalPlaces = 2 + Me.numKachelRowGapInPercent.Location = New System.Drawing.Point(164, 106) + Me.numKachelRowGapInPercent.Margin = New System.Windows.Forms.Padding(2) + Me.numKachelRowGapInPercent.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) + Me.numKachelRowGapInPercent.Name = "numKachelRowGapInPercent" + Me.numKachelRowGapInPercent.Size = New System.Drawing.Size(90, 20) + Me.numKachelRowGapInPercent.TabIndex = 17 + Me.numKachelRowGapInPercent.Value = New Decimal(New Integer() {12, 0, 0, 0}) + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(21, 108) + Me.Label1.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(123, 13) + Me.Label1.TabIndex = 16 + Me.Label1.Text = "Abstand Kachel Text (%)" + ' + 'frmTvSettings + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(306, 409) + Me.Controls.Add(Me.numKachelRowGapInPercent) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.btnSave) + Me.Controls.Add(Me.cmbLogoSelection) + Me.Controls.Add(Me.numTextBalkenHeight) + Me.Controls.Add(Me.numSeitenwechsel) + Me.Controls.Add(Me.numFontSizeDateTime) + Me.Controls.Add(Me.numFontSizeLkwNummer) + Me.Controls.Add(Me.numTileHeight) + Me.Controls.Add(Me.numTileWidth) + Me.Controls.Add(Me.lblLogoSelection) + Me.Controls.Add(Me.lblTextBalkenHeight) + Me.Controls.Add(Me.lblSeitenwechsel) + Me.Controls.Add(Me.lblFontSizeDateTime) + Me.Controls.Add(Me.lblFontSizeLkwNummer) + Me.Controls.Add(Me.lblTileHeight) + Me.Controls.Add(Me.lblTileWidth) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.Margin = New System.Windows.Forms.Padding(2) + Me.MaximizeBox = False + Me.Name = "frmTvSettings" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "TV Einstellungen" + CType(Me.numTileWidth, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numTileHeight, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numFontSizeLkwNummer, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numFontSizeDateTime, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numSeitenwechsel, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numTextBalkenHeight, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numKachelRowGapInPercent, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Private WithEvents numKachelRowGapInPercent As NumericUpDown + Private WithEvents Label1 As Label +End Class diff --git a/Aviso/frmTvSettings.resx b/Aviso/frmTvSettings.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Aviso/frmTvSettings.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Aviso/frmTvSettings.vb b/Aviso/frmTvSettings.vb new file mode 100644 index 0000000..2d58d38 --- /dev/null +++ b/Aviso/frmTvSettings.vb @@ -0,0 +1,139 @@ +Imports System.Data.SqlClient +Imports AVISO.frmEintragTvNew +Imports VERAG_PROG_ALLGEMEIN + +Partial Class frmTvSettings + Inherits System.Windows.Forms.Form + + Private standortID As Integer + Private AvisoTvNewDAL As New cAvisoTvNewDAL() + Private list As New List(Of cAvisoTvNew)() + + Public Sub New(standortID As Integer) + InitializeComponent() + Me.standortID = standortID + End Sub + + ' Ereignis-Handler für das Laden des Formulars + Private Sub frmTvSettings_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Try + ' Einstellungen aus der Datenbank laden + Dim settingsList As List(Of cTvSettings) = AvisoTvNewDAL.GetTvSettingsByStandort(standortID) + + ' ComboBox initialisieren + InitializeComboBox() + + If settingsList IsNot Nothing AndAlso settingsList.Count > 0 Then + Dim settings As cTvSettings = settingsList(0) + numTileWidth.Value = If(settings.KachelWidthInPercent >= numTileWidth.Minimum AndAlso settings.KachelWidthInPercent <= numTileWidth.Maximum, CDec(settings.KachelWidthInPercent), 30) + numTileHeight.Value = If(settings.KachelHeightInPercent >= numTileHeight.Minimum AndAlso settings.KachelHeightInPercent <= numTileHeight.Maximum, CDec(settings.KachelHeightInPercent), 30) + numFontSizeLkwNummer.Value = If(settings.KachelFontSizeLkwNummer >= numFontSizeLkwNummer.Minimum AndAlso settings.KachelFontSizeLkwNummer <= numFontSizeLkwNummer.Maximum, CDec(settings.KachelFontSizeLkwNummer), 12) + numFontSizeDateTime.Value = If(settings.KachelFontSizeDateTime >= numFontSizeDateTime.Minimum AndAlso settings.KachelFontSizeDateTime <= numFontSizeDateTime.Maximum, CDec(settings.KachelFontSizeDateTime), 12) + numSeitenwechsel.Value = If(settings.SeitenwechselInSek >= numSeitenwechsel.Minimum AndAlso settings.SeitenwechselInSek <= numSeitenwechsel.Maximum, CDec(settings.SeitenwechselInSek), 30) + numTextBalkenHeight.Value = If(settings.TextBalkenHeightInPercent >= numTextBalkenHeight.Minimum AndAlso settings.TextBalkenHeightInPercent <= numTextBalkenHeight.Maximum, CDec(settings.TextBalkenHeightInPercent), 30) + numKachelRowGapInPercent.Value = If(settings.KachelRowGapInPercent >= numKachelRowGapInPercent.Minimum AndAlso settings.KachelRowGapInPercent <= numKachelRowGapInPercent.Maximum, CDec(settings.KachelRowGapInPercent), 15) + + ' Logo-Auswahl setzen + cmbLogoSelection.SelectedValue = settings.SelectedLogoValue + + ' Überprüfen, ob die Auswahl erfolgreich war + If cmbLogoSelection.SelectedValue Is Nothing Then + ' Wenn nicht, setze auf den ersten Eintrag + cmbLogoSelection.SelectedIndex = 0 + End If + Else + ' Standardwerte verwenden, falls keine Einstellungen vorhanden sind + SetDefaultValues() + End If + Catch ex As Exception + MessageBox.Show("Fehler beim Laden der Einstellungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + SetDefaultValues() + End Try + End Sub + + ' Klasse für ComboBox-Elemente + Public Class ComboBoxItem + Public Property Display As String + Public Property Value As String + + Public Sub New(display As String, value As String) + Me.Display = display + Me.Value = value + End Sub + + Public Overrides Function ToString() As String + Return Display + End Function + End Class + + ' Methode zur Initialisierung der ComboBox + Private Sub InitializeComboBox() + ' Legen Sie die DisplayMember und ValueMember fest + cmbLogoSelection.DisplayMember = "Display" + cmbLogoSelection.ValueMember = "Value" + + ' Erstellen Sie eine Liste von ComboBoxItem-Objekten + Dim logoItems As New List(Of ComboBoxItem) From { + New ComboBoxItem("VERAG AG", "verag.png"), + New ComboBoxItem("ATILLA", "atilla.png"), + New ComboBoxItem("ATILLA TÜRKIYE", "atilla_turkiye.jpg"), + New ComboBoxItem("FRONTOFFICE_SUBEN", "frontoffice_suben.jpg"), + New ComboBoxItem("IMEX", "imex.png"), + New ComboBoxItem("UNISPED", "unisped.jpg") + } + + ' Binden Sie die Liste als DataSource + cmbLogoSelection.DataSource = logoItems + + ' Optional: Setzen Sie die Standardauswahl + If logoItems.Count > 0 Then + cmbLogoSelection.SelectedIndex = 0 + End If + End Sub + + ' Methode zum Setzen der Standardwerte + Private Sub SetDefaultValues() + numTileWidth.Value = 30 + numTileHeight.Value = 30 + numFontSizeLkwNummer.Value = 12 + numFontSizeDateTime.Value = 12 + numSeitenwechsel.Value = 30 + numTextBalkenHeight.Value = 30 + numKachelRowGapInPercent.Value = 15 + + ' Sicherstellen, dass die ComboBox initialisiert ist + If cmbLogoSelection.Items.Count > 0 Then + cmbLogoSelection.SelectedIndex = 0 + End If + End Sub + + ' Ereignis-Handler für den Speichern-Button + Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click + Try + ' Holen Sie sich das ausgewählte ComboBoxItem + Dim selectedItem As ComboBoxItem = CType(cmbLogoSelection.SelectedItem, ComboBoxItem) + Dim selectedValue As String = If(selectedItem IsNot Nothing, selectedItem.Value, String.Empty) + + Dim settings As New cTvSettings() With { + .StandortID = standortID, + .KachelWidthInPercent = CDbl(numTileWidth.Value), + .KachelHeightInPercent = CDbl(numTileHeight.Value), + .KachelFontSizeLkwNummer = CDbl(numFontSizeLkwNummer.Value), + .KachelFontSizeDateTime = CDbl(numFontSizeDateTime.Value), + .SeitenwechselInSek = CDbl(numSeitenwechsel.Value), + .TextBalkenHeightInPercent = CDbl(numTextBalkenHeight.Value), + .KachelRowGapInPercent = CDbl(numKachelRowGapInPercent.Value), + .SelectedLogoValue = selectedValue ' Stellen Sie sicher, dass diese Eigenschaft in cTvSettings existiert + } + + ' Einstellungen in der Datenbank speichern + AvisoTvNewDAL.SaveTvSettings(settings) + + MessageBox.Show("Einstellungen wurden erfolgreich gespeichert!", "Erfolg", MessageBoxButtons.OK, MessageBoxIcon.Information) + Me.Close() + Catch ex As Exception + MessageBox.Show("Fehler beim Speichern der Einstellungen: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + +End Class diff --git a/AvisoTV/frmAnzeige.vb b/AvisoTV/frmAnzeige.vb index 13686d6..f1588af 100644 --- a/AvisoTV/frmAnzeige.vb +++ b/AvisoTV/frmAnzeige.vb @@ -394,7 +394,7 @@ Public Class frmAnzeige r.Cells(0).Style.Font = Font1_MESS Dim doimage As Image = Nothing Select Case r.Cells(0).Value.ToString - Case "PASSPORT" : doimage = My.Resources.passport : r.Cells(0).Value = "PASSPORT" ' r.Cells(0).Value = "PASS" + Case ",pn" : doimage = My.Resources.passport : r.Cells(0).Value = "PASSPORT" ' r.Cells(0).Value = "PASS" Case "DOKUMENT" : doimage = My.Resources.passport : r.Cells(0).Value = "PROBLEM" ' r.Cells(0).Value = "PASS" Case "URGENT" : doimage = My.Resources.urgent_qu : r.Cells(0).Value = "PROBLEM" End Select From 43b091c40ff83c727c6c15602faf42c58245ed33 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 12 Dec 2024 10:40:42 +0100 Subject: [PATCH 6/7] Lkw Chat wieder Aktivieren --- Aviso/usrcntlAktDetails.vb | 1 - 1 file changed, 1 deletion(-) diff --git a/Aviso/usrcntlAktDetails.vb b/Aviso/usrcntlAktDetails.vb index c5bf52b..b57bbe4 100644 --- a/Aviso/usrcntlAktDetails.vb +++ b/Aviso/usrcntlAktDetails.vb @@ -2646,7 +2646,6 @@ Public Class usrcntlAktDetails VERAG_PROG_ALLGEMEIN.cMessenger.SET_LKWCHAT_AKTIV(AvisoID) reload(AvisoID) End If - End If End Sub From 9adffd73976ec6f3b7a10e9bb9ed3b1b80e9dec6 Mon Sep 17 00:00:00 2001 From: "m.ilhan" Date: Thu, 12 Dec 2024 10:44:14 +0100 Subject: [PATCH 7/7] TV APP --- Aviso/frmEintragTvNew.Designer.vb | 53 ++++++++++++------------ Aviso/frmEintragTvNew.vb | 20 +++------ Aviso/frmTvSettings.Designer.vb | 68 ++++++++++++++++++++++++++++--- Aviso/frmTvSettings.vb | 8 +++- 4 files changed, 102 insertions(+), 47 deletions(-) diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb index 51297e9..a59ec43 100644 --- a/Aviso/frmEintragTvNew.Designer.vb +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -43,8 +43,8 @@ Partial Class frmEintragTvNew Friend WithEvents lblZeile1 As Label Friend WithEvents cmbTvTextBezeichnungAuswahl As ComboBox Friend WithEvents lblBezeichnung As Label - Friend WithEvents lblPosition As Label - Friend WithEvents cmbPosition As ComboBox + Friend WithEvents nudPrioritaet As NumericUpDown + Friend WithEvents btnSpeichern As Button Friend WithEvents btnLoeschen As Button Friend WithEvents btnAbbrechen As Button @@ -112,8 +112,7 @@ Partial Class frmEintragTvNew Me.lblZeile1 = New System.Windows.Forms.Label() Me.cmbTvTextBezeichnungAuswahl = New System.Windows.Forms.ComboBox() Me.lblBezeichnung = New System.Windows.Forms.Label() - Me.lblPosition = New System.Windows.Forms.Label() - Me.cmbPosition = New System.Windows.Forms.ComboBox() + Me.nudPrioritaet = New System.Windows.Forms.NumericUpDown() Me.btnBold = New System.Windows.Forms.Button() Me.btnItalic = New System.Windows.Forms.Button() Me.btnUnderline = New System.Windows.Forms.Button() @@ -129,6 +128,7 @@ Partial Class frmEintragTvNew Me.btnAbbrechen = New System.Windows.Forms.Button() Me.chkShowInactive = New System.Windows.Forms.CheckBox() Me.colorDialogText = New System.Windows.Forms.ColorDialog() + Me.Label1 = New System.Windows.Forms.Label() CType(Me.dgvAVISOTV, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpEingabe.SuspendLayout() Me.tabControlZeilen.SuspendLayout() @@ -136,16 +136,17 @@ Partial Class frmEintragTvNew Me.tabPageZeile2.SuspendLayout() Me.tabPageZeile3.SuspendLayout() Me.grpWochentage.SuspendLayout() + CType(Me.nudPrioritaet, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() - + ' + 'btnOpenSettings + ' Me.btnOpenSettings.Location = New System.Drawing.Point(15, 1010) Me.btnOpenSettings.Name = "btnOpenSettings" Me.btnOpenSettings.Size = New System.Drawing.Size(150, 30) Me.btnOpenSettings.TabIndex = 8 Me.btnOpenSettings.Text = "TV Einstellungen" Me.btnOpenSettings.UseVisualStyleBackColor = True - - ' 'cbxStandort ' @@ -180,6 +181,7 @@ Partial Class frmEintragTvNew ' 'grpEingabe ' + Me.grpEingabe.Controls.Add(Me.Label1) Me.grpEingabe.Controls.Add(Me.tabControlZeilen) Me.grpEingabe.Controls.Add(Me.lblNeueTvTextBezeichnung) Me.grpEingabe.Controls.Add(Me.txtNeueTvTextBezeichnung) @@ -197,8 +199,7 @@ Partial Class frmEintragTvNew Me.grpEingabe.Controls.Add(Me.lblZeile1) Me.grpEingabe.Controls.Add(Me.cmbTvTextBezeichnungAuswahl) Me.grpEingabe.Controls.Add(Me.lblBezeichnung) - Me.grpEingabe.Controls.Add(Me.lblPosition) - Me.grpEingabe.Controls.Add(Me.cmbPosition) + Me.grpEingabe.Controls.Add(Me.nudPrioritaet) Me.grpEingabe.Controls.Add(Me.btnBold) Me.grpEingabe.Controls.Add(Me.btnItalic) Me.grpEingabe.Controls.Add(Me.btnUnderline) @@ -510,24 +511,12 @@ Partial Class frmEintragTvNew Me.lblBezeichnung.TabIndex = 0 Me.lblBezeichnung.Text = "Bezeichnung:" ' - 'lblPosition + 'nudPrioritaet ' - Me.lblPosition.AutoSize = True - Me.lblPosition.Location = New System.Drawing.Point(62, 584) - Me.lblPosition.Name = "lblPosition" - Me.lblPosition.Size = New System.Drawing.Size(47, 13) - Me.lblPosition.TabIndex = 21 - Me.lblPosition.Text = "Position:" - ' - 'cmbPosition - ' - Me.cmbPosition.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList - Me.cmbPosition.FormattingEnabled = True - Me.cmbPosition.Items.AddRange(New Object() {"Top", "Middle", "Bottom"}) - Me.cmbPosition.Location = New System.Drawing.Point(125, 576) - Me.cmbPosition.Name = "cmbPosition" - Me.cmbPosition.Size = New System.Drawing.Size(177, 21) - Me.cmbPosition.TabIndex = 22 + Me.nudPrioritaet.Location = New System.Drawing.Point(126, 582) + Me.nudPrioritaet.Name = "nudPrioritaet" + Me.nudPrioritaet.Size = New System.Drawing.Size(60, 20) + Me.nudPrioritaet.TabIndex = 36 ' 'btnBold ' @@ -656,6 +645,15 @@ Partial Class frmEintragTvNew Me.chkShowInactive.Text = "Inaktive anzeigen" Me.chkShowInactive.UseVisualStyleBackColor = True ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(61, 589) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(45, 13) + Me.Label1.TabIndex = 37 + Me.Label1.Text = "Priorität:" + ' 'frmEintragTvNew ' Me.ClientSize = New System.Drawing.Size(1342, 1052) @@ -682,8 +680,11 @@ Partial Class frmEintragTvNew Me.tabPageZeile3.ResumeLayout(False) Me.grpWochentage.ResumeLayout(False) Me.grpWochentage.PerformLayout() + CType(Me.nudPrioritaet, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub + + Friend WithEvents Label1 As Label End Class diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb index 811a7d4..badbcbb 100644 --- a/Aviso/frmEintragTvNew.vb +++ b/Aviso/frmEintragTvNew.vb @@ -646,7 +646,6 @@ Public Class frmEintragTvNew cmbTvTextBezeichnungAuswahl.ValueMember = "ID" cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 - cmbPosition.SelectedIndex = -1 isInitializing = False @@ -669,11 +668,7 @@ Public Class frmEintragTvNew Private Sub FillFieldsFromAviso(ByVal aviso As cAvisoTvNew) cmbTvTextBezeichnungAuswahl.SelectedValue = aviso.TvTextBezeichnungID - If Not String.IsNullOrEmpty(aviso.Position) Then - cmbPosition.SelectedItem = aviso.Position - Else - cmbPosition.SelectedIndex = -1 - End If + txtNeueTvTextBezeichnung.Text = "" @@ -723,7 +718,7 @@ Public Class frmEintragTvNew chkFriday.Checked = aviso.IsFriday.GetValueOrDefault(False) chkSaturday.Checked = aviso.IsSaturday.GetValueOrDefault(False) chkSunday.Checked = aviso.IsSunday.GetValueOrDefault(False) - + nudPrioritaet.Value = Convert.ToDecimal(aviso.Art) chkIsActive.Checked = aviso.IsActive grpWochentage.Enabled = chkIsRecurring.Checked @@ -885,11 +880,7 @@ Public Class frmEintragTvNew Dim htmlContent3 As String = ConvertRtfToHtml(rtfContent3) myAvisoTvNew.TvTextBezeichnung = verwendeteTvTextBezeichnung myAvisoTvNew.StandortID = currentStandortID - If cmbPosition.SelectedIndex >= 0 Then - myAvisoTvNew.Position = cmbPosition.SelectedItem.ToString() - Else - myAvisoTvNew.Position = Nothing - End If + If isNeueTvTextBezeichnung Then If AvisoTvNewDAL.IstTvTextBezeichnungVorhanden(myAvisoTvNew.TvTextBezeichnung) Then MessageBox.Show("Die TvTextBezeichnung ist vorhanden. Bitte wählen Sie eine eindeutige TvTextBezeichnung.", "Eingabefehler", MessageBoxButtons.OK, MessageBoxIcon.Warning) @@ -925,6 +916,7 @@ Public Class frmEintragTvNew myAvisoTvNew.IsSunday = chkSunday.Checked myAvisoTvNew.IsActive = chkIsActive.Checked + myAvisoTvNew.Art = Convert.ToInt32(nudPrioritaet.Value) If Neuanlage Then myAvisoTvNew.Standort = cbxStandort.SelectedItem?.ToString() @@ -975,7 +967,7 @@ Public Class frmEintragTvNew AvisoTvNewDAL.SetzeAufInaktiv(myAvisoTvNew.TvTextBezeichnungID) list.Clear() AvisoTvNewDAL.LesenAvisoTvNew(0, "", cbxStandort.SelectedItem?.ToString(), list) - initdgv() ' Verwende jetzt die parameterlose Methode + initdgv() ClearFields() myAvisoTvNew = Nothing Neuanlage = False @@ -1041,11 +1033,11 @@ Public Class frmEintragTvNew Private Sub ClearFields() cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 - cmbPosition.SelectedIndex = -1 txtNeueTvTextBezeichnung.Text = "" rtbZeile1.Text = "" rtbZeile2.Text = "" rtbZeile3.Text = "" + nudPrioritaet.Value = Convert.ToDecimal(0) dtpStartDate.Value = DateTime.Now dtpStartDate.Checked = False dtpEndDate.Value = DateTime.Now diff --git a/Aviso/frmTvSettings.Designer.vb b/Aviso/frmTvSettings.Designer.vb index 8d41e74..3d771e1 100644 --- a/Aviso/frmTvSettings.Designer.vb +++ b/Aviso/frmTvSettings.Designer.vb @@ -56,6 +56,10 @@ Partial Class frmTvSettings Me.btnSave = New System.Windows.Forms.Button() Me.numKachelRowGapInPercent = New System.Windows.Forms.NumericUpDown() Me.Label1 = New System.Windows.Forms.Label() + Me.numTextFLaggeLeft = New System.Windows.Forms.NumericUpDown() + Me.numTextFlaggeBottom = New System.Windows.Forms.NumericUpDown() + Me.Label2 = New System.Windows.Forms.Label() + Me.Label3 = New System.Windows.Forms.Label() CType(Me.numTileWidth, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.numTileHeight, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.numFontSizeLkwNummer, System.ComponentModel.ISupportInitialize).BeginInit() @@ -63,6 +67,8 @@ Partial Class frmTvSettings CType(Me.numSeitenwechsel, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.numTextBalkenHeight, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.numKachelRowGapInPercent, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numTextFLaggeLeft, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numTextFlaggeBottom, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'lblTileWidth @@ -128,7 +134,7 @@ Partial Class frmTvSettings 'lblLogoSelection ' Me.lblLogoSelection.AutoSize = True - Me.lblLogoSelection.Location = New System.Drawing.Point(21, 313) + Me.lblLogoSelection.Location = New System.Drawing.Point(24, 389) Me.lblLogoSelection.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) Me.lblLogoSelection.Name = "lblLogoSelection" Me.lblLogoSelection.Size = New System.Drawing.Size(85, 13) @@ -186,7 +192,7 @@ Partial Class frmTvSettings Me.numSeitenwechsel.Maximum = New Decimal(New Integer() {3600, 0, 0, 0}) Me.numSeitenwechsel.Minimum = New Decimal(New Integer() {1, 0, 0, 0}) Me.numSeitenwechsel.Name = "numSeitenwechsel" - Me.numSeitenwechsel.Size = New System.Drawing.Size(90, 20) + Me.numSeitenwechsel.Size = New System.Drawing.Size(92, 20) Me.numSeitenwechsel.TabIndex = 10 Me.numSeitenwechsel.Value = New Decimal(New Integer() {30, 0, 0, 0}) ' @@ -196,7 +202,7 @@ Partial Class frmTvSettings Me.numTextBalkenHeight.Location = New System.Drawing.Point(164, 271) Me.numTextBalkenHeight.Margin = New System.Windows.Forms.Padding(2) Me.numTextBalkenHeight.Name = "numTextBalkenHeight" - Me.numTextBalkenHeight.Size = New System.Drawing.Size(90, 20) + Me.numTextBalkenHeight.Size = New System.Drawing.Size(92, 20) Me.numTextBalkenHeight.TabIndex = 11 Me.numTextBalkenHeight.Value = New Decimal(New Integer() {30, 0, 0, 0}) ' @@ -204,7 +210,7 @@ Partial Class frmTvSettings ' Me.cmbLogoSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cmbLogoSelection.FormattingEnabled = True - Me.cmbLogoSelection.Location = New System.Drawing.Point(164, 311) + Me.cmbLogoSelection.Location = New System.Drawing.Point(167, 387) Me.cmbLogoSelection.Margin = New System.Windows.Forms.Padding(2) Me.cmbLogoSelection.Name = "cmbLogoSelection" Me.cmbLogoSelection.Size = New System.Drawing.Size(91, 21) @@ -212,7 +218,7 @@ Partial Class frmTvSettings ' 'btnSave ' - Me.btnSave.Location = New System.Drawing.Point(164, 346) + Me.btnSave.Location = New System.Drawing.Point(167, 422) Me.btnSave.Margin = New System.Windows.Forms.Padding(2) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(90, 24) @@ -241,11 +247,55 @@ Partial Class frmTvSettings Me.Label1.TabIndex = 16 Me.Label1.Text = "Abstand Kachel Text (%)" ' + 'numTextFLaggeLeft + ' + Me.numTextFLaggeLeft.DecimalPlaces = 2 + Me.numTextFLaggeLeft.Location = New System.Drawing.Point(165, 312) + Me.numTextFLaggeLeft.Margin = New System.Windows.Forms.Padding(2) + Me.numTextFLaggeLeft.Name = "numTextFLaggeLeft" + Me.numTextFLaggeLeft.Size = New System.Drawing.Size(92, 20) + Me.numTextFLaggeLeft.TabIndex = 18 + Me.numTextFLaggeLeft.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'numTextFlaggeBottom + ' + Me.numTextFlaggeBottom.DecimalPlaces = 2 + Me.numTextFlaggeBottom.Location = New System.Drawing.Point(165, 348) + Me.numTextFlaggeBottom.Margin = New System.Windows.Forms.Padding(2) + Me.numTextFlaggeBottom.Name = "numTextFlaggeBottom" + Me.numTextFlaggeBottom.Size = New System.Drawing.Size(92, 20) + Me.numTextFlaggeBottom.TabIndex = 19 + Me.numTextFlaggeBottom.Value = New Decimal(New Integer() {30, 0, 0, 0}) + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(22, 314) + Me.Label2.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(77, 13) + Me.Label2.TabIndex = 20 + Me.Label2.Text = "Flagge Left (%)" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(22, 350) + Me.Label3.Margin = New System.Windows.Forms.Padding(2, 0, 2, 0) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(92, 13) + Me.Label3.TabIndex = 21 + Me.Label3.Text = "Flagge Bottom (%)" + ' 'frmTvSettings ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(306, 409) + Me.ClientSize = New System.Drawing.Size(291, 506) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.numTextFlaggeBottom) + Me.Controls.Add(Me.numTextFLaggeLeft) Me.Controls.Add(Me.numKachelRowGapInPercent) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.btnSave) @@ -276,6 +326,8 @@ Partial Class frmTvSettings CType(Me.numSeitenwechsel, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.numTextBalkenHeight, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.numKachelRowGapInPercent, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numTextFLaggeLeft, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numTextFlaggeBottom, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -283,4 +335,8 @@ Partial Class frmTvSettings Private WithEvents numKachelRowGapInPercent As NumericUpDown Private WithEvents Label1 As Label + Private WithEvents numTextFLaggeLeft As NumericUpDown + Private WithEvents numTextFlaggeBottom As NumericUpDown + Private WithEvents Label2 As Label + Private WithEvents Label3 As Label End Class diff --git a/Aviso/frmTvSettings.vb b/Aviso/frmTvSettings.vb index 2d58d38..1044f50 100644 --- a/Aviso/frmTvSettings.vb +++ b/Aviso/frmTvSettings.vb @@ -32,6 +32,8 @@ Partial Class frmTvSettings numSeitenwechsel.Value = If(settings.SeitenwechselInSek >= numSeitenwechsel.Minimum AndAlso settings.SeitenwechselInSek <= numSeitenwechsel.Maximum, CDec(settings.SeitenwechselInSek), 30) numTextBalkenHeight.Value = If(settings.TextBalkenHeightInPercent >= numTextBalkenHeight.Minimum AndAlso settings.TextBalkenHeightInPercent <= numTextBalkenHeight.Maximum, CDec(settings.TextBalkenHeightInPercent), 30) numKachelRowGapInPercent.Value = If(settings.KachelRowGapInPercent >= numKachelRowGapInPercent.Minimum AndAlso settings.KachelRowGapInPercent <= numKachelRowGapInPercent.Maximum, CDec(settings.KachelRowGapInPercent), 15) + numTextFlaggeBottom.Value = If(settings.TextFlaggeBottom >= numTextFlaggeBottom.Minimum AndAlso settings.TextFlaggeBottom <= numTextFlaggeBottom.Maximum, CDec(settings.TextFlaggeBottom), 15) + numTextFLaggeLeft.Value = If(settings.TextFlaggeLeft >= numTextFLaggeLeft.Minimum AndAlso settings.TextFlaggeLeft <= numTextFLaggeLeft.Maximum, CDec(settings.TextFlaggeLeft), 15) ' Logo-Auswahl setzen cmbLogoSelection.SelectedValue = settings.SelectedLogoValue @@ -100,6 +102,8 @@ Partial Class frmTvSettings numSeitenwechsel.Value = 30 numTextBalkenHeight.Value = 30 numKachelRowGapInPercent.Value = 15 + numTextFlaggeBottom.Value = 15 + numTextFLaggeLeft.Value = 15 ' Sicherstellen, dass die ComboBox initialisiert ist If cmbLogoSelection.Items.Count > 0 Then @@ -123,7 +127,9 @@ Partial Class frmTvSettings .SeitenwechselInSek = CDbl(numSeitenwechsel.Value), .TextBalkenHeightInPercent = CDbl(numTextBalkenHeight.Value), .KachelRowGapInPercent = CDbl(numKachelRowGapInPercent.Value), - .SelectedLogoValue = selectedValue ' Stellen Sie sicher, dass diese Eigenschaft in cTvSettings existiert + .TextFlaggeBottom = CDbl(numTextFlaggeBottom.Value), + .TextFlaggeLeft = CDbl(numTextFLaggeLeft.Value), + .SelectedLogoValue = selectedValue } ' Einstellungen in der Datenbank speichern