Imports System.ComponentModel Imports System.Text.RegularExpressions Public Class frmAdministration Public Shared _Namenkonvention As String Public Shared _aktDokart_Id As Integer Private GroupToDelete As Integer = Nothing Private IsInsert As Boolean = False Dim frmloaded As Boolean = False Private Sub TBDD_DOKUMENTARTBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Save_Dokumentart() End Sub Private Sub SetStatus(Text As String) txtStatus.Caption = Text & " - " & Now.ToShortTimeString End Sub Private Sub ClearStatus() txtStatus.Caption = String.Empty End Sub Private Sub frmAdministration_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try Me.TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBDD_EINGANGSARTENTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBDD_MODULESTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBDD_DOKART_MODULETableAdapter.Connection.ConnectionString = MyConnectionString TBDD_INDEX_MANTableAdapter.Connection.ConnectionString = MyConnectionString TBDD_INDEX_AUTOMTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBDD_USERTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBGI_CONFIGURATIONTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBGI_OBJECTTYPE_EMAIL_INDEXTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBDD_INDEX_MAN_POSTPROCESSINGTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBWHDD_INDEX_MANTableAdapter.Connection.ConnectionString = MyConnectionString Me.VWGI_USER_GROUPS_RELATIONTableAdapter.Connection.ConnectionString = MyConnectionString Me.TBGI_REGEX_DOCTYPETableAdapter.Connection.ConnectionString = MyConnectionString Catch ex As Exception MsgBox("Error in load Connection-Strings - Check Database Connection - Form will be closed: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) Me.Close() End Try Dim oDragDropManager As New ClassDragDrop() oDragDropManager.AddGridView(viewAssignedGroups) oDragDropManager.AddGridView(viewAvailableGroups) RibbonPageCategoryUserGroups.Visible = False RibbonPageCategoryMisc.Visible = False Try Me.TBDD_DOKUMENTARTTableAdapter.Fill(Me.MyDataset.TBDD_DOKUMENTART) Me.TBDD_EINGANGSARTENTableAdapter.Fill(Me.MyDataset.TBDD_EINGANGSARTEN) Me.TBDD_MODULESTableAdapter.Fill(Me.MyDataset.TBDD_MODULES) Catch ex As Exception MsgBox("Error in frmAdministration_Load: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try If GI_withWindream = True Then If ClassWindream.Init() = True Then End If End If End Sub Private Sub ObjektTypenEintragen() Try pnlObjekttype_Config.Enabled = False Dim oDokumentTyp As WINDREAMLib.WMObject ' Combobox leeren Me.OBJEKTTYPComboBox.Items.Clear() ListBoxControl1.Items.Clear() ' alle Objekttypen durchlaufen For Each oDokumentTyp In ClassWindream.GetObjecttypesAsObjects ' und in die Combobox eintragen Me.OBJEKTTYPComboBox.Items.Add(oDokumentTyp.aName) ListBoxControl1.Items.Add(oDokumentTyp.aName) Next pnlObjekttype_Config.Enabled = True Catch ex As Exception MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Unexpected error inm Eintragen der Objekttypen") End Try End Sub Sub Load_Dokart() Try Me.TBDD_DOKUMENTARTTableAdapter.FillByModuleGI(Me.MyDataset.TBDD_DOKUMENTART) If MyDataset.TBDD_DOKUMENTART.Rows.Count > 0 Then GridView1.SelectRow(1) enableControls(XtraTabPageProfiles) End If If Me.DOKART_GUIDTextBox.Text <> "" Then Load_TabData() End If Catch ex As Exception MsgBox("Error in Load_Dokart: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try End Sub Sub Load_TabData() If frmloaded = False Then Exit Sub End If Select Case XtraTabControl2.SelectedTabPage.Name Case XtraTabPageManualIndex.Name If DOKART_GUIDTextBox.Text <> "" Then Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) End If Case XtraTabPageManualIndexFunctions.Name Load_PostProcessing(Me.DOKART_GUIDTextBox.Text) Case XtraTabPageAutoIndex.Name Load_INDEXE_AUTO(Me.DOKART_GUIDTextBox.Text) Case XtraTabPageFolderPath.Name Try Dim Dt As DataTable = ClassDatabase.Return_Datatable("select NAME from VWDDINDICES_MAN_AUTO_ACTIVE where DOCTYPE_ID = " & DOKART_GUIDTextBox.Text & " order by NAME") cmbCrFolderIndex.DataSource = Dt cmbCrFolderIndex.DisplayMember = Dt.Columns(0).ColumnName Catch ex As Exception MsgBox("Error in Load Data TabData 4: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try Case XtraTabPageProfileRegex.Name TBGI_REGEX_DOCTYPETableAdapter.Fill(MyDataset.TBGI_REGEX_DOCTYPE, DOKART_GUIDTextBox.Text) End Select End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'First create a FolderBrowserDialog object Dim FolderBrowserDialog1 As New FolderBrowserDialog ' Then use the following code to create the Dialog window ' Change the .SelectedPath property to the default location With FolderBrowserDialog1 If ZIEL_PFADTextBox.Text <> "" Then .SelectedPath = ZIEL_PFADTextBox.Text End If ' Desktop is the root folder in the dialog. '.RootFolder = Environment.SpecialFolder.Desktop ' Prompt the user with a custom message. If USER_LANGUAGE = "de-DE" Then .Description = "Zielordner für Dokumentart wählen:" Else .Description = "Choose destination folder for Documenttype:" End If If .ShowDialog = DialogResult.OK Then Dim Path As String = .SelectedPath ZIEL_PFADTextBox.Text = .SelectedPath End If End With End Sub Sub Save_Dokumentart() Try Try Me.TBDD_DOKUMENTARTBindingSource.EndEdit() Catch ex As Exception If ex.Message.StartsWith("Der interne Datatable") Then Save_Dokumentart() Else MsgBox("Error in EndEdit 1 documenttype: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End If End Try If MyDataset.TBDD_DOKUMENTART.GetChanges Is Nothing = False Then Me.GEANDERTWERTextBox.Text = Environment.UserName Try Me.TBDD_DOKUMENTARTBindingSource.EndEdit() Catch ex As Exception If ex.Message.StartsWith("Der interne Datatable") Then Save_Dokumentart() Else 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) End If End If 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() Dim _temp As String _temp = Me.NAMENKONVENTIONTextBox.Text _Namenkonvention = Me.NAMENKONVENTIONTextBox.Text _aktDokart_Id = DOKART_GUIDTextBox.Text frmNamenkonvention.ShowDialog() Me.NAMENKONVENTIONTextBox.Text = _Namenkonvention If _temp <> NAMENKONVENTIONTextBox.Text Then Save_Dokumentart() End If End Sub 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() gridAssignedGroups.DataSource = ClassDatatables.GetAssignedGroups(CURRENT_DOKART_ID) gridAvailableGroups.DataSource = ClassDatatables.GetAvailableGroups(CURRENT_DOKART_ID) End If End Sub Private Sub TBDD_DOKUMENTARTBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_DOKUMENTARTBindingSource.AddingNew Save_Dokumentart() Try Dim sql = "SELECT COUNT(T.GUID) FROM TBDD_DOKUMENTART T, TBDD_DOKUMENTART_MODULE T1 WHERE T.AKTIV = 1 AND T.GUID = T1.DOKART_ID AND T1.MODULE_ID = 1" Dim DoctypeCount = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True) If DoctypeCount = LICENSE_DOCTYPE_COUNT Then If USER_LANGUAGE = "de-DE" Then MsgBox("Ihre Anzahl von konfigurierbaren Dokuemntarten ist limitiert auf: '" & LICENSE_DOCTYPE_COUNT.ToString & "'. Sie können nun keine Dokumentart hinzufügen!" & vbNewLine & "Bitte kontaktieren Sie Digital Data für weitere Details.", MsgBoxStyle.Information) Else MsgBox("Your amount of configurable documenttypes is limited to " & LICENSE_DOCTYPE_COUNT.ToString & " doctypes. You can not add more doctypes!" & vbNewLine & "Please contact Digital Data for further licensedetails", MsgBoxStyle.Information) End If Exit Sub End If Catch ex As Exception MsgBox("Unexpected error in Add Doctype: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try MyDataset.TBDD_DOKUMENTART.ERSTELLTWERColumn.DefaultValue = Environment.UserName MyDataset.TBDD_DOKUMENTART.OBJEKTTYPColumn.DefaultValue = "" MyDataset.TBDD_DOKUMENTART.NAMENKONVENTIONColumn.DefaultValue = "[%vOFilename]-[%vYY_MM_DD]-[%Version]" IsInsert = True End Sub Private Sub Load_ZuordnungDokart_Module(Dokart As Integer) Try Me.TBDD_DOKART_MODULETableAdapter.Fill(Me.MyDataset.TBDD_DOKART_MODULE, Dokart) Catch ex As System.Exception MsgBox("Error in Load Zuordnung_Dokart: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try End Sub Private Sub btnadd_Click(sender As Object, e As EventArgs) Dim osql = $"EXEC PRDD_CHECK_REL_DOCTYPE_MODULE 'GLOBIX',{DOKART_GUIDTextBox.Text}" ClassDatabase.Execute_non_Query(osql) LoadGlobix_Doctypes() End Sub Private Sub OBJEKTTYPComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles OBJEKTTYPComboBox.SelectedIndexChanged If WINDREAM_DIRECTCheckBox.Checked = True Then load_WDIndices() End If End Sub Sub load_WDIndices() Try If Me.OBJEKTTYPComboBox.SelectedIndex <> -1 Then Me.WD_INDEXComboBox.Items.Clear() Me.WD_INDEXComboBox.Items.Add("") Dim indexe = ClassWindream.GetIndicesByObjecttype(OBJEKTTYPComboBox.Text) If indexe IsNot Nothing Then For Each index As String In indexe Me.WD_INDEXComboBox.Items.Add(index) Next End If End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in load_WDIndices: ") End Try End Sub Sub load_WDIndices2AutoIndizes() Try If Me.OBJEKTTYPComboBox.SelectedIndex <> -1 Then Me.INDEXNAME_AutoIndexCMB.Items.Clear() Dim indexe = ClassWindream.GetIndicesByObjecttype(OBJEKTTYPComboBox.Text) If indexe IsNot Nothing Then For Each index As String In indexe Me.INDEXNAME_AutoIndexCMB.Items.Add(index) Next End If End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in load_WDIndices2AutoIndizes: ") End Try End Sub Private Sub frmAdministration_Shown(sender As Object, e As EventArgs) Handles Me.Shown If DOKART_GUIDTextBox.Text <> "" Then Load_Dokart() 'Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) Load_ZuordnungDokart_Module(DOKART_GUIDTextBox.Text) If SUGGESTIONCheckBox.CheckState = CheckState.Checked Then btnSQLView.Visible = True Else btnSQLView.Visible = False End If Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) End If frmloaded = True TBDD_INDEX_MANBindingNav.Visible = True TBDD_INDEX_MANBindingNav.Visible = True WM_CHECKED_CHANGE() End Sub Private Sub Load_INDEXMAN(ProfileId As Integer) Try Me.TBDD_INDEX_MANTableAdapter.Fill(Me.MyDataset.TBDD_INDEX_MAN, ProfileId) If MyDataset.TBDD_INDEX_MAN.Rows.Count > 0 Then enableControls(XtraTabPageManualIndex) End If ClearStatus() Catch ex As System.Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load IndexeManuell: ") End Try End Sub Private Sub Load_INDEXE_AUTO(ProfileId As Integer) Try Me.TBDD_INDEX_AUTOMTableAdapter.Fill(Me.MyDataset.TBDD_INDEX_AUTOM, ProfileId) If MyDataset.TBDD_INDEX_AUTOM.Rows.Count > 0 Then enableControls(XtraTabPageAutoIndex) End If CheckIndexAutoWD() Catch ex As System.Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load Indexe Auto: ") End Try End Sub Private Sub Load_PostProcessing(ProfileId As Integer) Try Me.TBWHDD_INDEX_MANTableAdapter.Fill(Me.MyDataset.TBWHDD_INDEX_MAN, ProfileId) Me.TBDD_INDEX_MAN_POSTPROCESSINGTableAdapter.Fill(Me.MyDataset.TBDD_INDEX_MAN_POSTPROCESSING, ProfileId) If MyDataset.TBDD_INDEX_MAN_POSTPROCESSING.Rows.Count > 0 Then enableControls(XtraTabPageManualIndexFunctions) End If ClearStatus() Catch ex As System.Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load Postprocessing-Values: ") End Try End Sub Sub CheckIndexAutoWD() If WINDREAM_DIRECTCheckBox.Checked = True Then INDEXNAME_AutoIndexTXT.Visible = False INDEXNAME_AutoIndexCMB.Visible = True load_WDIndices2AutoIndizes() Else INDEXNAME_AutoIndexTXT.Visible = True INDEXNAME_AutoIndexCMB.Visible = False End If End Sub Private Sub TBDD_INDEX_MANBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_INDEX_MANBindingSource.AddingNew Try Save_Dokumentart() IsInsert = True MyDataset.TBDD_INDEX_MAN.ADDED_WHOColumn.DefaultValue = Environment.UserName MyDataset.TBDD_INDEX_MAN.DOK_IDColumn.DefaultValue = Me.DOKART_GUIDTextBox.Text enableControls(XtraTabPageManualIndex) If GI_withWindream = True Then Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Add IndexMan: ") End Try End Sub Private Sub ToolStripButton7_Click(sender As Object, e As EventArgs) Handles ToolStripButton7.Click Save_IndexMan() End Sub Sub Save_IndexMan() Try Me.TBDD_INDEX_MANBindingSource.EndEdit() If MyDataset.TBDD_INDEX_MAN.GetChanges Is Nothing = False Then CHANGED_WHOTextBox.Text = Environment.UserName Me.TBDD_INDEX_MANBindingSource.EndEdit() TBDD_INDEX_MANTableAdapter.Update(MyDataset.TBDD_INDEX_MAN) SetStatus("Index erfolgreich gespeichert!") Else ClearStatus() End If IsInsert = False Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Save Man Index: ") End Try End Sub Sub Save_IndexAuto() Try Me.TBDD_INDEX_AUTOMBindingSource.EndEdit() If MyDataset.TBDD_INDEX_AUTOM.GetChanges Is Nothing = False Then CHANGED_WHOTextBox3.Text = Environment.UserName Me.TBDD_INDEX_AUTOMBindingSource.EndEdit() TBDD_INDEX_AUTOMTableAdapter.Update(MyDataset.TBDD_INDEX_AUTOM) SetStatus("Index erfolgreich gespeichert!") End If IsInsert = False Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Save Auto Index: ") End Try End Sub Private Sub SUGGESTIONCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SUGGESTIONCheckBox.CheckedChanged If frmloaded = True Then If SUGGESTIONCheckBox.CheckState = CheckState.Checked Then btnSQLView.Visible = True MULTISELECTCheckBox.Visible = True VKT_ADD_ITEMCheckbox.Visible = True Else btnSQLView.Visible = False MULTISELECTCheckBox.Visible = False VKT_ADD_ITEMCheckbox.Visible = False 'If (_indexIsVectorField) Then ' VKT_ADD_ITEMCheckbox.Enabled = True 'Else ' VKT_ADD_ITEMCheckbox.Enabled = False 'End If End If End If End Sub Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl1.SelectedPageChanged Dim oSelectedPageName = XtraTabControl1.SelectedTabPage.Name If oSelectedPageName = XtraTabPageProfiles.Name Then RibbonControl1.SelectedPage = RibbonPageStart End If If oSelectedPageName = XtraTabPageUsersGroups.Name Then RibbonPageCategoryUserGroups.Visible = True RibbonControl1.SelectedPage = RibbonPageUserGroups Else RibbonPageCategoryUserGroups.Visible = False End If If oSelectedPageName = XtraTabPageEmail.Name Then RibbonPageCategoryMisc.Visible = True If oSelectedPageName = XtraTabPageEmail.Name Then RibbonControl1.SelectedPage = RibbonPageEmail End If Else RibbonPageCategoryMisc.Visible = False End If Select Case XtraTabControl1.SelectedTabPageIndex Case 0 If DOKART_GUIDTextBox.Text <> "" Then Load_ZuordnungDokart_Module(DOKART_GUIDTextBox.Text) End If Case 2 ObjektTypenListBoxEintragen() End Select End Sub Sub load_WDIndicesemail(Otype As String) Try IDX_EMAIL_DATE_INComboBox.Items.Clear() IDX_EMAIL_FROMComboBox.Items.Clear() IDX_EMAIL_IDComboBox.Items.Clear() IDX_EMAIL_SUBJECTComboBox.Items.Clear() IDX_EMAIL_TOComboBox.Items.Clear() IDX_CHECK_ATTACHMENTComboBox.Items.Clear() Dim indexe = ClassWindream.GetIndicesByObjecttype(Otype) If indexe IsNot Nothing Then For Each index As String In indexe Select Case ClassWindream.GetTypeOfIndexAsIntByName(index) Case 4 'Boolean Me.IDX_CHECK_ATTACHMENTComboBox.Items.Add(index) Case Else Me.IDX_EMAIL_DATE_INComboBox.Items.Add(index) Me.IDX_EMAIL_FROMComboBox.Items.Add(index) Me.IDX_EMAIL_IDComboBox.Items.Add(index) Me.IDX_EMAIL_SUBJECTComboBox.Items.Add(index) Me.IDX_EMAIL_TOComboBox.Items.Add(index) End Select Next End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in load_WDIndicesemail: ") End Try End Sub Private Sub ObjektTypenListBoxEintragen() Try Dim oDokumentTyp As WINDREAMLib.WMObject ' Combobox leeren ListBoxControl1.Items.Clear() ' alle Objekttypen durchlaufen For Each oDokumentTyp In ClassWindream.GetObjecttypesAsObjects ' und in die Combobox eintragen ListBoxControl1.Items.Add(oDokumentTyp.aName) Next Catch ex As Exception MsgBox("Error in ObjektTypenListBoxEintragen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) LOGGER.Info(">> ACHTUNG: Error in ObjektTypenListBoxEintragen - " & ex.Message) End Try End Sub Private Sub btnSQLView_Click(sender As Object, e As EventArgs) Handles btnSQLView.Click Save_IndexMan() 'CURRENT_INDEXMAN = GUIDTextBox1.Text 'frmSQLSuggestion.ShowDialog() Dim oIndexGuid As Integer = GUIDTextBox1.Text Dim oDocTypeGuid As Integer = DOKART_GUIDTextBox.Text Dim oSQLCommand = "" Try 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 = oConnection } If oForm.ShowDialog() = DialogResult.OK Then oSQLCommand = oForm.SQLCommand.Replace("'", "''") Dim oConnectionId = oForm.SQLConnectionId oSQL = $"UPDATE TBDD_INDEX_MAN SET CONNECTION_ID = {oConnectionId},SQL_RESULT = '{oSQLCommand}',CHANGED_WHO = '{Environment.UserName}' WHERE GUID = {oIndexGuid}" ClassDatabase.Execute_non_Query(oSQL, True) End If Catch ex As Exception LOGGER.Error(ex) End Try End Sub Private Sub WINDREAM_DIRECTCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles WINDREAM_DIRECTCheckBox.CheckedChanged WM_CHECKED_CHANGE() End Sub Sub WM_CHECKED_CHANGE() If WINDREAM_DIRECTCheckBox.Checked Then lblObjekttyp.Visible = True lblWDINDEX.Visible = True OBJEKTTYPComboBox.Visible = True WD_INDEXComboBox.Visible = True If ClassWindream.Init() = True Then ObjektTypenEintragen() End If Else lblObjekttyp.Visible = False lblWDINDEX.Visible = False OBJEKTTYPComboBox.Visible = False WD_INDEXComboBox.Visible = False End If End Sub Private Sub LoadIDXEmail(Otype As String) Try Me.TBGI_OBJECTTYPE_EMAIL_INDEXTableAdapter.Fill(Me.MyDataset.TBGI_OBJECTTYPE_EMAIL_INDEX, Otype) Catch ex As System.Exception MsgBox("Error in LoadIDXEmail:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub ListBoxObjekttypen_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBoxControl1.SelectedIndexChanged If ListBoxControl1.SelectedIndex <> -1 Then LoadIDXEmail(ListBoxControl1.SelectedItem) load_WDIndicesemail(ListBoxControl1.SelectedItem) End If End Sub Private Sub btnidxemail_add_Click(sender As Object, e As EventArgs) Me.TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource.AddNew() End Sub Private Sub TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource.AddingNew If ListBoxControl1.SelectedIndex <> -1 Then MyDataset.TBGI_OBJECTTYPE_EMAIL_INDEX.ADDED_WHOColumn.DefaultValue = Environment.UserName MyDataset.TBGI_OBJECTTYPE_EMAIL_INDEX.OBJECTTYPEColumn.DefaultValue = ListBoxControl1.SelectedItem End If End Sub Private Sub XtraTabControl2_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControl2.SelectedPageChanged Load_TabData() End Sub Private Sub ToolStripButton22_Click(sender As Object, e As EventArgs) Handles ToolStripButton22.Click Save_IndexAuto() End Sub Private Sub TBDD_INDEX_AUTOMBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_INDEX_AUTOMBindingSource.AddingNew Try Save_Dokumentart() MyDataset.TBDD_INDEX_AUTOM.ADDED_WHOColumn.DefaultValue = Environment.UserName MyDataset.TBDD_INDEX_AUTOM.DOCTYPE_IDColumn.DefaultValue = Me.DOKART_GUIDTextBox.Text enableControls(XtraTabPageAutoIndex) IsInsert = True Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Add IndexeAuto: ") End Try End Sub Private Sub TBDD_INDEX_AUTOMBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBDD_INDEX_AUTOMBindingSource.CurrentChanged CheckIndexAutoWD() ClearStatus() End Sub Private Sub SQL_ACTIVECheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SQL_ACTIVECheckBox.CheckedChanged If frmloaded = True Then If SQL_ACTIVECheckBox.CheckState = CheckState.Checked Then btnSQLViewAuto.Visible = True lblValue.Visible = False VALUETextBox.Visible = False VALUETextBox.Text = "" lblWindowParameter.Visible = False lbFileparameter.Visible = False btnAddWindowsVariable.Visible = False Else lblValue.Visible = True VALUETextBox.Visible = True VALUETextBox.Text = "" btnSQLViewAuto.Visible = False lblWindowParameter.Visible = True lbFileparameter.Visible = True btnAddWindowsVariable.Visible = True End If If IsInsert = False Then Save_IndexAuto() End If End If End Sub Private Sub btnSQLViewAuto_Click(sender As Object, e As EventArgs) Handles btnSQLViewAuto.Click Save_IndexAuto() CURRENT_DOKART_ID = DOKART_GUIDTextBox.Text CURRENT_INDEXAUTO = GUIDAUTO_INDEXTextbox.Text CURRENT_SQL_CONFIG = "AUTO" 'SQLConfigAutoIndex.ShowDialog() Dim oIndexGuid As Integer = GUIDAUTO_INDEXTextbox.Text Dim oDocTypeGuid As Integer = DOKART_GUIDTextBox.Text Dim oSQLCommand = "" Try Dim oSQL = $"SELECT SQL_RESULT, CONNECTION_ID FROM TBDD_INDEX_AUTOM 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 = oConnection } If oForm.ShowDialog() = DialogResult.OK Then oSQLCommand = oForm.SQLCommand.Replace("'", "''") Dim oConnectionId = oForm.SQLConnectionId oSQL = $"UPDATE TBDD_INDEX_AUTOM SET CONNECTION_ID = {oConnectionId},SQL_RESULT = '{oSQLCommand}',CHANGED_WHO = '{Environment.UserName}' WHERE GUID = {oIndexGuid}" ClassDatabase.Execute_non_Query(oSQL, True) End If Catch ex As Exception LOGGER.Error(ex) End Try End Sub Private Sub TYPEComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TYPEComboBox.SelectedIndexChanged If TYPEComboBox.SelectedIndex <> -1 Then Select Case TYPEComboBox.Text Case "VBREPLACE" If USER_LANGUAGE = "de-DE" Then Text1Label.Text = "Alter Wert:" Text2Label.Text = "Neuer Wert:" Else Text1Label.Text = "Old Value:" Text2Label.Text = "New Value:" End If Me.TEXT1TextBox.Visible = True TEXT1TextBox.Width = 165 Me.TEXT2TextBox.Visible = True Me.TEXT2TextBox.Width = 191 Me.Text3Label.Visible = False Me.TEXT3TextBox.Visible = False Me.FUNCTION1TextBox.Visible = False Me.FUNCTION2TextBox.Visible = False Me.Function1Label.Visible = False Me.Function2Label.Visible = False Me.Function1Label.Visible = False Me.Function2Label.Visible = False Me.FUNCTION1TextBox.Visible = False Me.FUNCTION2TextBox.Visible = False Case "VBSPLIT" If USER_LANGUAGE = "de-DE" Then Text1Label.Text = "Split-Zeichen:" Text2Label.Text = "Wähle Vorkommen: Achtung Nullbasierend - Erstes Vorkommen = '0'" Else Text1Label.Text = "Split-Character:" Text2Label.Text = "Choose occurrence: 0-Based - First occurrence = '0'" End If Me.FUNCTION1TextBox.Visible = True Me.FUNCTION2TextBox.Visible = True Me.Function1Label.Visible = True Me.Function2Label.Visible = True Me.TEXT1TextBox.Visible = True TEXT1TextBox.Width = 50 Me.TEXT2TextBox.Visible = True Me.TEXT2TextBox.Width = 50 Me.TEXT3TextBox.Visible = False Me.Text3Label.Visible = False Me.Function1Label.Visible = False Me.Function2Label.Visible = False Me.FUNCTION1TextBox.Visible = False Me.FUNCTION2TextBox.Visible = False Case "REG. EXPRESSION" If USER_LANGUAGE = "de-DE" Then Me.Text1Label.Text = "Regulärer Ausdruck:" Else Me.Text1Label.Text = "Regular Expression:" End If Me.TEXT1TextBox.Visible = True TEXT1TextBox.Width = 537 Me.Text2Label.Visible = False Me.TEXT2TextBox.Visible = False Me.Text3Label.Visible = False Me.TEXT3TextBox.Visible = False Me.FUNCTION1TextBox.Visible = False Me.FUNCTION2TextBox.Visible = False Me.Function1Label.Visible = False Me.Function2Label.Visible = False Me.Function1Label.Visible = False Me.Function2Label.Visible = False Me.FUNCTION1TextBox.Visible = False Me.FUNCTION2TextBox.Visible = False End Select End If End Sub Private Sub ToolStripButton30_Click(sender As Object, e As EventArgs) Handles ToolStripButton30.Click Save_PostProcessing() End Sub Sub Save_PostProcessing() Try TBDD_INDEX_MAN_POSTPROCESSINGBindingSource.EndEdit() If MyDataset.TBDD_INDEX_MAN_POSTPROCESSING.GetChanges Is Nothing = False Then CHANGED_WHOTextBox4.Text = Environment.UserName TBDD_INDEX_MAN_POSTPROCESSINGBindingSource.EndEdit() Me.TBDD_INDEX_MAN_POSTPROCESSINGTableAdapter.Update(MyDataset.TBDD_INDEX_MAN_POSTPROCESSING) SetStatus("Funktion erfolgreich gespeichert!") Else ClearStatus() End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Save Post Processing: ") End Try End Sub Private Sub TBDD_INDEX_MAN_POSTPROCESSINGBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_INDEX_MAN_POSTPROCESSINGBindingSource.AddingNew Save_Dokumentart() enableControls(XtraTabPageManualIndexFunctions) MyDataset.TBDD_INDEX_MAN_POSTPROCESSING.ADDED_WHOColumn.DefaultValue = Environment.UserName MyDataset.TBDD_INDEX_MAN_POSTPROCESSING.SEQUENCEColumn.DefaultValue = 1 End Sub Sub enableControls(obj As Object) For Each element In obj.Controls If element.enabled = False Then element.enabled = True End If Next End Sub Private Sub ToolStripButton31_Click(sender As Object, e As EventArgs) Handles ToolStripButton31.Click Load_PostProcessing(Me.DOKART_GUIDTextBox.Text) End Sub Sub LoadGlobix_Doctypes() Load_Dokart() End Sub Private Sub btncrFolder_delete_Click(sender As Object, e As EventArgs) Handles btncrFolder_delete.Click Me.FOLDER_FOR_INDEXTextBox.Text = "" Save_Dokumentart() End Sub Private Sub btnaddcrFolderParameter_Click(sender As Object, e As EventArgs) Handles btnaddcrFolderParameter.Click Dim str As String If (FOLDER_FOR_INDEXTextBox.Text = "") = False Then str = FOLDER_FOR_INDEXTextBox.Text & "\" End If If cmbCrFolderIndex.SelectedIndex <> -1 Then Me.FOLDER_FOR_INDEXTextBox.Text = str & "[%" & cmbCrFolderIndex.Text & "]" cmbCrFolderIndex.SelectedIndex = -1 ElseIf cmbCrFolderDate.SelectedIndex <> -1 Then Me.FOLDER_FOR_INDEXTextBox.Text = str & "[%V_" & cmbCrFolderDate.Text & "]" cmbCrFolderDate.SelectedIndex = -1 ElseIf txtcrFoldermanuell.Text <> "" Then Me.FOLDER_FOR_INDEXTextBox.Text = str & txtcrFoldermanuell.Text txtcrFoldermanuell.Text = "" End If Me.TBDD_DOKUMENTARTTableAdapter.cmdUpdateFolderIndex(Environment.UserName, FOLDER_FOR_INDEXTextBox.Text, DOKART_GUIDTextBox.Text) txtStatus.Caption = $"Profil gespeichert - {Now.ToString}" End Sub Private Sub cmbCrFolderIndex_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCrFolderIndex.SelectedIndexChanged cmbCrFolderDate.SelectedIndex = -1 txtcrFoldermanuell.Text = "" End Sub Private Sub cmbCrFolderDate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCrFolderDate.SelectedIndexChanged cmbCrFolderIndex.SelectedIndex = -1 txtcrFoldermanuell.Text = "" End Sub Private Sub txtcrFoldermanuell_TextChanged(sender As Object, e As EventArgs) Handles txtcrFoldermanuell.TextChanged cmbCrFolderDate.SelectedIndex = -1 cmbCrFolderIndex.SelectedIndex = -1 End Sub Private Sub XtraTabControl2_SelectedPageChanging(sender As Object, e As DevExpress.XtraTab.TabPageChangingEventArgs) Handles XtraTabControl2.SelectedPageChanging Save_Dokumentart() End Sub Private Sub TBDD_USERBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_USERBindingSource.AddingNew MyDataset.TBDD_USER.ADDED_WHOColumn.DefaultValue = Environment.UserName enableControls(XtraTabPageUsersGroups) End Sub Private Sub btnAddWindowsVariable_Click(sender As Object, e As EventArgs) Handles btnAddWindowsVariable.Click If Not lbFileparameter.SelectedItem Is Nothing Then If GUIDAUTO_INDEXTextbox.Text <> "" Then Dim value As String Select Case lbFileparameter.SelectedIndex Case 0 : value = "$filename_ext" Case 1 : value = "$filename" Case 2 : value = "$extension" Case 3 : value = "$FileCreateDate" Case 4 : value = "$FileCreatedWho" Case 5 : value = "$DateDDMMYYY" Case 6 : value = "$Username" Case 7 : value = "$Usercode" End Select 'Select Case lbFileparameter.SelectedItem.ToString.ToUpper ' Case "Dateiname (mit Endung)".ToUpper ' value = "$filename_ext" ' Case "Dateiname (ohne Endung)".ToUpper ' value = "$filename" ' Case "Dateiendung".ToUpper ' value = "$extension" ' Case "Datei Erstelldatum".ToUpper ' value = "$FileCreateDate" ' Case "Datei Erstellt wer".ToUpper ' value = "$FileCreatedWho" ' Case "Aktuelles Datum (DD.MM.YYYY)".ToUpper ' value = "$DateDDMMYYY" ' Case "Username" ' value = "$Username" ' Case "Usercode" ' value = "$Usercode" 'End Select If value <> "" Then VALUETextBox.Text = value Save_IndexAuto() End If Else If USER_LANGUAGE = "de-DE" Then MsgBox("Bitte fügen Sie zuerst einen neuen Index hinzu!", MsgBoxStyle.Information) Else MsgBox("Please add a new index first!", MsgBoxStyle.Information) End If End If End If End Sub Private Sub ToolStripButton41_Click(sender As Object, e As EventArgs) Handles ToolStripButton41.Click Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) End Sub Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click If GUIDTextBox1.Text <> "" Then Try Dim del = "DELETE FROM TBDD_INDEX_MAN_POSTPROCESSING WHERE IDXMAN_ID = " & GUIDTextBox1.Text If ClassDatabase.Execute_non_Query(del) = True Then del = "DELETE FROM TBDD_INDEX_MAN WHERE GUID = " & GUIDTextBox1.Text If ClassDatabase.Execute_non_Query(del) = True Then Load_INDEXMAN(Me.DOKART_GUIDTextBox.Text) End If End If Catch ex As Exception MsgBox("Unexpected Error in deleting manual index: " & ex.Message, MsgBoxStyle.Critical) End Try End If End Sub Private Sub tsbtnRefreshAutomatic_Click(sender As Object, e As EventArgs) Handles tsbtnRefreshAutomatic.Click Load_INDEXE_AUTO(Me.DOKART_GUIDTextBox.Text) End Sub Private _indexIsVectorField As Boolean = False Private Sub WD_INDEXComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles WD_INDEXComboBox.SelectedIndexChanged _indexIsVectorField = indexIsVectorField() MULTISELECTCheckBox.Visible = _indexIsVectorField VKT_PREVENT_MULTIPLE_VALUESCheckbox.Visible = _indexIsVectorField If Not _indexIsVectorField Then MULTISELECTCheckBox.Checked = False VKT_PREVENT_MULTIPLE_VALUESCheckbox.Checked = False End If End Sub Private Function indexIsVectorField() As Boolean Try Dim selectedIndexName As String = WD_INDEXComboBox.Text If selectedIndexName = String.Empty Then Return False End If ' Vektorindexe fangen bei 4000 an Return ClassWindream.GetTypeOfIndexAsIntByName(selectedIndexName) > 4000 Catch ex As Exception Return False End Try End Function Private Sub TBGI_REGEX_DOCTYPEBindingSource_AddingNew(sender As Object, e As AddingNewEventArgs) Handles TBGI_REGEX_DOCTYPEBindingSource.AddingNew MyDataset.TBGI_REGEX_DOCTYPE.ADDED_WHOColumn.DefaultValue = Environment.UserName End Sub Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick frmSQL_Admin.ShowDialog() End Sub Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick frmLicense.ShowDialog() End Sub Private Sub gridAssignedGroups_DragDrop(sender As Object, e As DragEventArgs) Handles gridAssignedGroups.DragDrop Try Dim data As String = e.Data.GetData(DataFormats.Text) Dim groupId As Integer = data.Split("|")(0) Dim profileId As Integer = DOKART_GUIDTextBox.Text ClassDatatables.AddGroupToProfile(groupId, profileId) gridAssignedGroups.DataSource = ClassDatatables.GetAssignedGroups(profileId) gridAvailableGroups.DataSource = ClassDatatables.GetAvailableGroups(profileId) Catch ex As Exception LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:") End Try End Sub Private Sub gridAvailableGroups_DragDrop(sender As Object, e As DragEventArgs) Handles gridAvailableGroups.DragDrop Try Dim data As String = e.Data.GetData(DataFormats.Text) Dim groupId As Integer = data.Split("|")(0) Dim profileId As Integer = DOKART_GUIDTextBox.Text ClassDatatables.RemoveGroupFromProfile(groupId, profileId) gridAssignedGroups.DataSource = ClassDatatables.GetAssignedGroups(profileId) gridAvailableGroups.DataSource = ClassDatatables.GetAvailableGroups(profileId) Catch ex As Exception LOGGER.Error(ex) MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:") End Try End Sub Private Sub BarButtonItem4_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem4.ItemClick Dim result As MsgBoxResult If USER_LANGUAGE = "de-DE" Then result = MessageBox.Show("Sind Sie sicher dass Sie diese Dokumentart löschen wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Else result = MessageBox.Show("Are you sure you want to delete this documenttype", "Confirmation needed:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) End If If result = MsgBoxResult.Yes Then Try Dim del As String = " EXEC PRDD_GLOBIX_DELETE_DOCTYPE " & DOKART_GUIDTextBox.Text If ClassDatabase.Execute_non_Query(del, True) = True Then Load_Dokart() If USER_LANGUAGE = "de-DE" Then MsgBox("Die Dokumentart wurde erfolgreich gelöscht!", MsgBoxStyle.Information) Else MsgBox("Documenttype successfully deleted!", MsgBoxStyle.Information) End If End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Delete DocType: ") End Try End If End Sub Private Sub BarButtonItem8_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem8.ItemClick Dim result As MsgBoxResult If USER_LANGUAGE = "de-DE" Then result = MessageBox.Show("Sind Sie sicher dass Sie dieses Profil kopieren wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Else result = MessageBox.Show("Are you sure you want to copy this profile", "Confirmation needed:", MessageBoxButtons.YesNo, MessageBoxIcon.Question) End If If result = MsgBoxResult.Yes Then Try Dim oGlobixId = ClassDatabase.Execute_Scalar("SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'GLOBIX'", MyConnectionString) Dim copy = "exec PRDD_COPY_DOKPROFILE " & DOKART_GUIDTextBox.Text & ", " & oGlobixId If ClassDatabase.Execute_non_Query(copy, True) Then If USER_LANGUAGE = "de-DE" Then MsgBox("Das Profil wurde erfolgreich kopiert und auf INAKTIV gesetzt." & vbNewLine & "Bitte beachten Sie:" & vbNewLine & "- Das Profil wurde keiner Usergruppe zugeordnet.", MsgBoxStyle.Information) Else MsgBox("Profile was copied successfully and set to INACTIVE." & vbNewLine & "Please note:" & vbNewLine & "- Profile was not assigned to a usergroup", MsgBoxStyle.Information) End If Load_Dokart() End If Catch ex As Exception MsgBox("Error in Copy Doctype:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End If End Sub Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick LoadGlobix_Doctypes() End Sub Private Sub BarButtonItem5_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem5.ItemClick Save_Dokumentart() End Sub Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick TBDD_DOKUMENTARTBindingSource.AddNew() End Sub Private Sub BarButtonItem9_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem9.ItemClick Me.TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource.AddNew() End Sub Private Sub BarButtonItem10_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem10.ItemClick Try Me.TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource.EndEdit() If MyDataset.TBGI_OBJECTTYPE_EMAIL_INDEX.GetChanges Is Nothing = False Then CHANGED_WHOTextBox2.Text = Environment.UserName TBGI_OBJECTTYPE_EMAIL_INDEXBindingSource.EndEdit() TBGI_OBJECTTYPE_EMAIL_INDEXTableAdapter.Update(MyDataset.TBGI_OBJECTTYPE_EMAIL_INDEX) End If Catch ex As Exception MsgBox("Error in Save Index-Email:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub BarButtonItem11_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem11.ItemClick MsgBox("TODO: Implement", MsgBoxStyle.OkCancel Or MsgBoxStyle.Exclamation) End Sub Private Sub BarButtonItem13_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) TBGI_REGEX_DOCTYPEBindingSource.AddNew() End Sub Private Sub BarButtonItem15_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem15.ItemClick frmConnections.ShowDialog() End Sub Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click Try If Regex.IsMatch(TextBox1.Text, TextBox5.Text) Then MsgBox("The RegEx resulted in a proper match!", MsgBoxStyle.Information, "Perfect:") Else MsgBox("No Match- There might be an error in the RegEx!", MsgBoxStyle.Information, "Something wrong:") End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Testing Regex: ") End Try End Sub Private Sub ToolStripButton9_Click(sender As Object, e As EventArgs) Try Dim oSQL = $"DELETE FROM TBGI_REGEX_DOCTYPE WHERE GUID = {TextBox3.Text}" If ClassDatabase.Execute_non_Query(oSQL, True) = True Then Me.TBGI_REGEX_DOCTYPETableAdapter.Fill(Me.MyDataset.TBGI_REGEX_DOCTYPE, DOKART_GUIDTextBox.Text) End If Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Deleting Regex:") End Try End Sub Private Sub ToolStripButton10_Click(sender As Object, e As EventArgs) Handles ToolStripButton10.Click Try Me.TBGI_REGEX_DOCTYPEBindingSource.EndEdit() Catch ex As Exception MsgBox("Error in Save Regex1: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) Exit Sub End Try If MyDataset.TBGI_REGEX_DOCTYPE.GetChanges Is Nothing = False Then TextBox4.Text = Environment.UserName Try Me.TBGI_REGEX_DOCTYPEBindingSource.EndEdit() Catch ex As Exception MsgBox("Error in Save Regex2: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation) End Try TBGI_REGEX_DOCTYPETableAdapter.Update(MyDataset.TBGI_REGEX_DOCTYPE) End If End Sub End Class