From 2da647812ad743cf8a2f7cfb38682ed83ee1cd5d Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 25 Mar 2020 10:49:58 +0100 Subject: [PATCH] fix flackering lol, add msgbox for missing doctype-module assignment, check for missing guid --- Global_Indexer/ClassDatabase.vb | 22 +++++++++++----------- Global_Indexer/frmAdministration.vb | 19 ++++++++++++------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Global_Indexer/ClassDatabase.vb b/Global_Indexer/ClassDatabase.vb index 180a6c6..e4edef7 100644 --- a/Global_Indexer/ClassDatabase.vb +++ b/Global_Indexer/ClassDatabase.vb @@ -18,7 +18,7 @@ Public Class ClassDatabase Return True Catch ex As Exception LOGGER.Info("Unexpected error in Database-Init: " & ex.Message) - LOGGER.Error(ex.Message) + LOGGER.Error(ex) Return False End Try End Function @@ -95,7 +95,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Return_Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Return_Datatable: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) End If @@ -104,7 +104,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Return_Datatable: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) Return Nothing End Try @@ -134,7 +134,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Return_Datatable_CS: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) End If @@ -143,7 +143,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Return_Datatable_CS: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) Return Nothing End Try @@ -172,7 +172,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Execute non query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Execute_non_Query: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) End If @@ -181,7 +181,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Execute non query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Execute_non_Query: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) Return False @@ -212,7 +212,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Execute non query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Execute_non_Query: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) End If @@ -221,7 +221,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Execute Scalar - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & sql_command, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Execute_Scalar: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & sql_command) Return Nothing End Try @@ -264,7 +264,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in OracleExecute_non_Query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & ExecuteCMD, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in OracleExecute_non_Query: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & ExecuteCMD) Return False @@ -289,7 +289,7 @@ Public Class ClassDatabase If userInput = True Then MsgBox("Error in Oracle Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical) End If - LOGGER.Info("Unexpected error in Oracle_Return_Datatable: " & ex.Message) + LOGGER.Error(ex) LOGGER.Info("#SQL: " & Select_anweisung) Return Nothing End Try diff --git a/Global_Indexer/frmAdministration.vb b/Global_Indexer/frmAdministration.vb index 73b613c..adc9a10 100644 --- a/Global_Indexer/frmAdministration.vb +++ b/Global_Indexer/frmAdministration.vb @@ -199,23 +199,26 @@ Public Class frmAdministration MsgBox("Error in EndEdit 2 documenttype: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End If End Try + TBDD_DOKUMENTARTTableAdapter.Update(MyDataset.TBDD_DOKUMENTART) - txtStatus.Caption = $"Profil gespeichert - {Now.ToString}" + If IsInsert = True Then Dim oNewID As Integer oNewID = ClassDatabase.Execute_Scalar("SELECT MAX(GUID) FROM TBDD_DOKUMENTART", MyConnectionString) If IsNumeric(oNewID) Then - Dim osql = $" EXEC PRDD_CHECK_REL_DOCTYPE_MODULE 'GLOBIX',{oNewID}" - ClassDatabase.Execute_non_Query(osql) + Dim osql = $" EXEC PRDD_CHECK_REL_DOCTYPE_MODULE 'GLOBIX', {oNewID}" + If ClassDatabase.Execute_non_Query(osql) = False Then + MsgBox("Fehler beim zuweisen des neuen Profils zum Modul Global-Indexer!", MsgBoxStyle.Critical, Text) + End If End If - End If + + txtStatus.Caption = $"Profil gespeichert - {Now.ToString}" End If IsInsert = False Catch ex As Exception MsgBox("Error in Save_Dokumentart: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try - End Sub Private Sub btnNamenkonvention_Click(sender As Object, e As EventArgs) Handles btnNamenkonvention.Click Save_Dokumentart() @@ -230,7 +233,7 @@ Public Class frmAdministration End If End Sub - Private Sub TBDD_DOKUMENTARTBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBDD_DOKUMENTARTBindingSource.CurrentChanged, TBDD_DOKUMENTARTBindingSource.BindingComplete + Private Sub TBDD_DOKUMENTARTBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBDD_DOKUMENTARTBindingSource.CurrentChanged If DOKART_GUIDTextBox.Text <> String.Empty Then CURRENT_DOKART_ID = DOKART_GUIDTextBox.Text Load_TabData() @@ -1238,7 +1241,9 @@ Public Class frmAdministration End Sub Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick - Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) + If DOKART_GUIDTextBox.Text <> String.Empty Then + Load_INDEXMAN(DOKART_GUIDTextBox.Text) + End If End Sub Private Sub BarButtonItem20_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem20.ItemClick