From acf61c9ca5204c5ad8cdb2926bc2744c3f9f1b12 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 10 Feb 2020 17:09:14 +0100 Subject: [PATCH] WIP: first pass of depending controls --- Global_Indexer/ClassControls.vb | 205 ++++++++++++-------- Global_Indexer/ClassDatabase.vb | 8 + Global_Indexer/ClassInit.vb | 13 +- Global_Indexer/ClassPatterns.vb | 34 +++- Global_Indexer/Global_Indexer.vbproj | 1 + Global_Indexer/ModuleCURRENT.vb | 8 +- Global_Indexer/ModuleHelpers.vb | 15 ++ Global_Indexer/frmAdministration.vb | 7 +- Global_Indexer/frmIndexFileList.Designer.vb | 29 +-- Global_Indexer/frmIndexFileList.resx | 147 ++++++-------- Global_Indexer/frmIndexFileList.vb | 11 +- Global_Indexer/frmStart.vb | 14 +- 12 files changed, 278 insertions(+), 214 deletions(-) create mode 100644 Global_Indexer/ModuleHelpers.vb diff --git a/Global_Indexer/ClassControls.vb b/Global_Indexer/ClassControls.vb index a1ff0c0..1631b5a 100644 --- a/Global_Indexer/ClassControls.vb +++ b/Global_Indexer/ClassControls.vb @@ -1,10 +1,15 @@ Imports System.Data.SqlClient Imports Oracle.ManagedDataAccess.Client +Imports DigitalData.Controls.LookupGrid Public Class ClassControls Private Property Form As frmIndex Private Property Panel As Panel + Public Class ControlMeta + Public Property IndexName As String + End Class + Public Sub New(Panel As Panel, Form As frmIndex) Me.Form = Form Me.Panel = Panel @@ -17,6 +22,9 @@ Public Class ClassControls chk.Name = "chk" & indexname chk.Size = New Size(100, 27) chk.Location = New Point(11, y) + chk.Tag = New ControlMeta() With { + .IndexName = indexname + } If caption <> "" Then chk.Text = caption @@ -33,6 +41,8 @@ Public Class ClassControls chk.Checked = value End If + AddHandler chk.CheckedChanged, AddressOf Checkbox_CheckedChanged + Return chk Catch ex As Exception ClassLogger.Add("Unhandled Exception in AddCheckBox: " & ex.Message, True) @@ -40,91 +50,43 @@ Public Class ClassControls End Try End Function + Public Sub Checkbox_CheckedChanged(sender As CheckBox, e As EventArgs) + PrepareDependingControl(sender) + End Sub + Public Function AddVorschlag_ComboBox(indexname As String, y As Integer, conid As Integer, sql_Vorschlag As String, Multiselect As Boolean, Optional Vorgabe As String = "", Optional AddNewValues As Boolean = False, Optional PreventDuplicateValues As Boolean = False) As Control Try - Dim connectionString As String - Dim sqlCnn As SqlConnection - Dim sqlCmd As SqlCommand - Dim adapter As New SqlDataAdapter - - Dim oracleConn As OracleConnection - Dim oracleCmd As OracleCommand - Dim oracleadapter As New OracleDataAdapter - - Dim NewDataset As New DataSet - Dim i As Integer - Dim sql As String - Dim runinLZ As Boolean = False - - connectionString = ClassFormFunctions.GetConnectionString(conid) - If connectionString Is Nothing = False Then - 'SQL Befehl füllt die Auswahlliste - sql = sql_Vorschlag - If Not sql.Contains("@") Then - If connectionString.Contains("Initial Catalog=") Then - sqlCnn = New SqlConnection(connectionString) - sqlCnn.Open() - sqlCmd = New SqlCommand(sql, sqlCnn) - adapter.SelectCommand = sqlCmd - adapter.Fill(NewDataset) - ElseIf connectionString.StartsWith("Data Source=") And connectionString.Contains("SERVICE_NAME") Then - - oracleConn = New OracleConnection(connectionString) - ' Try - oracleConn.Open() - oracleCmd = New OracleCommand(sql_Vorschlag, oracleConn) - oracleadapter.SelectCommand = oracleCmd - oracleadapter.Fill(NewDataset) - End If - Else - runinLZ = True - If LogErrorsOnly = False Then ClassLogger.Add(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False) - End If - - - If runinLZ = True Then - 'Die Standardcombobox anlegen - Dim oCombobox As ComboBox - oCombobox = AddCombobox(indexname, y) - oCombobox.Size = New Size(300, 27) - Return oCombobox + Dim oSql As String = sql_Vorschlag + Dim oConnectionString As String + Dim oControl As New DigitalData.Controls.LookupGrid.LookupControl2 With { + .MultiSelect = Multiselect, + .AllowAddNewValues = AddNewValues, + .PreventDuplicates = PreventDuplicateValues, + .Location = New Point(11, y), + .Size = New Size(300, 27), + .Name = "cmbMulti" & indexname, + .Tag = New ControlMeta() With { + .IndexName = indexname + } + } + + AddHandler oControl. + + oConnectionString = ClassFormFunctions.GetConnectionString(conid) + If oConnectionString IsNot Nothing Then + If ClassPatterns.HasComplexPatterns(oSql) Then + LOGGER.Debug(" >>sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False) Else - Dim table As DataTable = NewDataset.Tables(0) - Dim oControl As New DigitalData.Controls.LookupGrid.LookupControl2 With { - .DataSource = table, - .MultiSelect = Multiselect, - .AllowAddNewValues = AddNewValues, - .PreventDuplicates = PreventDuplicateValues, - .Location = New Point(11, y), - .Size = New Size(300, 27), - .Name = "cmbMulti" & indexname - } - - If connectionString.Contains("Initial Catalog=") Then - Try - adapter.Dispose() - sqlCmd.Dispose() - sqlCnn.Close() - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical) - End Try - Else - Try - oracleadapter.Dispose() - oracleCmd.Dispose() - oracleConn.Close() - Catch ex As Exception - MsgBox(ex.Message, MsgBoxStyle.Critical) - End Try - - End If - - Return oControl + Dim oDatatable = ClassDatabase.Return_Datatable_Combined(oSql, oConnectionString, False) + oControl.DataSource = oDatatable End If End If + + Return oControl Catch ex As Exception ClassLogger.Add(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & indexname & " - Fehler: " & vbNewLine & ex.Message) MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in AddVorschlag_ComboBox:") + Return Nothing End Try End Function @@ -134,10 +96,12 @@ Public Class ClassControls cmb.AutoSize = True cmb.Size = New Size(300, 27) cmb.Location = New Point(11, y) - 'cmb.AutoCompleteMode = AutoCompleteMode.SuggestAppend - 'cmb.AutoCompleteSource = AutoCompleteSource.ListItems - 'AddHandler cmb.KeyUp, AddressOf AutoCompleteCombo_KeyUp + cmb.Tag = New ControlMeta() With { + .IndexName = indexname + } + + AddHandler cmb.SelectedIndexChanged, AddressOf OncmbSIndexChanged AddHandler cmb.GotFocus, AddressOf OncmbGotFocus AddHandler cmb.LostFocus, AddressOf OncmbLostFocus @@ -310,6 +274,9 @@ Public Class ClassControls txt.Size = New Size(260, 27) txt.Location = New Point(11, y) + txt.Tag = New ControlMeta() With { + .IndexName = indexname + } If text <> "" Then txt.Text = text @@ -343,8 +310,86 @@ Public Class ClassControls Public Sub OnTextBoxKeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Dim oTextbox As TextBox = sender + + If oTextbox.Text = String.Empty Then + Exit Sub + End If + + If e.KeyCode = Keys.Return Or e.KeyCode = Keys.Enter Or e.KeyCode = Keys.Tab Then + PrepareDependingControl(oTextbox) + End If + If (e.KeyCode = Keys.Return) Then SendKeys.Send("{TAB}") End If End Sub + + Private Sub PrepareDependingControl(Control As Control) + If TypeOf Control Is Label Then + Exit Sub + End If + + Try + Dim oMeta = DirectCast(Control.Tag, ClassControls.ControlMeta) + Dim oIndexName As String = oMeta.IndexName + Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%'" + Dim oDatatable As DataTable = ClassDatabase.Return_Datatable(oSQL) + + If Not IsNothing(oDatatable) Then + For Each oRow As DataRow In oDatatable.Rows + Dim oControlName As String = NotNull(oRow.Item("NAME"), "") + Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), -1) + Dim oControlSql As String = NotNull(oRow.Item("SQL_RESULT"), "") + + If oConnectionId = -1 Or oControlSql = String.Empty Then + LOGGER.Warn("Missing SQL Query or ConnectionId for Control [{0}]! Continuing.", oControlName) + Continue For + End If + + oControlSql = ClassPatterns.ReplaceUserValues(oControlSql, USER_PRENAME, USER_SURNAME, USER_SHORT_NAME, USER_LANGUAGE, USER_EMAIL, USER_ID, CURRENT_DOKART_ID) + oControlSql = ClassPatterns.ReplaceInternalValues(oControlSql) + oControlSql = ClassPatterns.ReplaceControlValues(oControlSql, Panel) + + SetDependingControlResult(oControlName, oControlSql, oConnectionId) + Next + + End If + Catch ex As Exception + LOGGER.Error(ex) + End Try + End Sub + + Private Sub SetDependingControlResult(IndexName As String, SqlCommand As String, SqlConnectionId As Integer) + Try + Dim oConnectionString = ClassFormFunctions.GetConnectionString(SqlConnectionId) + Dim oDatatable As DataTable = ClassDatabase.Return_Datatable_CS(SqlCommand, oConnectionString) + Dim oFoundControl As Control = Nothing + + For Each oControl As Control In Panel.Controls + If TypeOf oControl Is Label Then + Continue For + End If + + Dim oMeta = DirectCast(oControl.Tag, ClassControls.ControlMeta) + Dim oIndex As String = oMeta.IndexName + + If oIndex = IndexName Then + oFoundControl = oControl + Exit For + End If + Next + + If oFoundControl IsNot Nothing Then + If TypeOf oFoundControl Is TextBox Then + DirectCast(oFoundControl, TextBox).Text = oDatatable.Rows.Item(0).Item(0) + ElseIf TypeOf oFoundControl Is LookupControl2 Then + DirectCast(oFoundControl, LookupControl2).DataSource = oDatatable + ElseIf TypeOf oFoundControl Is ComboBox Then + DirectCast(oFoundControl, ComboBox).DataSource = oDatatable + End If + End If + Catch ex As Exception + LOGGER.Error(ex) + End Try + End Sub End Class diff --git a/Global_Indexer/ClassDatabase.vb b/Global_Indexer/ClassDatabase.vb index dbf389b..6d94de1 100644 --- a/Global_Indexer/ClassDatabase.vb +++ b/Global_Indexer/ClassDatabase.vb @@ -62,6 +62,14 @@ Public Class ClassDatabase Return connectionString End Function + Public Shared Function Return_Datatable_Combined(SqlCommand As String, ConnectionString As String, Optional userInput As Boolean = False) + If ConnectionString.Contains("Initial Catalog=") Then + Return Return_Datatable(SqlCommand, userInput) + Else + Return Oracle_Return_Datatable(SqlCommand, ConnectionString, userInput) + End If + End Function + Public Shared Function Return_Datatable(sql_command As String, Optional userInput As Boolean = False) Try Dim SQLconnect As New SqlConnection diff --git a/Global_Indexer/ClassInit.vb b/Global_Indexer/ClassInit.vb index e73e3b5..5061af3 100644 --- a/Global_Indexer/ClassInit.vb +++ b/Global_Indexer/ClassInit.vb @@ -214,11 +214,16 @@ Public Class ClassInit Exit Sub End Try - sql = "SELECT SHORTNAME FROM TBDD_USER WHERE GUID = " & USER_ID - USER_SHORT_NAME = ClassDatabase.Execute_Scalar(sql, MyConnectionString) - If IsNothing(USER_SHORT_NAME) Or IsDBNull(USER_SHORT_NAME) Then - USER_SHORT_NAME = "" + Dim oUserDatatable As DataTable = ClassDatabase.Return_Datatable($"SELECT * FROM TBDD_USER WHERE GUID = {USER_ID}") + If Not IsNothing(oUserDatatable) AndAlso Not IsDBNull(oUserDatatable.Rows.Item(0)) Then + Dim oRow As DataRow = oUserDatatable.Rows.Item(0) + USER_SHORT_NAME = NotNull(oRow.Item("SHORTNAME"), String.Empty) + USER_PRENAME = NotNull(oRow.Item("PRENAME"), String.Empty) + USER_SURNAME = NotNull(oRow.Item("NAME"), String.Empty) + USER_EMAIL = NotNull(oRow.Item("EMAIL"), String.Empty) + USER_USERNAME = NotNull(oRow.Item("USERNAME"), String.Empty) End If + 'Check_User_Exists_in_GIGroups() sql = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','GLOBIX',{1})", Environment.UserName, 1) Dim DT_CHECKUSER_MODULE As DataTable = ClassDatabase.Return_Datatable(sql) diff --git a/Global_Indexer/ClassPatterns.vb b/Global_Indexer/ClassPatterns.vb index f78be65..aded01c 100644 --- a/Global_Indexer/ClassPatterns.vb +++ b/Global_Indexer/ClassPatterns.vb @@ -151,11 +151,35 @@ Public Class ClassPatterns End If Dim controlName As String = GetNextPattern(result, PATTERN_CTRL).Value - Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault() - - If control IsNot Nothing Then - Dim value As String = control.Text - result = ReplacePattern(result, PATTERN_CTRL, value) + 'Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault() + Dim oFoundControl As Control = Nothing + + For Each oControl As Control In panel.Controls + If TypeOf oControl Is Label Then + Continue For + End If + + Dim oMeta = DirectCast(oControl.Tag, ClassControls.ControlMeta) + Dim oIndex As String = oMeta.IndexName + + If oIndex = controlName Then + oFoundControl = oControl + Exit For + End If + Next + + If oFoundControl IsNot Nothing Then + Dim oValue As String = String.Empty + + If TypeOf oFoundControl Is TextBox Then + oValue = DirectCast(oFoundControl, TextBox).Text + ElseIf TypeOf oFoundControl Is CheckBox Then + oValue = IIf(DirectCast(oFoundControl, CheckBox).Checked, 1, 0) + Else + oValue = "" + End If + + result = ReplacePattern(result, PATTERN_CTRL, oValue) End If oTryCounter += 1 diff --git a/Global_Indexer/Global_Indexer.vbproj b/Global_Indexer/Global_Indexer.vbproj index 0691150..4c6dc38 100644 --- a/Global_Indexer/Global_Indexer.vbproj +++ b/Global_Indexer/Global_Indexer.vbproj @@ -376,6 +376,7 @@ Form + diff --git a/Global_Indexer/ModuleCURRENT.vb b/Global_Indexer/ModuleCURRENT.vb index 167e2ff..a6e7484 100644 --- a/Global_Indexer/ModuleCURRENT.vb +++ b/Global_Indexer/ModuleCURRENT.vb @@ -31,10 +31,14 @@ Module ModuleCURRENT Public USER_ID Public USER_IN_MODULE As Boolean = False Public USER_IS_ADMIN As Boolean = False - Public USER_SHORT_NAME Public UserLoggedin As Integer = 0 - Public USER_LANGUAGE As String = "DE" + Public USER_SHORT_NAME As String = "" + Public USER_PRENAME As String = "" + Public USER_SURNAME As String = "" + Public USER_EMAIL As String = "" + Public USER_LANGUAGE As String = "DE" + Public USER_USERNAME As String = "" Public CURRENT_FOLDERWATCH As String = "" Public CURRENT_SCAN_FOLDERWATCH As String = "" diff --git a/Global_Indexer/ModuleHelpers.vb b/Global_Indexer/ModuleHelpers.vb new file mode 100644 index 0000000..269f795 --- /dev/null +++ b/Global_Indexer/ModuleHelpers.vb @@ -0,0 +1,15 @@ +Module ModuleHelpers + ''' + ''' Überprüft einen Wert auf verschiedene Arten von "Null" und gibt einen Standard-Wert zurück, wenn der Wert "Null" ist. + ''' + ''' Der zu überprüfende Wert + ''' Der Standard Wert + ''' value oder wenn dieser "Null" ist, defaultValue + Public Function NotNull(Of T)(ByVal value As T, ByVal defaultValue As T) As T + If IsNothing(value) OrElse String.IsNullOrEmpty(value.ToString) OrElse IsDBNull(value) Then + Return defaultValue + Else + Return value + End If + End Function +End Module diff --git a/Global_Indexer/frmAdministration.vb b/Global_Indexer/frmAdministration.vb index 25c67d3..8fffa5a 100644 --- a/Global_Indexer/frmAdministration.vb +++ b/Global_Indexer/frmAdministration.vb @@ -551,10 +551,15 @@ Public Class frmAdministration Dim oSQL = $"SELECT SQL_RESULT, CONNECTION_ID FROM TBDD_INDEX_MAN WHERE GUID = {oIndexGuid}" Dim oDatatable As DataTable = ClassDatabase.Return_Datatable(oSQL) Dim oRow = oDatatable.Rows.Item(0) + Dim oConnection As Integer = 1 + + If Not IsDBNull(oRow.Item("CONNECTION_ID")) Then + oConnection = oRow.Item("CONNECTION_ID") + End If Dim oForm As New frmSQL_DESIGNER(oIndexGuid, oDocTypeGuid) With { .SQLCommand = oRow.Item("SQL_RESULT"), - .ConnectionID = oRow.Item("CONNECTION_ID") + .ConnectionID = oConnection } If oForm.ShowDialog() = DialogResult.OK Then diff --git a/Global_Indexer/frmIndexFileList.Designer.vb b/Global_Indexer/frmIndexFileList.Designer.vb index de79b82..441c57e 100644 --- a/Global_Indexer/frmIndexFileList.Designer.vb +++ b/Global_Indexer/frmIndexFileList.Designer.vb @@ -34,9 +34,11 @@ Partial Class frmIndexFileList Me.TBGI_FILES_USERTableAdapter = New Global_Indexer.MyDatasetTableAdapters.TBGI_FILES_USERTableAdapter() Me.TableAdapterManager = New Global_Indexer.MyDatasetTableAdapters.TableAdapterManager() Me.Button2 = New System.Windows.Forms.Button() - Me.btnCancel = New System.Windows.Forms.Button() Me.btnstartIndex = New System.Windows.Forms.Button() Me.Panel1.SuspendLayout() + CType(Me.CheckedListBoxControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TBGI_FILES_USERBindingSource, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.MyDataset1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Panel1 @@ -56,6 +58,11 @@ Partial Class frmIndexFileList resources.ApplyResources(Me.Label1, "Label1") Me.Label1.Name = "Label1" ' + 'CheckedListBoxControl1 + ' + resources.ApplyResources(Me.CheckedListBoxControl1, "CheckedListBoxControl1") + Me.CheckedListBoxControl1.Name = "CheckedListBoxControl1" + ' 'Button1 ' resources.ApplyResources(Me.Button1, "Button1") @@ -63,6 +70,11 @@ Partial Class frmIndexFileList Me.Button1.TabStop = False Me.Button1.UseVisualStyleBackColor = True ' + 'MyDataset1 + ' + Me.MyDataset1.DataSetName = "MyDataset" + Me.MyDataset1.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema + ' 'TBGI_FILES_USERTableAdapter ' Me.TBGI_FILES_USERTableAdapter.ClearBeforeFill = True @@ -82,6 +94,7 @@ Partial Class frmIndexFileList Me.TableAdapterManager.TBDD_USERTableAdapter = Nothing Me.TableAdapterManager.TBGI_CONFIGURATIONTableAdapter = Nothing Me.TableAdapterManager.TBGI_OBJECTTYPE_EMAIL_INDEXTableAdapter = Nothing + Me.TableAdapterManager.TBGI_REGEX_DOCTYPETableAdapter = Nothing Me.TableAdapterManager.TBHOTKEY_PATTERNS_REWORKTableAdapter = Nothing Me.TableAdapterManager.TBHOTKEY_PATTERNSTableAdapter = Nothing Me.TableAdapterManager.TBHOTKEY_PROFILETableAdapter = Nothing @@ -96,16 +109,10 @@ Partial Class frmIndexFileList Me.Button2.TabStop = False Me.Button2.UseVisualStyleBackColor = True ' - 'btnCancel - ' - resources.ApplyResources(Me.btnCancel, "btnCancel") - Me.btnCancel.Name = "btnCancel" - Me.btnCancel.TabStop = False - Me.btnCancel.UseVisualStyleBackColor = True - ' 'btnstartIndex ' resources.ApplyResources(Me.btnstartIndex, "btnstartIndex") + Me.btnstartIndex.Image = Global.Global_Indexer.My.Resources.Resources.Go Me.btnstartIndex.Name = "btnstartIndex" Me.btnstartIndex.UseVisualStyleBackColor = True ' @@ -113,8 +120,6 @@ Partial Class frmIndexFileList ' resources.ApplyResources(Me, "$this") Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ControlBox = False - Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.CheckedListBoxControl1) @@ -126,6 +131,9 @@ Partial Class frmIndexFileList Me.TopMost = True Me.Panel1.ResumeLayout(False) Me.Panel1.PerformLayout() + CType(Me.CheckedListBoxControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TBGI_FILES_USERBindingSource, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.MyDataset1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub @@ -139,6 +147,5 @@ Partial Class frmIndexFileList Friend WithEvents CheckedListBoxControl1 As DevExpress.XtraEditors.CheckedListBoxControl Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.Button - Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents Label2 As Label End Class diff --git a/Global_Indexer/frmIndexFileList.resx b/Global_Indexer/frmIndexFileList.resx index c2cbf59..5690d15 100644 --- a/Global_Indexer/frmIndexFileList.resx +++ b/Global_Indexer/frmIndexFileList.resx @@ -117,63 +117,15 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Label2 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Panel1 - - - 0 - - - Label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Panel1 - - - 1 - - - - Top - - - - 0, 0 - - - 655, 57 - - - 0 - - - Panel1 - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 5 - True + Segoe UI, 9.75pt, style=Bold + NoControl @@ -231,6 +183,42 @@ 1 + + Top + + + 0, 0 + + + 647, 57 + + + 0 + + + Panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 4 + + + Top, Bottom, Left, Right + + + 0, 63 + + + 647, 261 + + + 8 + CheckedListBoxControl1 @@ -241,16 +229,16 @@ $this - 3 + 2 Bottom, Left - 6, 292 + 12, 344 - 115, 23 + 115, 36 1 @@ -268,8 +256,14 @@ $this - 2 + 1 + + 17, 17 + + + 240, 17 + 357, 17 @@ -280,16 +274,16 @@ Bottom, Left - 6, 319 + 133, 344 - 115, 23 + 115, 36 6 - Alle unselektieren + Alle abwählen Button2 @@ -301,39 +295,6 @@ $this - 1 - - - Bottom, Right - - - MiddleLeft - - - 406, 292 - - - 86, 36 - - - 7 - - - Abbruch - - - MiddleRight - - - btnCancel - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 0 @@ -346,7 +307,7 @@ MiddleLeft - 498, 292 + 490, 344 145, 36 @@ -370,7 +331,7 @@ $this - 4 + 3 True @@ -379,7 +340,7 @@ 7, 15 - 655, 354 + 647, 392 Segoe UI, 9pt diff --git a/Global_Indexer/frmIndexFileList.vb b/Global_Indexer/frmIndexFileList.vb index ae77c59..6197d63 100644 --- a/Global_Indexer/frmIndexFileList.vb +++ b/Global_Indexer/frmIndexFileList.vb @@ -1,4 +1,6 @@ -Public Class frmIndexFileList +Imports System.ComponentModel + +Public Class frmIndexFileList Private Sub frmIndexFileList_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try @@ -15,7 +17,7 @@ Catch ex As Exception MsgBox("Error in Load Form: " & ex.Message, MsgBoxStyle.Critical) End Try - + End Sub Private Sub btnstartIndex_Click(sender As Object, e As EventArgs) Handles btnstartIndex.Click @@ -39,7 +41,7 @@ Catch ex As Exception MsgBox("Unexpected Error in Clear Multiple Documents: " & ex.Message, MsgBoxStyle.Critical) End Try - + Me.Close() End Sub @@ -56,8 +58,7 @@ CheckedListBoxControl1.Focus() End Sub - Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click + Private Sub frmIndexFileList_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing ClassDatabase.Execute_non_Query("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')", True) - Me.Close() End Sub End Class \ No newline at end of file diff --git a/Global_Indexer/frmStart.vb b/Global_Indexer/frmStart.vb index 737ba58..7e396c2 100644 --- a/Global_Indexer/frmStart.vb +++ b/Global_Indexer/frmStart.vb @@ -284,31 +284,19 @@ Public Class frmStart End Try Me.TopMost = True End Sub - Sub MyBackgroundThread() - - Dim frmCollection = System.Windows.Forms.Application.OpenForms - Do While frmCollection.OfType(Of frmIndex).Any - - Loop - End Sub Sub Open_IndexDialog() Try Me.Hide() Me.TopMost = False frmIndex.Show() - 'Dim thread As New Thread(AddressOf MyBackgroundThread) - 'thread.Start() - 'Do While thread.IsAlive - - 'Loop Me.Visible = True Me.TopMost = True Me.BringToFront() Catch ex As Exception + LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical) End Try - End Sub Private Sub frmStart_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing