Erster Entwurf Speichern bei Schließen der Form - ClassNIVerknuepfungen, frmNIVerknuepfungen
This commit is contained in:
parent
ae99271e9d
commit
881797110c
@ -201,7 +201,11 @@ Public Class ClassNIVerknüpfungen
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public ReadOnly Property IsSaved() As Boolean
|
||||||
|
Get
|
||||||
|
Return Me._linksSaved
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
|
||||||
Private _linksSaved As Boolean = True
|
Private _linksSaved As Boolean = True
|
||||||
|
|||||||
@ -2015,26 +2015,28 @@ Public Class frmNIVerknuepfungen
|
|||||||
MsgBox("Die SELECT-Anweisung konnte nicht auf ihren Ursprungswert zurückgesetzt werden." & vbNewLine & vbNewLine & ex.Message, MsgBoxStyle.Exclamation, "Fehler beim Zurücksetzen der SQL-Anweisung")
|
MsgBox("Die SELECT-Anweisung konnte nicht auf ihren Ursprungswert zurückgesetzt werden." & vbNewLine & vbNewLine & ex.Message, MsgBoxStyle.Exclamation, "Fehler beim Zurücksetzen der SQL-Anweisung")
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub btnsave_select_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave_select.Click
|
|
||||||
|
Private Sub SaveLinks()
|
||||||
Try
|
Try
|
||||||
If Me._selectedProfil._links.selectedLink IsNot Nothing Then
|
If Me._selectedProfil._links.selectedLink IsNot Nothing Then
|
||||||
If Me._selectedProfil.IsSaved = False Then
|
'Me._selectedProfil.Save(True, "link")
|
||||||
|
If Me._selectedProfil._links.selectedLink.SaveLink(Me._selectedProfil.Profilname, Me._selectedProfil.Ni_Art) = True Then
|
||||||
Me._selectedProfil.Save(True, "link")
|
Me._selectedProfil._links.setLinksSaved()
|
||||||
If Me._selectedProfil._links.selectedLink.SaveLink(Me._selectedProfil.Profilname, Me._selectedProfil.Ni_Art) = True Then
|
btnsave_select.Enabled = False
|
||||||
btnsave_select.Enabled = False
|
MsgBox("Verknüpfung erfolgreich gespeichert!", MsgBoxStyle.Information)
|
||||||
MsgBox("Verknüpfung erfolgreich gespeichert!", MsgBoxStyle.Information)
|
|
||||||
End If
|
|
||||||
With btnsave_select
|
|
||||||
.Enabled = False
|
|
||||||
.ForeColor = Drawing.Color.Black
|
|
||||||
End With
|
|
||||||
End If
|
End If
|
||||||
|
With btnsave_select
|
||||||
|
.Enabled = False
|
||||||
|
.ForeColor = Drawing.Color.Black
|
||||||
|
End With
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox("Fehler beim Speichern der DB-Verknüpfung." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Fehler beim Speichern der DB-Verknüpfung." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnsave_select_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave_select.Click
|
||||||
|
SaveLinks()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub txtSelectAnweisung_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSelectAnweisung.TextChanged
|
Private Sub txtSelectAnweisung_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSelectAnweisung.TextChanged
|
||||||
Try
|
Try
|
||||||
@ -2266,6 +2268,7 @@ Public Class frmNIVerknuepfungen
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub frmNIVerknuepfungen_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
Private Sub frmNIVerknuepfungen_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||||
If Me._selectedProfil IsNot Nothing Then
|
If Me._selectedProfil IsNot Nothing Then
|
||||||
|
|
||||||
If Me._selectedProfil.Desk_windreamIndex = "" Then
|
If Me._selectedProfil.Desk_windreamIndex = "" Then
|
||||||
If Me._selectedProfil.DbArt = "xml" Then
|
If Me._selectedProfil.DbArt = "xml" Then
|
||||||
MsgBox("Bitte definieren Sie einen eindeutigen/deskriptiven Index!", MsgBoxStyle.Critical, "Fehlende Konfiguration:")
|
MsgBox("Bitte definieren Sie einen eindeutigen/deskriptiven Index!", MsgBoxStyle.Critical, "Fehlende Konfiguration:")
|
||||||
@ -2273,21 +2276,32 @@ Public Class frmNIVerknuepfungen
|
|||||||
e.Cancel = True
|
e.Cancel = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If Me._selectedProfil IsNot Nothing Then
|
|
||||||
If Me._selectedProfil.HasChanges Then
|
If Me._selectedProfil.HasChanges Then
|
||||||
If _selectedProfil.MR_DAIndex <> "" And Me._selectedProfil.checkIndexsql = "" Then
|
If _selectedProfil.MR_DAIndex <> "" And Me._selectedProfil.checkIndexsql = "" Then
|
||||||
MsgBox("Bitte definieren Sie einen SQL-Befehl zum überprüfen des gültigen Startindexwertes!", MsgBoxStyle.Critical, "Fehlende Konfiguration:")
|
MsgBox("Bitte definieren Sie einen SQL-Befehl zum überprüfen des gültigen Startindexwertes!", MsgBoxStyle.Critical, "Fehlende Konfiguration:")
|
||||||
Me.tabctrlbottom.SelectedIndex = 0
|
Me.tabctrlbottom.SelectedIndex = 0
|
||||||
e.Cancel = True
|
e.Cancel = True
|
||||||
End If
|
|
||||||
End If
|
|
||||||
If Me._selectedProfil Is Nothing = False Then
|
|
||||||
Me.tabctrlbottom.Visible = False
|
|
||||||
If Me._selectedProfil.HasChanges Then
|
|
||||||
Me._selectedProfil.Save(True, "profile")
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not Me._selectedProfil.IsSaved Or Not Me._selectedProfil._links.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
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -2638,11 +2652,12 @@ Public Class frmNIVerknuepfungen
|
|||||||
' End If
|
' End If
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
Private Sub btnSaveCheckIndex_Click(sender As Object, e As EventArgs) Handles btnSaveCheckIndex.Click
|
Private Sub SaveProfile()
|
||||||
If Me.txtCheckIndexSQL.Text <> "" Then
|
If Me.txtCheckIndexSQL.Text <> "" Then
|
||||||
Try
|
Try
|
||||||
' die Änderungen speichern
|
' die Änderungen speichern
|
||||||
If Me._selectedProfil.Save(True, "profile") = True Then
|
If Me._selectedProfil.Save(True, "profile") = True Then
|
||||||
|
Me._selectedProfil.setSaved()
|
||||||
Me.btnSaveCheckIndex.Enabled = False
|
Me.btnSaveCheckIndex.Enabled = False
|
||||||
Else
|
Else
|
||||||
MsgBox("Das Profil konnte nicht erfolgreich gespeichert werden.", MsgBoxStyle.Exclamation, "Fehler beim Speichern eines Profils")
|
MsgBox("Das Profil konnte nicht erfolgreich gespeichert werden.", MsgBoxStyle.Exclamation, "Fehler beim Speichern eines Profils")
|
||||||
@ -2653,6 +2668,10 @@ Public Class frmNIVerknuepfungen
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnSaveCheckIndex_Click(sender As Object, e As EventArgs) Handles btnSaveCheckIndex.Click
|
||||||
|
SaveProfile()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub txtCheckIndexSQL_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtCheckIndexSQL.TextChanged
|
Private Sub txtCheckIndexSQL_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtCheckIndexSQL.TextChanged
|
||||||
|
|
||||||
If Me._selectedProfil IsNot Nothing Then
|
If Me._selectedProfil IsNot Nothing Then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user