From 1cfc8934df791a941328422c06b8117c84a38c6d Mon Sep 17 00:00:00 2001 From: OlgunR Date: Thu, 2 Oct 2025 10:11:07 +0200 Subject: [PATCH] Speichern an einer Stelle - ClassNIProfil, ClassNIVerknuepfungen, frmNIProfileigenschaften, frmNIVerknuepfungen, frmNIVerknuepfungen.Designer --- ToolCollection/ClassNIProfil.vb | 76 ++++++++------- ToolCollection/ClassNIVerknüpfungen.vb | 11 ++- ToolCollection/frmNIProfileigenschaften.vb | 1 + .../frmNIVerknuepfungen.Designer.vb | 95 ++++++++++++------- ToolCollection/frmNIVerknuepfungen.resx | 2 +- ToolCollection/frmNIVerknuepfungen.vb | 84 ++++++++++++---- 6 files changed, 178 insertions(+), 91 deletions(-) diff --git a/ToolCollection/ClassNIProfil.vb b/ToolCollection/ClassNIProfil.vb index de16ebc..e2bb061 100644 --- a/ToolCollection/ClassNIProfil.vb +++ b/ToolCollection/ClassNIProfil.vb @@ -67,7 +67,7 @@ Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig) - Private _saved As Boolean + Private _saved As Boolean = True 'Private _config As ClassNachindexierungKonfiguration = New ClassNachindexierungKonfiguration 'Private _xmlConfigFile As String = My.Settings.vConfigDatei @@ -81,11 +81,11 @@ ''' ''' ''' - Sub New(ByVal profilname As String, ByVal dokumenttyp_string As String, ByVal windreamSuche As String, _ - ByVal NI_Art As String, ByVal xmlEnd As String, ByVal folderxml As String, ByVal delfiles As String, ByVal dbArt As String, ByVal dataSource As String, ByVal userId As String, _ - ByVal password As String, ByVal initialCatalog As String, ByVal SQLAnweisung As String, ByVal windreamIndex As String, ByVal checkIndexSQL As String, ByVal indexVali As String, ByVal indexFehler As String, _ - ByVal finalerIndex As String, ByVal aktiv As String, ByVal mrDAIndex As String, ByVal mrKDIndex As String, ByVal move2Folder As String, ByVal intervall As Integer, ByVal lastRun As String, ByVal NB_AD As Boolean, _ - ByVal getOrdRechte As Boolean, ByVal ordnerType As String, ByVal ordnerType_Eb As String, _ + Sub New(ByVal profilname As String, ByVal dokumenttyp_string As String, ByVal windreamSuche As String, + ByVal NI_Art As String, ByVal xmlEnd As String, ByVal folderxml As String, ByVal delfiles As String, ByVal dbArt As String, ByVal dataSource As String, ByVal userId As String, + ByVal password As String, ByVal initialCatalog As String, ByVal SQLAnweisung As String, ByVal windreamIndex As String, ByVal checkIndexSQL As String, ByVal indexVali As String, ByVal indexFehler As String, + ByVal finalerIndex As String, ByVal aktiv As String, ByVal mrDAIndex As String, ByVal mrKDIndex As String, ByVal move2Folder As String, ByVal intervall As Integer, ByVal lastRun As String, ByVal NB_AD As Boolean, + ByVal getOrdRechte As Boolean, ByVal ordnerType As String, ByVal ordnerType_Eb As String, ByVal CreaFolderIndex As String, ByVal CreaFolder_Folder As String, ByVal CreaFolder_move As Boolean) Me._dokumenttypString = dokumenttyp_string @@ -177,7 +177,7 @@ Try ' wenn das Profil nicht gespeichert ist - If Not Me.IsSaved Then + If Not Me.GetSaved Then ' wenn ein Profilname für dieses Profil gesetzt ist If Me._profilname IsNot Nothing And Me._originalProfilname IsNot Nothing Then ' XML-Datei initialisieren @@ -288,7 +288,8 @@ ' Profil auf gespeichert setzen Me._saved = True - If msg = True And item = "profile" Then MsgBox("Das Profil '" & Me._originalProfilname & "' wurde erfolgreich gespeichert.", MsgBoxStyle.Information, "Profil gespeichert") + 'If msg = True And item = "profile" Then MsgBox("Das Profil '" & Me._originalProfilname & "' wurde erfolgreich gespeichert.", MsgBoxStyle.Information, "Profil gespeichert") + If msg = True And item = "profile" Then MsgBox("Änderungen wurden erfolgreich gespeichert.", MsgBoxStyle.Information, "Profil gespeichert") Return True Else @@ -364,34 +365,34 @@ Public ReadOnly Property HasChanges() As Boolean Get - If Me._profilname = Me._originalProfilname And _ - Me._windreamSuche = Me._originalWindreamSuche And _ - Me._NI_ART = Me._originalNI_ART And _ - Me._xmlEnd = Me._originalxmlEnd And _ - Me._dbArt = Me._originalDbArt And _ - Me._initialCatalog = Me._originalInitialCatalog And _ - Me._dataSource = Me._originalDataSource And _ - Me._userId = Me._originalUserId And _ - Me._password = Me._originalPassword And _ - Me._windreamIndex = Me._originalwindreamIndex And _ - Me._checkIndexSQL = Me._originalcheckIndexSQL And _ - Me._indexValidation = Me._originalindexValidation And _ - Me._indexFehler = Me._originalindexFehler And _ + If Me._profilname = Me._originalProfilname And + Me._windreamSuche = Me._originalWindreamSuche And + Me._NI_ART = Me._originalNI_ART And + Me._xmlEnd = Me._originalxmlEnd And + Me._dbArt = Me._originalDbArt And + Me._initialCatalog = Me._originalInitialCatalog And + Me._dataSource = Me._originalDataSource And + Me._userId = Me._originalUserId And + Me._password = Me._originalPassword And + Me._windreamIndex = Me._originalwindreamIndex And + Me._checkIndexSQL = Me._originalcheckIndexSQL And + Me._indexValidation = Me._originalindexValidation And + Me._indexFehler = Me._originalindexFehler And Me._finalerIndex = Me._originalfinalerIndex And - Me._aktiv = Me._originalaktiv And _ - Me._MR_IndexDokart = Me._originalMR_IndexDokart And _ - Me._MR_IndexKunde = Me._originalMR_IndexKunde And _ - Me._xmlFolder = Me._originalxmlFolder And _ - Me._delete = Me._originaldelete And _ - Me._move2Folder = Me._originalmove2Folder And _ - Me.Intervall = Me.OriginalIntervall And _ + Me._aktiv = Me._originalaktiv And + Me._MR_IndexDokart = Me._originalMR_IndexDokart And + Me._MR_IndexKunde = Me._originalMR_IndexKunde And + Me._xmlFolder = Me._originalxmlFolder And + Me._delete = Me._originaldelete And + Me._move2Folder = Me._originalmove2Folder And + Me.Intervall = Me.OriginalIntervall And Me.LastRun = Me.OriginallastRun And - Me.NachbearbeitungAD = Me.OriginalNachbearbeitungAD And _ - Me._GetOrdnerRechte = Me._originalGetOrdnerRechte And _ - Me._ordnerType = Me._originalordnerType And _ - Me._ordnerType_Eb = Me._originalordnerType_Eb And _ - Me._CrFolderIndex = _originalCrFolderIndex And _ - Me._CrFolder_Folder = _originalCrFolder_Folder And _ + Me.NachbearbeitungAD = Me.OriginalNachbearbeitungAD And + Me._GetOrdnerRechte = Me._originalGetOrdnerRechte And + Me._ordnerType = Me._originalordnerType And + Me._ordnerType_Eb = Me._originalordnerType_Eb And + Me._CrFolderIndex = _originalCrFolderIndex And + Me._CrFolder_Folder = _originalCrFolder_Folder And Me._CrFolder_move = Me._originalCrFolder_move Then Return False @@ -401,12 +402,17 @@ End Get End Property - Public ReadOnly Property IsSaved() As Boolean + Public ReadOnly Property GetSaved() As Boolean Get Return Me._saved End Get End Property + Public ReadOnly Property IsSaved() As Boolean + Get + Return Me._saved = True + End Get + End Property Public Property OriginalProfilname() As String Get diff --git a/ToolCollection/ClassNIVerknüpfungen.vb b/ToolCollection/ClassNIVerknüpfungen.vb index cb95d4b..fcad616 100644 --- a/ToolCollection/ClassNIVerknüpfungen.vb +++ b/ToolCollection/ClassNIVerknüpfungen.vb @@ -5,6 +5,7 @@ Public Class ClassNIVerknüpfungen Private _parentProfile As ClassNIProfil Public Shared xmlNIConfigFile As String Public selectedLink As ClassNIVerknüpfung + Private _linksSaved As Boolean = True Public Sub New(ByVal profil As ClassNIProfil) @@ -201,15 +202,17 @@ Public Class ClassNIVerknüpfungen End Sub - Public ReadOnly Property IsSaved() As Boolean + Public ReadOnly Property GetSaved() As Boolean Get Return Me._linksSaved End Get End Property - - Private _linksSaved As Boolean = True - + Public ReadOnly Property IsSaved() As Boolean + Get + Return Me._linksSaved = True + End Get + End Property Public Function CountLinks() ' Anzahl der Verknüpfungen zurückgeben diff --git a/ToolCollection/frmNIProfileigenschaften.vb b/ToolCollection/frmNIProfileigenschaften.vb index d702217..7773d27 100644 --- a/ToolCollection/frmNIProfileigenschaften.vb +++ b/ToolCollection/frmNIProfileigenschaften.vb @@ -507,6 +507,7 @@ Public Class frmNIProfileigenschaften ' Das Profil auf gespeichert setzen, da ja keine Änderungen am Profil selbst gemacht wurden. Das Profil ' hat jedoch zu diesem Zeitpunkt den Status HasChanges(), da der Inhalt der Steuerelemente verändert wurde. Me._selectedProfile.setSaved() + Me._selectedProfile._links.setLinksSaved() btnVerknüpfungen.Visible = True Else btnVerknüpfungen.Visible = False diff --git a/ToolCollection/frmNIVerknuepfungen.Designer.vb b/ToolCollection/frmNIVerknuepfungen.Designer.vb index cf1a450..6c107bb 100644 --- a/ToolCollection/frmNIVerknuepfungen.Designer.vb +++ b/ToolCollection/frmNIVerknuepfungen.Designer.vb @@ -58,7 +58,6 @@ Partial Class frmNIVerknuepfungen Me.Label9 = New System.Windows.Forms.Label() Me.gbUpdate = New System.Windows.Forms.GroupBox() Me.Label2 = New System.Windows.Forms.Label() - Me.Button5 = New System.Windows.Forms.Button() Me.Label1 = New System.Windows.Forms.Label() Me.lblsaveSQLAnweisung = New System.Windows.Forms.Label() Me.cmbWindreamIndexeSQL = New System.Windows.Forms.ComboBox() @@ -170,6 +169,9 @@ Partial Class frmNIVerknuepfungen Me.rbvkt_add = New System.Windows.Forms.RadioButton() Me.rbvkt_overwrite = New System.Windows.Forms.RadioButton() Me.SplitContainer1 = New System.Windows.Forms.SplitContainer() + Me.pnlFooter = New System.Windows.Forms.Panel() + Me.btnCancel = New System.Windows.Forms.Button() + Me.btnSaveAll = New System.Windows.Forms.Button() Me.StatusStrip1.SuspendLayout() Me.GroupBox1.SuspendLayout() Me.Panel1.SuspendLayout() @@ -192,6 +194,7 @@ Partial Class frmNIVerknuepfungen Me.SplitContainer1.Panel1.SuspendLayout() Me.SplitContainer1.Panel2.SuspendLayout() Me.SplitContainer1.SuspendLayout() + Me.pnlFooter.SuspendLayout() Me.SuspendLayout() ' 'txtfinalSkriptUpdate @@ -206,7 +209,7 @@ Partial Class frmNIVerknuepfungen Me.txtfinalSkriptUpdate.Multiline = True Me.txtfinalSkriptUpdate.Name = "txtfinalSkriptUpdate" Me.txtfinalSkriptUpdate.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.txtfinalSkriptUpdate.Size = New System.Drawing.Size(963, 138) + Me.txtfinalSkriptUpdate.Size = New System.Drawing.Size(963, 166) Me.txtfinalSkriptUpdate.TabIndex = 29 ' 'cmbDatenbankSpalten @@ -574,7 +577,6 @@ Partial Class frmNIVerknuepfungen 'gbUpdate ' Me.gbUpdate.Controls.Add(Me.Label2) - Me.gbUpdate.Controls.Add(Me.Button5) Me.gbUpdate.Controls.Add(Me.Label1) Me.gbUpdate.Controls.Add(Me.lblsaveSQLAnweisung) Me.gbUpdate.Controls.Add(Me.GroupBox1) @@ -586,7 +588,7 @@ Partial Class frmNIVerknuepfungen Me.gbUpdate.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.gbUpdate.Location = New System.Drawing.Point(3, 3) Me.gbUpdate.Name = "gbUpdate" - Me.gbUpdate.Size = New System.Drawing.Size(1251, 190) + Me.gbUpdate.Size = New System.Drawing.Size(1251, 218) Me.gbUpdate.TabIndex = 39 Me.gbUpdate.TabStop = False Me.gbUpdate.Text = "SQL-Befehl oder Skript (ausgeführt nach jedem Dateidurchlauf)" @@ -600,21 +602,6 @@ Partial Class frmNIVerknuepfungen Me.Label2.TabIndex = 55 Me.Label2.Text = "EXECUTEVB PathToMyVBScriptfile.vbs Argument#Argument2#Argument3" ' - 'Button5 - ' - Me.Button5.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.Button5.Font = New System.Drawing.Font("Segoe UI", 8.25!) - Me.Button5.Image = Global.ToolCollection.My.Resources.Resources.save - Me.Button5.ImageAlign = System.Drawing.ContentAlignment.MiddleRight - Me.Button5.ImeMode = System.Windows.Forms.ImeMode.NoControl - Me.Button5.Location = New System.Drawing.Point(1131, 97) - Me.Button5.Name = "Button5" - Me.Button5.Size = New System.Drawing.Size(100, 24) - Me.Button5.TabIndex = 54 - Me.Button5.Text = "Speichern" - Me.Button5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button5.UseVisualStyleBackColor = True - ' 'Label1 ' Me.Label1.AutoSize = True @@ -753,7 +740,7 @@ Partial Class frmNIVerknuepfungen Me.grbFilterDB.Location = New System.Drawing.Point(10, 304) Me.grbFilterDB.Name = "grbFilterDB" Me.grbFilterDB.RightToLeft = System.Windows.Forms.RightToLeft.No - Me.grbFilterDB.Size = New System.Drawing.Size(1243, 220) + Me.grbFilterDB.Size = New System.Drawing.Size(1243, 228) Me.grbFilterDB.TabIndex = 23 Me.grbFilterDB.TabStop = False Me.grbFilterDB.Text = " Einschränkung der Datenbankansicht zum Auslesen des windream-Indexes " @@ -868,7 +855,7 @@ Partial Class frmNIVerknuepfungen Me.txtSelectAnweisung.Name = "txtSelectAnweisung" Me.txtSelectAnweisung.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtSelectAnweisung.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtSelectAnweisung.Size = New System.Drawing.Size(865, 181) + Me.txtSelectAnweisung.Size = New System.Drawing.Size(865, 189) Me.txtSelectAnweisung.TabIndex = 28 ' 'Label5 @@ -935,11 +922,11 @@ Partial Class frmNIVerknuepfungen Me.tabctrlbottom.Controls.Add(Me.TabPage6) Me.tabctrlbottom.Controls.Add(Me.TabPage1) Me.tabctrlbottom.Controls.Add(Me.TabPage2) - Me.tabctrlbottom.Dock = System.Windows.Forms.DockStyle.Fill + Me.tabctrlbottom.Dock = System.Windows.Forms.DockStyle.Top Me.tabctrlbottom.Location = New System.Drawing.Point(0, 0) Me.tabctrlbottom.Name = "tabctrlbottom" Me.tabctrlbottom.SelectedIndex = 0 - Me.tabctrlbottom.Size = New System.Drawing.Size(1265, 226) + Me.tabctrlbottom.Size = New System.Drawing.Size(1265, 250) Me.tabctrlbottom.TabIndex = 41 Me.tabctrlbottom.Visible = False ' @@ -958,7 +945,7 @@ Partial Class frmNIVerknuepfungen Me.TabPage6.Location = New System.Drawing.Point(4, 22) Me.TabPage6.Name = "TabPage6" Me.TabPage6.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage6.Size = New System.Drawing.Size(1257, 200) + Me.TabPage6.Size = New System.Drawing.Size(1257, 224) Me.TabPage6.TabIndex = 3 Me.TabPage6.Text = "Überprüfung deskriptiver Index" Me.TabPage6.UseVisualStyleBackColor = True @@ -1080,7 +1067,7 @@ Partial Class frmNIVerknuepfungen Me.txtCheckIndexSQL.Name = "txtCheckIndexSQL" Me.txtCheckIndexSQL.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtCheckIndexSQL.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtCheckIndexSQL.Size = New System.Drawing.Size(868, 174) + Me.txtCheckIndexSQL.Size = New System.Drawing.Size(868, 190) Me.txtCheckIndexSQL.TabIndex = 30 ' 'cmbSpalten_indexSQL @@ -1130,7 +1117,7 @@ Partial Class frmNIVerknuepfungen Me.TabPage1.Location = New System.Drawing.Point(4, 22) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage1.Size = New System.Drawing.Size(1257, 196) + Me.TabPage1.Size = New System.Drawing.Size(1257, 224) Me.TabPage1.TabIndex = 0 Me.TabPage1.Text = "SQL oder Skript-Befehl" Me.TabPage1.UseVisualStyleBackColor = True @@ -1141,7 +1128,7 @@ Partial Class frmNIVerknuepfungen Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(1257, 196) + Me.TabPage2.Size = New System.Drawing.Size(1257, 224) Me.TabPage2.TabIndex = 1 Me.TabPage2.Text = "Zusatzoptionen" Me.TabPage2.UseVisualStyleBackColor = True @@ -1306,7 +1293,7 @@ Partial Class frmNIVerknuepfungen Me.pnlfulltext.Enabled = False Me.pnlfulltext.Location = New System.Drawing.Point(503, 291) Me.pnlfulltext.Name = "pnlfulltext" - Me.pnlfulltext.Size = New System.Drawing.Size(313, 226) + Me.pnlfulltext.Size = New System.Drawing.Size(313, 234) Me.pnlfulltext.TabIndex = 47 Me.pnlfulltext.Visible = False ' @@ -1489,7 +1476,7 @@ Partial Class frmNIVerknuepfungen Me.RichTextBox_RegEx.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.RichTextBox_RegEx.Location = New System.Drawing.Point(10, 88) Me.RichTextBox_RegEx.Name = "RichTextBox_RegEx" - Me.RichTextBox_RegEx.Size = New System.Drawing.Size(60, 128) + Me.RichTextBox_RegEx.Size = New System.Drawing.Size(60, 136) Me.RichTextBox_RegEx.TabIndex = 24 Me.RichTextBox_RegEx.Text = "" ' @@ -1865,7 +1852,7 @@ Partial Class frmNIVerknuepfungen Me.pnlZielQuelle.Dock = System.Windows.Forms.DockStyle.Fill Me.pnlZielQuelle.Location = New System.Drawing.Point(0, 0) Me.pnlZielQuelle.Name = "pnlZielQuelle" - Me.pnlZielQuelle.Size = New System.Drawing.Size(1265, 527) + Me.pnlZielQuelle.Size = New System.Drawing.Size(1265, 532) Me.pnlZielQuelle.TabIndex = 50 ' 'rbFunctionsTb @@ -1948,16 +1935,53 @@ Partial Class frmNIVerknuepfungen ' 'SplitContainer1.Panel2 ' + Me.SplitContainer1.Panel2.Controls.Add(Me.pnlFooter) Me.SplitContainer1.Panel2.Controls.Add(Me.tabctrlbottom) - Me.SplitContainer1.Size = New System.Drawing.Size(1265, 757) - Me.SplitContainer1.SplitterDistance = 527 + Me.SplitContainer1.Size = New System.Drawing.Size(1265, 830) + Me.SplitContainer1.SplitterDistance = 532 Me.SplitContainer1.TabIndex = 51 ' + 'pnlFooter + ' + Me.pnlFooter.BackColor = System.Drawing.Color.Transparent + Me.pnlFooter.Controls.Add(Me.btnCancel) + Me.pnlFooter.Controls.Add(Me.btnSaveAll) + Me.pnlFooter.Dock = System.Windows.Forms.DockStyle.Fill + Me.pnlFooter.Location = New System.Drawing.Point(0, 250) + Me.pnlFooter.Name = "pnlFooter" + Me.pnlFooter.Size = New System.Drawing.Size(1265, 44) + Me.pnlFooter.TabIndex = 53 + ' + 'btnCancel + ' + Me.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Top + Me.btnCancel.BackColor = System.Drawing.SystemColors.Control + Me.btnCancel.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnCancel.Location = New System.Drawing.Point(997, 5) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(120, 30) + Me.btnCancel.TabIndex = 1 + Me.btnCancel.Text = "Abbrechen" + Me.btnCancel.UseVisualStyleBackColor = False + ' + 'btnSaveAll + ' + Me.btnSaveAll.Anchor = System.Windows.Forms.AnchorStyles.Top + Me.btnSaveAll.BackColor = System.Drawing.SystemColors.Control + Me.btnSaveAll.Enabled = False + Me.btnSaveAll.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnSaveAll.Location = New System.Drawing.Point(1123, 5) + Me.btnSaveAll.Name = "btnSaveAll" + Me.btnSaveAll.Size = New System.Drawing.Size(120, 30) + Me.btnSaveAll.TabIndex = 0 + Me.btnSaveAll.Text = "Speichern" + Me.btnSaveAll.UseVisualStyleBackColor = True + ' 'frmNIVerknuepfungen ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(1265, 779) + Me.ClientSize = New System.Drawing.Size(1265, 852) Me.Controls.Add(Me.SplitContainer1) Me.Controls.Add(Me.StatusStrip1) Me.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -1999,6 +2023,7 @@ Partial Class frmNIVerknuepfungen Me.SplitContainer1.Panel2.ResumeLayout(False) CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).EndInit() Me.SplitContainer1.ResumeLayout(False) + Me.pnlFooter.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -2145,9 +2170,11 @@ Partial Class frmNIVerknuepfungen Friend WithEvents Button1 As Button Friend WithEvents lblsaveSQLAnweisung As Label Friend WithEvents Label1 As Label - Friend WithEvents Button5 As Button Friend WithEvents rbFunctionsTb As RadioButton Friend WithEvents rbFunctionsSc As RadioButton Friend WithEvents Label2 As Label Friend WithEvents btnSaveCheckIndex As Button + Friend WithEvents pnlFooter As Panel + Friend WithEvents btnSaveAll As Button + Friend WithEvents btnCancel As Button End Class diff --git a/ToolCollection/frmNIVerknuepfungen.resx b/ToolCollection/frmNIVerknuepfungen.resx index 06f82f7..3787feb 100644 --- a/ToolCollection/frmNIVerknuepfungen.resx +++ b/ToolCollection/frmNIVerknuepfungen.resx @@ -130,7 +130,7 @@ 606, 17 - 25 + 28 diff --git a/ToolCollection/frmNIVerknuepfungen.vb b/ToolCollection/frmNIVerknuepfungen.vb index d6988b5..bdea377 100644 --- a/ToolCollection/frmNIVerknuepfungen.vb +++ b/ToolCollection/frmNIVerknuepfungen.vb @@ -194,6 +194,9 @@ Public Class frmNIVerknuepfungen If Me._selectedProfil.Dokumenttyp IsNot Nothing Then 'Profilübergreifende Aktualisierungen Me.pnlZielQuelle.Visible = True + Me.SplitContainer1.Visible = True + Me.tabctrlbottom.Visible = True + Me.pnlFooter.Visible = True Me.pnlZielQuelle.Dock = DockStyle.Fill Me.lblProfil.Text = "Gewähltes Profil: '" & Me._selectedProfil.Profilname & "'" Me.lblProfil.Visible = True @@ -461,6 +464,8 @@ Public Class frmNIVerknuepfungen End If End If + ' Nach vollständigem Laden wird saved auf true (changed auf false) gesetzt + Me._selectedProfil.setSaved() Else Me.lblProfil.Text = "Gewähltes Profil: '" & Me._selectedProfil.Profilname & "'" & " - unbekannter Objekttyp -" MsgBox("Ein Dokumenttyp konnte nicht bestimmt werden! Vergewissern Sie sich das das Profil korrekt gespeichert wurde!", MsgBoxStyle.Exclamation, "Ausnahme:") @@ -1676,6 +1681,23 @@ Public Class frmNIVerknuepfungen Private Sub lvwVerknuepfungen_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lvwVerknuepfungen.SelectedIndexChanged + If Not Me._selectedProfil.IsSaved Then + + Dim msgResult As MsgBoxResult = MsgBox("Möchten Sie die Änderungen speichern?", MsgBoxStyle.YesNoCancel, "Änderungen übernehmen?") + If msgResult = MsgBoxResult.Yes Then + + If Not Me._selectedProfil.IsSaved Then + SaveProfile() + End If + + If Not Me._selectedProfil._links.IsSaved Then + SaveLinks() + End If + + End If + + End If + Select Case Me._selectedProfil.Ni_Art Case "db" Try @@ -1695,7 +1717,7 @@ Public Class frmNIVerknuepfungen End If ' merken ob das Profil geändert wurde - Dim gespeichertVorher = Me._selectedProfil.IsSaved + Dim gespeichertVorher = Me._selectedProfil.GetSaved Dim gespeichertLinkVorher = Me._selectedProfil._links.IsLinksSaved ' wenn im ListView eine Zeile ausgewählt wurde @@ -1716,6 +1738,7 @@ Public Class frmNIVerknuepfungen ' die SQL-Anweisung der ausgewählten Verknüpfung in das Textfeld schreiben Me.txtSelectAnweisung.Text = Me._selectedProfil._links.selectedLink.SelectAnweisung 'Me.selectedProfil.getLinkByValues(Me.lvwVerbunden.SelectedItems(0).SubItems(0).Text, Me.lvwVerbunden.SelectedItems(0).SubItems(1).Text, Me.lvwVerbunden.SelectedItems(0).SubItems(2).Text).getSelectAnweisung() Me.grbFilterDB.Enabled = True + Me.btnSaveAll.Enabled = False ' mit dem Cursor an die letzte Position springen Me.txtSelectAnweisung.SelectionStart = Me.txtSelectAnweisung.Text.Length @@ -1838,7 +1861,7 @@ Public Class frmNIVerknuepfungen End If ' merken ob das Profil geändert wurde - Dim gespeichertVorher = Me._selectedProfil.IsSaved + Dim gespeichertVorher = Me._selectedProfil.GetSaved Dim gespeichertLinkVorher = Me._selectedProfil._links.IsLinksSaved ' wenn im ListView eine Zeile ausgewählt wurde @@ -1924,8 +1947,8 @@ Public Class frmNIVerknuepfungen End If ' merken ob das Profil geändert wurde - Dim gespeichertVorher = Me._selectedProfil.IsSaved - Dim gespeichertLinkVorher = Me._selectedProfil._links.IsLinksSaved + Dim gespeichertVorher = Me._selectedProfil.GetSaved + Dim gespeichertLinkVorher = Me._selectedProfil._links.GetSaved ' wenn im ListView eine Zeile ausgewählt wurde If Me.lvwVerknuepfungen.SelectedItems.Count > 0 Then @@ -2022,8 +2045,9 @@ Public Class frmNIVerknuepfungen 'Me._selectedProfil.Save(True, "link") If Me._selectedProfil._links.selectedLink.SaveLink(Me._selectedProfil.Profilname, Me._selectedProfil.Ni_Art) = True Then Me._selectedProfil._links.setLinksSaved() - btnsave_select.Enabled = False - MsgBox("Verknüpfung erfolgreich gespeichert!", MsgBoxStyle.Information) + Me.btnsave_select.Enabled = False + Me.btnSaveAll.Enabled = False + 'MsgBox("Verknüpfung erfolgreich gespeichert!", MsgBoxStyle.Information) End If With btnsave_select .Enabled = False @@ -2037,6 +2061,8 @@ Public Class frmNIVerknuepfungen Private Sub btnsave_select_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave_select.Click SaveLinks() + SaveProfile() + SaveScript() End Sub Private Sub txtSelectAnweisung_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSelectAnweisung.TextChanged Try @@ -2046,7 +2072,7 @@ Public Class frmNIVerknuepfungen Dim SQL_ORIGIN As String = Me._selectedProfil._links.getLinkByValues(Me.lvwVerknuepfungen.SelectedItems(0).SubItems(0).Text, Me.lvwVerknuepfungen.SelectedItems(0).SubItems(1).Text, Me.lvwVerknuepfungen.SelectedItems(0).SubItems(2).Text).getSelectAnweisung().ToString If SQL_ORIGIN <> Me.txtSelectAnweisung.Text Then - With btnsave_select + With btnSaveAll .Enabled = True .ForeColor = Drawing.Color.Black End With @@ -2054,7 +2080,7 @@ Public Class frmNIVerknuepfungen ' die Informationen der selektierten Verknüpfung auslesen Me._selectedProfil._links.getLinkByValues(Me.lvwVerknuepfungen.SelectedItems(0).SubItems(0).Text, Me.lvwVerknuepfungen.SelectedItems(0).SubItems(1).Text, Me.lvwVerknuepfungen.SelectedItems(0).SubItems(2).Text).setSelectAnweisung(Me.txtSelectAnweisung.Text) - ' das Profil auf den Status 'geändert' setzen + Me.btnSaveAll.Enabled = True Me._selectedProfil.setChanged() Me._selectedProfil._links.setLinksChanged() 'Jetzt den Startwert bestimmen @@ -2183,6 +2209,13 @@ Public Class frmNIVerknuepfungen Private Sub txtUpdateAnweisung_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtfinalSkriptUpdate.TextChanged + If Not Me.txtfinalSkriptUpdate.Text = Me._selectedProfil.OriginalSQL_Anweisung Then + Me._selectedProfil.SQL_Anweisung = Me.txtfinalSkriptUpdate.Text + Me._selectedProfil.setChanged() + Me._selectedProfil._links.setLinksChanged() + btnSaveAll.Enabled = True + End If + End Sub Private Sub btnWindreamIndexEinfügenSQL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWindreamIndexEinfügenSQL.Click If Not Me.cmbWindreamIndexeSQL.SelectedItem = "" Then @@ -2285,7 +2318,8 @@ Public Class frmNIVerknuepfungen End If End If - If Not Me._selectedProfil.IsSaved Or Not Me._selectedProfil._links.IsSaved Then + ' If Not Me._selectedProfil.IsSaved Or Not Me._selectedProfil._links.IsSaved Then + If Not Me._selectedProfil.IsSaved Then Dim msgResult As MsgBoxResult = MsgBox("Möchten Sie die Änderungen speichern?", MsgBoxStyle.YesNoCancel, "Änderungen übernehmen?") If msgResult = MsgBoxResult.Yes Then @@ -2312,7 +2346,6 @@ Public Class frmNIVerknuepfungen Me._selectedProfil = ClassNIProfile.aktivesProfil Me.lblProfil.Text = "(" & Me._selectedProfil.Profilname & ")" Me.lblProfil.Visible = True - 'Me.pnlZielQuelle.Visible = False Me.LoadSelectedProfile(Me._selectedProfil.Profilname) @@ -2326,6 +2359,8 @@ Public Class frmNIVerknuepfungen Else Me._selectedProfil = Nothing Me.pnlZielQuelle.Visible = False + Me.SplitContainer1.Visible = False + Me.pnlfulltext.Visible = False End If End Sub @@ -2659,6 +2694,7 @@ Public Class frmNIVerknuepfungen If Me._selectedProfil.Save(True, "profile") = True Then Me._selectedProfil.setSaved() Me.btnSaveCheckIndex.Enabled = False + Me.btnSaveAll.Enabled = False Else MsgBox("Das Profil konnte nicht erfolgreich gespeichert werden.", MsgBoxStyle.Exclamation, "Fehler beim Speichern eines Profils") End If @@ -2669,18 +2705,21 @@ Public Class frmNIVerknuepfungen End Sub Private Sub btnSaveCheckIndex_Click(sender As Object, e As EventArgs) Handles btnSaveCheckIndex.Click + SaveLinks() SaveProfile() + SaveScript() End Sub Private Sub txtCheckIndexSQL_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtCheckIndexSQL.TextChanged If Me._selectedProfil IsNot Nothing Then + Me._selectedProfil.checkIndexsql = txtCheckIndexSQL.Text - If Not Me._selectedProfil.checkIndexsql = Me._selectedProfil.OriginalcheckIndexsql Then - btnSaveCheckIndex.Enabled = True - Me._selectedProfil.setChanged() - End If + If Not Me._selectedProfil.checkIndexsql = Me._selectedProfil.OriginalcheckIndexsql Then + btnSaveAll.Enabled = True + Me._selectedProfil.setChanged() + End If End If @@ -3201,7 +3240,7 @@ Public Class frmNIVerknuepfungen Sub SaveLDAP() Try If Me._selectedProfil._links.selectedLink IsNot Nothing Then - If Me._selectedProfil.IsSaved = False Then + If Me._selectedProfil.GetSaved = False Then Me._selectedProfil.Save(True, "profile") Me._selectedProfil._links.selectedLink.SaveLink(Me._selectedProfil.Profilname, Me._selectedProfil.Ni_Art) With btnSaveLDAP @@ -3363,7 +3402,7 @@ Public Class frmNIVerknuepfungen Private Sub btnSave_FulltextLinks_Click(sender As Object, e As EventArgs) Handles btnSave_FulltextLinks.Click Try If Me._selectedProfil._links.selectedLink IsNot Nothing Then - If Me._selectedProfil.IsSaved = False Then + If Me._selectedProfil.GetSaved = False Then Me._selectedProfil.Save(False, "FTLink") If Me._selectedProfil._links.selectedLink.SaveLink(Me._selectedProfil.Profilname, Me._selectedProfil.Ni_Art) = True Then MsgBox("Speichern erfolgreich!", MsgBoxStyle.Information) @@ -3601,13 +3640,15 @@ Public Class frmNIVerknuepfungen End If End Sub - Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click + Private Sub SaveScript() + If Me._selectedProfil IsNot Nothing Then If Not Me.txtfinalSkriptUpdate.Text = Me._selectedProfil.OriginalSQL_Anweisung Then Me._selectedProfil.SQL_Anweisung = Me.txtfinalSkriptUpdate.Text Me._selectedProfil.setChanged() Me._selectedProfil._links.setLinksChanged() + btnSaveAll.Enabled = True Else Exit Sub End If @@ -3617,9 +3658,12 @@ Public Class frmNIVerknuepfungen If Me._selectedProfil.Save(True, "profile") = True Then ' wenn das Speichern erfolgreich war Me.lblsaveSQLAnweisung.Text = "Data saved - " & Now.ToString + Me._selectedProfil.setSaved() + Me.btnSaveAll.Visible = False Else Me.lblsaveSQLAnweisung.Text = "" End If + End Sub Private Sub rbFunctionsSc_CheckedChanged(sender As Object, e As EventArgs) Handles rbFunctionsSc.CheckedChanged @@ -3659,4 +3703,10 @@ Public Class frmNIVerknuepfungen Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click End Sub + + Private Sub btnSaveAll_Click(sender As Object, e As EventArgs) Handles btnSaveAll.Click + SaveLinks() + SaveProfile() + SaveScript() + End Sub End Class \ No newline at end of file