From d57049e24514fbfa6c6d4c3f4545d1e74a81dde8 Mon Sep 17 00:00:00 2001 From: Digital Data - Marlon Schreiber Date: Tue, 28 Apr 2020 12:20:04 +0200 Subject: [PATCH] MS saving --- app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb | 2 +- app/DD_PM_WINDREAM/frmAdministration.resx | 50 +++--- app/DD_PM_WINDREAM/frmAdministration.vb | 142 +++++++++++------- app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb | 7 +- 4 files changed, 119 insertions(+), 82 deletions(-) diff --git a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb index 64dd8cd..08874e7 100644 --- a/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb +++ b/app/DD_PM_WINDREAM/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/DD_PM_WINDREAM/frmAdministration.resx b/app/DD_PM_WINDREAM/frmAdministration.resx index 95fd7b3..a433c82 100644 --- a/app/DD_PM_WINDREAM/frmAdministration.resx +++ b/app/DD_PM_WINDREAM/frmAdministration.resx @@ -163,7 +163,7 @@ True - 383, 56 + 571, 56 206, 17 @@ -334,7 +334,7 @@ True - 1045, 134 + 623, 173 Fill @@ -532,7 +532,7 @@ True - 439, 134 + 17, 173 Fill @@ -655,7 +655,7 @@ True - 17, 134 + 739, 134 Fill @@ -1087,7 +1087,7 @@ 6 - 188, 56 + 376, 56 368, 17 @@ -1534,10 +1534,10 @@ windream-Suche wählen - 1310, 17 + 17, 56 - 17, 56 + 205, 56 Top, Bottom, Left, Right @@ -1783,10 +1783,10 @@ Top, Bottom, Left, Right - 798, 173 + 471, 212 - 344, 173 + 17, 212 Fill @@ -2536,16 +2536,16 @@ 0 - 823, 56 + 1011, 56 - 1054, 95 + 257, 134 - 17, 95 + 391, 95 - 1343, 56 + 274, 95 20, 20 @@ -2578,13 +2578,13 @@ 1 - 606, 56 + 794, 56 17, 17 - 1086, 56 + 17, 95 Fill @@ -2611,34 +2611,34 @@ 0 - 296, 95 + 670, 95 - 569, 95 + 943, 95 - 814, 95 + 17, 134 - 1298, 95 + 501, 134 - 231, 134 + 953, 134 - 674, 134 + 252, 173 - 903, 134 + 481, 173 - 17, 173 + 956, 173 - 493, 173 + 166, 212 - 1108, 173 + 781, 212 Aktualisieren diff --git a/app/DD_PM_WINDREAM/frmAdministration.vb b/app/DD_PM_WINDREAM/frmAdministration.vb index c5412f4..8b63bb1 100644 --- a/app/DD_PM_WINDREAM/frmAdministration.vb +++ b/app/DD_PM_WINDREAM/frmAdministration.vb @@ -3,6 +3,7 @@ Imports System.Data.SqlClient Imports System.IO Imports DD_LIB_Standards Imports DevExpress.XtraGrid +Imports DevExpress.XtraGrid.Views.Base Imports DevExpress.XtraGrid.Views.Grid Public Class frmAdministration @@ -11,6 +12,7 @@ Public Class frmAdministration Private email As New ClassEmail Public profile_guid As Integer = 0 Dim formloaded As Boolean + Dim change_BindingSource As Boolean Private INSERT_ACTIVE As Boolean = False @@ -252,34 +254,7 @@ Public Class frmAdministration DD_DMSLiteDataSet.TBPM_PROFILE.TYPEColumn.DefaultValue = 1 End Sub - Private Sub TBPM_PROFILEBindingSource_PositionChanged(sender As System.Object, e As System.EventArgs) Handles TBPM_PROFILEBindingSource.PositionChanged - If formloaded = False Then - Exit Sub - End If - If UNSAVED_CHANGES_PROFILE = True Or UNSAVED_CHANGES_FI = True Then - Dim oQuestion As String - If USER_LANGUAGE <> "de-DE" Then - oQuestion = "You have unsaved changes! Do You want to save them now?" - Else - oQuestion = "Achtung es gibt noch ungespeicherte Änderungen! Wollen Sie diese nun speichern?" - End If - Dim result As MsgBoxResult = MsgBox(oQuestion, MsgBoxStyle.YesNo, ADDITIONAL_TITLE) - 'wenn Speichern ja - If result = MsgBoxResult.Yes Then - If UNSAVED_CHANGES_PROFILE = True Then - Save_Profile() - End If - If UNSAVED_CHANGES_FI = True Then - Save_FI() - End If - End If - End If - tsbStaticInfo.Caption = "" - Indexe_eintragen() - If tabctrl_Profilkonfig.SelectedIndex = 1 And TBPM_PROFILEBindingSource.Position <> -1 Then - Refresh_Final_indexe() - End If - End Sub + @@ -688,7 +663,7 @@ Public Class frmAdministration - Private Sub cmbObjekttypen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbObjekttypen.SelectedIndexChanged + Private Sub cmbObjekttypen_SelectedIndexChanged(sender As Object, e As EventArgs) If formloaded = False Then Exit Sub End If @@ -697,23 +672,6 @@ Public Class frmAdministration End If End Sub - Private Sub Button3_Click_1(sender As Object, e As EventArgs) - Dim indexe = WINDREAM.GetIndicesByObjecttype(cmbObjekttypen.Text) - If indexe IsNot Nothing Then - For Each index As String In indexe - MsgBox(index & vbNewLine & WINDREAM.GetTypeOfIndex(index)) - Select Case WINDREAM.GetTypeOfIndex(index) - Case 4107 'Vektor Zahl - - Case 4097 - - Case Else - - End Select - Next - End If - End Sub - 'Private Sub TabControlFinalIndices_SelectedIndexChanged(sender As Object, e As EventArgs) ' If TabControlFinalIndices.SelectedIndex = 1 Then ' Me.cmbIndexe2.Enabled = False @@ -1169,7 +1127,7 @@ Public Class frmAdministration End Sub Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick - Save_FI + Save_FI() End Sub Private Sub Save_FI() Try @@ -1329,21 +1287,103 @@ Public Class frmAdministration LOGGER.Error(ex) End Try End Sub - Private Sub TBPM_PROFILEBindingSource_CurrentItemChanged(sender As Object, e As EventArgs) Handles TBPM_PROFILEBindingSource.CurrentItemChanged Check_Changes() + change_BindingSource = True + CHECK_QUESTION_CHANGES() End Sub - Private Sub Check_Changes() + Private Sub TBPM_PROFILEBindingSource_PositionChanged(sender As System.Object, e As System.EventArgs) Handles TBPM_PROFILEBindingSource.PositionChanged If formloaded = False Then Exit Sub End If - If UNSAVED_CHANGES_PROFILE = True Then + Check_Changes() + change_BindingSource = False + + tsbStaticInfo.Caption = "" + Indexe_eintragen() + If tabctrl_Profilkonfig.SelectedIndex = 1 And TBPM_PROFILEBindingSource.Position <> -1 Then + Refresh_Final_indexe() + End If + End Sub + Sub CHECK_QUESTION_CHANGES() + If formloaded = False Then + Exit Sub + End If + If UNSAVED_CHANGES_PROFILE = True Or UNSAVED_CHANGES_FI = True Then + Dim oQuestion As String + If USER_LANGUAGE <> "de-DE" Then + oQuestion = "You have unsaved changes! Do You want to save them now?" + Else + oQuestion = "Achtung es gibt noch ungespeicherte Änderungen! Wollen Sie diese nun speichern?" + End If + Dim result As MsgBoxResult = MsgBox(oQuestion, MsgBoxStyle.YesNo, ADDITIONAL_TITLE) + 'wenn Speichern ja + If result = MsgBoxResult.Yes Then + If UNSAVED_CHANGES_PROFILE = True Then + Save_Profile() + End If + If UNSAVED_CHANGES_FI = True Then + Save_FI() + End If + Else + UNSAVED_CHANGES_PROFILE = False + End If + End If + End Sub + Private Sub Check_Changes() + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then Exit Sub End If - TBPM_PROFILEBindingSource.EndEdit() If Not IsNothing(DD_DMSLiteDataSet.TBPM_PROFILE.GetChanges) Then UNSAVED_CHANGES_PROFILE = True End If End Sub + + Private Sub NAMETextBox_TextChanged(sender As Object, e As EventArgs) Handles WD_SEARCHTextBox.TextChanged, TITLETextBox.TextChanged, NAMETextBox.TextChanged, + FINAL_TEXTTextBox.TextChanged, DESCRIPTIONTextBox.TextChanged, WORK_HISTORY_ENTRYTextBox.TextChanged, MOVE2FOLDERTextBox.TextChanged + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + End If + 'UNSAVED_CHANGES_PROFILE = True + End Sub + + Private Sub ACTIVECheckBox_CheckStateChanged(sender As Object, e As EventArgs) Handles SORT_BY_LATESTCheckBox.CheckStateChanged, FINAL_PROFILECheckBox.CheckStateChanged, ACTIVECheckBox.CheckStateChanged + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + End If + 'UNSAVED_CHANGES_PROFILE = True + End Sub + + Private Sub cmbObjekttypen_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles PM_VEKTOR_INDEXComboBox.SelectedIndexChanged, DISPLAY_MODEComboBox.SelectedIndexChanged, cmbObjekttypen.SelectedIndexChanged, cmbLOGIndex.SelectedIndexChanged + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + End If + 'UNSAVED_CHANGES_PROFILE = True + End Sub + + Private Sub GridView1_FocusedRowChanged(sender As Object, e As Views.Base.FocusedRowChangedEventArgs) Handles GridView1.FocusedRowChanged + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + + End If + 'change_BindingSource = True + End Sub + + Private Sub GridView1_ValidateRow(sender As Object, e As ValidateRowEventArgs) Handles GridView1.ValidateRow + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + + End If + change_BindingSource = True + End Sub + + Private Sub TBPM_PROFILEBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBPM_PROFILEBindingSource.CurrentChanged + If formloaded = False Or UNSAVED_CHANGES_PROFILE = True Or change_BindingSource = True Then + Exit Sub + + End If + change_BindingSource = True + Check_Changes() + End Sub End Class \ No newline at end of file diff --git a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb index e88a683..8511afa 100644 --- a/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb +++ b/app/DD_PM_WINDREAM/frmSQL_DESIGNER.vb @@ -3,7 +3,6 @@ Imports Oracle.ManagedDataAccess.Client Imports DD_LIB_Standards Public Class frmSQL_DESIGNER - 'Private _windreamPM As ClassPMWindream Dim CurrentPosition As Integer = 0 Dim CurrentPlaceholders As New Placeholders() @@ -29,7 +28,6 @@ Public Class frmSQL_DESIGNER Private Sub TBPM_PROFILE_FINAL_INDEXINGBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Validate() TableAdapterManager.UpdateAll(Me.DD_DMSLiteDataSet) - End Sub Private Sub frmSQL_FINAL_INDICES_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try @@ -59,9 +57,8 @@ Public Class frmSQL_DESIGNER cmbIndexe.Items.Clear() If IDB_ACTIVE = False Then - Dim oIndicies = WINDREAM.GetIndicesByObjecttype(CURRENT_OBJECTTYPE) - If oIndicies IsNot Nothing Then - For Each index As String In oIndicies + If MyIndicies IsNot Nothing Then + For Each index As String In MyIndicies cmbIndexe.Items.Add(index) Next cmbIndexe.SelectedIndex = -1