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/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 9d509d2..1a0236c 100644 --- a/Aviso/Aviso.vbproj +++ b/Aviso/Aviso.vbproj @@ -664,6 +664,12 @@ Form + + frmEintragTvNew.vb + + + Form + frmFrachtkostenBerechnen.vb @@ -964,6 +970,12 @@ Form + + frmTvSettings.vb + + + Form + frmWarenbezeichnungBegriffe.vb @@ -1261,6 +1273,9 @@ frmATZollEingereichtSetzen.vb + + frmEintragTvNew.vb + frmFrachtkostenBerechnen.vb @@ -1414,6 +1429,9 @@ frmTv.vb + + frmTvSettings.vb + frmWarenbezeichnungBegriffe.vb @@ -1438,7 +1456,6 @@ frmGVMSNew.vb - PublicVbMyResourcesResXFileCodeGenerator My.Resources @@ -1644,7 +1661,6 @@ - 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/bin/Debug/Resources/ambar_boarder.png b/Aviso/bin/Debug/Resources/ambar_boarder.png deleted file mode 100644 index bc0c101..0000000 Binary files a/Aviso/bin/Debug/Resources/ambar_boarder.png and /dev/null differ diff --git a/Aviso/frmEintragTvNew.Designer.vb b/Aviso/frmEintragTvNew.Designer.vb new file mode 100644 index 0000000..a59ec43 --- /dev/null +++ b/Aviso/frmEintragTvNew.Designer.vb @@ -0,0 +1,690 @@ + +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 + + ' 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 nudPrioritaet As NumericUpDown + + 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 + 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.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() + 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.lblZeile1 = New System.Windows.Forms.Label() + Me.cmbTvTextBezeichnungAuswahl = New System.Windows.Forms.ComboBox() + Me.lblBezeichnung = New System.Windows.Forms.Label() + 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() + 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() + Me.Label1 = New System.Windows.Forms.Label() + 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() + 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 + ' + 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(1300, 200) + Me.dgvAVISOTV.TabIndex = 2 + ' + '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) + 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.lblZeile1) + Me.grpEingabe.Controls.Add(Me.cmbTvTextBezeichnungAuswahl) + Me.grpEingabe.Controls.Add(Me.lblBezeichnung) + Me.grpEingabe.Controls.Add(Me.nudPrioritaet) + 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(1300, 716) + Me.grpEingabe.TabIndex = 3 + Me.grpEingabe.TabStop = False + Me.grpEingabe.Text = "Informationen eingeben" + ' + 'tabControlZeilen + ' + 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 + ' + 'tabPageZeile1 + ' + 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 + ' + 'rtbZeile1 + ' + 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 = "" + ' + 'tabPageZeile2 + ' + 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.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(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 + 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 + Me.lblNeueTvTextBezeichnung.Text = "Neue TvTextBezeichnung:" + ' + 'txtNeueTvTextBezeichnung + ' + 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 + ' + 'chkIsActive + ' + Me.chkIsActive.AutoSize = True + 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 + Me.chkIsActive.Text = "Aktiv" + Me.chkIsActive.UseVisualStyleBackColor = True + ' + 'chkIsRecurring + ' + Me.chkIsRecurring.AutoSize = True + 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 + 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(66, 650) + Me.grpWochentage.Name = "grpWochentage" + Me.grpWochentage.Size = New System.Drawing.Size(776, 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(722, 537) + 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(618, 543) + Me.lblEndTime.Name = "lblEndTime" + Me.lblEndTime.Size = New System.Drawing.Size(91, 13) + Me.lblEndTime.TabIndex = 14 + Me.lblEndTime.Text = "Endzeit (optional):" + ' + 'dtpStartTime + ' + Me.dtpStartTime.Format = System.Windows.Forms.DateTimePickerFormat.Time + Me.dtpStartTime.Location = New System.Drawing.Point(126, 538) + 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(61, 544) + 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(721, 504) + 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(606, 507) + 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(127, 504) + 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(45, 507) + Me.lblStartDate.Name = "lblStartDate" + Me.lblStartDate.Size = New System.Drawing.Size(64, 13) + Me.lblStartDate.TabIndex = 8 + Me.lblStartDate.Text = "Startdatum: " + ' + 'lblZeile1 + ' + Me.lblZeile1.AutoSize = True + 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 + 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(101, 36) + 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(13, 39) + Me.lblBezeichnung.Name = "lblBezeichnung" + Me.lblBezeichnung.Size = New System.Drawing.Size(72, 13) + Me.lblBezeichnung.TabIndex = 0 + Me.lblBezeichnung.Text = "Bezeichnung:" + ' + 'nudPrioritaet + ' + 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 + ' + 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 + Me.btnBold.Text = "B" + Me.btnBold.UseVisualStyleBackColor = True + ' + 'btnItalic + ' + 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 + Me.btnItalic.Text = "I" + Me.btnItalic.UseVisualStyleBackColor = True + ' + 'btnUnderline + ' + 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 + Me.btnUnderline.Text = "U" + Me.btnUnderline.UseVisualStyleBackColor = True + ' + 'btnTextColor + ' + 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 + Me.btnTextColor.Text = "A" + Me.btnTextColor.UseVisualStyleBackColor = True + ' + 'btnBackColor + ' + Me.btnBackColor.Location = New System.Drawing.Point(240, 438) + Me.btnBackColor.Name = "btnBackColor" + 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(310, 438) + 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(350, 438) + 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(390, 438) + 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(495, 438) + 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(670, 438) + 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, 1010) + 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(1159, 1010) + 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(1240, 1010) + 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(1205, 29) + 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 + ' + '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) + 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.Controls.Add(Me.btnOpenSettings) + 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.tabControlZeilen.ResumeLayout(False) + Me.tabPageZeile1.ResumeLayout(False) + Me.tabPageZeile2.ResumeLayout(False) + 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.resx b/Aviso/frmEintragTvNew.resx new file mode 100644 index 0000000..0a3bfe1 --- /dev/null +++ b/Aviso/frmEintragTvNew.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 17, 17 + + \ No newline at end of file diff --git a/Aviso/frmEintragTvNew.vb b/Aviso/frmEintragTvNew.vb new file mode 100644 index 0000000..badbcbb --- /dev/null +++ b/Aviso/frmEintragTvNew.vb @@ -0,0 +1,1065 @@ +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 + + ' **Neue Klassenvariable zur Speicherung der zuletzt ausgewählten TVID** + Private lastSelectedTVID As Integer = 0 + + Public Sub New() + InitializeComponent() + InitializeFontComboBoxes() + Icon = cMeineFunktionenAVISO.GetProgrammIcon() + End Sub + + Private Sub frmEintragTvNew_Load(sender As Object, e As EventArgs) Handles MyBase.Load + LadeStandorte() + ' 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 + 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 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("StandortBezeichnung")) + 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 + + ' Neue parameterlose initdgv-Methode + Private Sub initdgv() + 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 showInactive As Boolean = chkShowInactive.Checked + + Dim gefilterteListe As List(Of cAvisoTvNew) + If showInactive Then + gefilterteListe = list.Where(Function(x) x.StandortID = standortID).ToList() + Else + 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 und Sichtbarkeiten + ConfigureDataGridViewColumns() + + 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 + RestoreSelection() + Else + ' Wiederhinzufügen der Event-Handler + AddHandler dgvAVISOTV.SelectionChanged, AddressOf dgvAVISOTV_SelectionChanged + + ' Felder leeren und Auswahl zurücksetzen + 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 + + ' 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"} + + ' Ü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() + + 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(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 + 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 cmbTvTextBezeichnungAuswahl_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbTvTextBezeichnungAuswahl.SelectedIndexChanged + If isInitializing OrElse cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 Then + Return + End If + + 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 + + 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.TvTextBezeichnungID) + 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 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() + 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 + ' 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 die Auswahl unterschiedliche Schriftarten hat, eine neue Schriftart setzen + AktuelleRichTextBox.SelectionFont = New Font(selectedFontFamily, selectedFontSize) + End If + hatAenderung = True + End If + End Sub + + Private Sub btnBold_Click(sender As Object, e As EventArgs) Handles btnBold.Click + If isInitializing Then Return + ToggleFontStyle(FontStyle.Bold) + End Sub + + Private Sub btnItalic_Click(sender As Object, e As EventArgs) Handles btnItalic.Click + If isInitializing Then Return + ToggleFontStyle(FontStyle.Italic) + End Sub + + Private Sub btnUnderline_Click(sender As Object, e As EventArgs) Handles btnUnderline.Click + If isInitializing Then Return + ToggleFontStyle(FontStyle.Underline) + End Sub + + 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 + AktuelleRichTextBox.SelectionColor = colorDialogText.Color + End If + End Sub + + 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 + AktuelleRichTextBox.SelectionBackColor = colorDialogText.Color + End If + End Sub + + Private Sub btnAlignLeft_Click(sender As Object, e As EventArgs) Handles btnAlignLeft.Click + 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 + + Private Sub btnAlignCenter_Click(sender As Object, e As EventArgs) Handles btnAlignCenter.Click + 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 + + Private Sub btnAlignRight_Click(sender As Object, e As EventArgs) Handles btnAlignRight.Click + 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 + + 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 AktuelleRichTextBox.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 + AktuelleRichTextBox.SelectionFont = New Font(currentFont.FontFamily, currentFont.Size, newFontStyle) + hatAenderung = True + End If + 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 + bezeichnungen = AvisoTvNewDAL.LadenAlleTvTextBezeichnungen() + 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 + }) + Next + + cmbTvTextBezeichnungAuswahl.DataSource = Nothing + cmbTvTextBezeichnungAuswahl.DataSource = items + cmbTvTextBezeichnungAuswahl.DisplayMember = "DisplayText" + cmbTvTextBezeichnungAuswahl.ValueMember = "ID" + cmbTvTextBezeichnungAuswahl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + cmbTvTextBezeichnungAuswahl.SelectedIndex = -1 + + isInitializing = False + + ' 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 + 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 + + + txtNeueTvTextBezeichnung.Text = "" + + ' Hier setzt du die Textzeilen, wenn vorhanden + rtbZeile1.Rtf = aviso.FixeZeile1RTF + rtbZeile2.Rtf = aviso.FixeZeile2RTF + rtbZeile3.Rtf = aviso.FixeZeile3RTF + + 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) + nudPrioritaet.Value = Convert.ToDecimal(aviso.Art) + chkIsActive.Checked = aviso.IsActive + + 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() + + Dim defaultFont As System.Drawing.Font = rtb.Font + Dim totalLength As Integer = rtb.TextLength + Dim charIndex As Integer = 0 + + While charIndex < totalLength + ' Wähle das aktuelle Zeichen aus + rtb.Select(charIndex, 1) + + ' 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 + + If startFont Is Nothing Then + startFont = defaultFont + End If + + ' Initialisiere die Lauf-Länge + Dim runLength As Integer = 1 + + ' 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 + + If currentFont Is Nothing Then + currentFont = defaultFont + End If + + ' Ü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 + + 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 + + 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("
") + + charIndex += runLength + End While + + 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 + 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 + ' **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 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 + + ' Speichere den HTML-Inhalt + myAvisoTvNew.FixeZeile1RTF = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, rtfContent) + myAvisoTvNew.FixeZeile1HTML = If(String.IsNullOrWhiteSpace(rtbZeile1.Text), Nothing, htmlContent) + 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 + + 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 + myAvisoTvNew.Art = Convert.ToInt32(nudPrioritaet.Value) + + 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.TvTextBezeichnungID}, TvTextBezeichnungID = {myAvisoTvNew.TvTextBezeichnungID}, StandortID = {myAvisoTvNew.StandortID}") + + ' Speichern der Einstellungen + AvisoTvNewDAL.SpeichernAvisoTvNew(myAvisoTvNew) + + LadeTvTextBezeichnungen() + + 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 = "" + 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.TvTextBezeichnungID = 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.TvTextBezeichnungID) + 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 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 + + 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 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 + txtNeueTvTextBezeichnung.Text = "" + rtbZeile1.Text = "" + rtbZeile2.Text = "" + rtbZeile3.Text = "" + nudPrioritaet.Value = Convert.ToDecimal(0) + 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 6e25a93..a8a90c9 100644 --- a/Aviso/frmHauptfenster.Designer.vb +++ b/Aviso/frmHauptfenster.Designer.vb @@ -410,6 +410,7 @@ Partial Class frmHauptfenster Me.UsrCntlBenachrichtigungen2 = New AVISO.usrCntlBenachrichtigungen() Me.Panel5 = New System.Windows.Forms.Panel() Me.Panel7 = New System.Windows.Forms.Panel() + Me.TVEditorNewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.conMenuAviso.SuspendLayout() Me.MenuStrip1.SuspendLayout() Me.pnlDetailsRechts.SuspendLayout() @@ -611,7 +612,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" @@ -620,7 +621,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 @@ -2543,7 +2544,7 @@ Partial Class frmHauptfenster 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(77, 300) + Me.UsrCntlBenachrichtigungen1.Size = New System.Drawing.Size(158, 300) Me.UsrCntlBenachrichtigungen1.TabIndex = 0 ' 'pnl @@ -3915,6 +3916,7 @@ Partial Class frmHauptfenster Me.pnlLeft.Visible = False ' 'UsrCntlBenachrichtigungen2 + 'TVEditorNewToolStripMenuItem ' Me.UsrCntlBenachrichtigungen2.Dock = System.Windows.Forms.DockStyle.Fill Me.UsrCntlBenachrichtigungen2.Location = New System.Drawing.Point(0, 51) @@ -3939,6 +3941,9 @@ Partial Class frmHauptfenster Me.Panel7.Name = "Panel7" Me.Panel7.Size = New System.Drawing.Size(252, 51) Me.Panel7.TabIndex = 4 + Me.TVEditorNewToolStripMenuItem.Name = "TVEditorNewToolStripMenuItem" + Me.TVEditorNewToolStripMenuItem.Size = New System.Drawing.Size(180, 22) + Me.TVEditorNewToolStripMenuItem.Text = "TVEditorNew" ' 'frmHauptfenster ' @@ -4393,4 +4398,5 @@ Partial Class frmHauptfenster Friend WithEvents tbSndOffen As TabPage Friend WithEvents tbSndFreigegeben As TabPage Friend WithEvents CheckBox1 As CheckBox + Friend WithEvents TVEditorNewToolStripMenuItem As ToolStripMenuItem End Class diff --git a/Aviso/frmHauptfenster.vb b/Aviso/frmHauptfenster.vb index f10db12..646f021 100644 --- a/Aviso/frmHauptfenster.vb +++ b/Aviso/frmHauptfenster.vb @@ -5037,6 +5037,10 @@ Public Class frmHauptfenster f.UNBOUND = True f.Show() 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/Aviso/frmTvSettings.Designer.vb b/Aviso/frmTvSettings.Designer.vb new file mode 100644 index 0000000..3d771e1 --- /dev/null +++ b/Aviso/frmTvSettings.Designer.vb @@ -0,0 +1,342 @@ + +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() + 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() + 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() + CType(Me.numTextFLaggeLeft, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.numTextFlaggeBottom, 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(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) + 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(92, 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(92, 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(167, 387) + 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(167, 422) + 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 (%)" + ' + '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(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) + 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() + CType(Me.numTextFLaggeLeft, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.numTextFlaggeBottom, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + 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.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..1044f50 --- /dev/null +++ b/Aviso/frmTvSettings.vb @@ -0,0 +1,145 @@ +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) + 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 + + ' Ü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 + numTextFlaggeBottom.Value = 15 + numTextFLaggeLeft.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), + .TextFlaggeBottom = CDbl(numTextFlaggeBottom.Value), + .TextFlaggeLeft = CDbl(numTextFLaggeLeft.Value), + .SelectedLogoValue = selectedValue + } + + ' 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/Aviso/usrcntlAktDetails.vb b/Aviso/usrcntlAktDetails.vb index 3c08a43..0684ae5 100644 --- a/Aviso/usrcntlAktDetails.vb +++ b/Aviso/usrcntlAktDetails.vb @@ -2647,9 +2647,9 @@ 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 - End If End Sub 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 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