Imports System.IO Imports Oracle.ManagedDataAccess.Client Imports DigitalData.Modules.Logging Imports System.Data.Odbc Public Class frmNIProfileigenschaften Public Shared _windream As ClassWindream_allgemein Private _MyLogger As LogConfig Private Shared _Logger As DigitalData.Modules.Logging.Logger ' entspricht dem, über die Toolbar-Combobox ausgewählten, Profil und enthält alle relevanten Informationen darüber Private _selectedProfile As ClassNIProfil Dim _pos As Integer Dim arrProfile(1, 1) As Object Dim Prof_Anzahl As Integer ' verhindert (wenn True) das _selectedProfile auf Nothing gesetzt wird, wenn das Panel auf visible = True gesetzt wird Private _flagIgnoreVisibilityChanged As Boolean = False Private Shared _Instance As frmNIProfileigenschaften = Nothing Private licenseManager As ClassLicenseManager = Nothing Private INDEX_LIST As New List(Of String) Private selectedProfile As ClassNIProfil Public Shared Function Instance() As frmNIProfileigenschaften If _Instance Is Nothing OrElse _Instance.IsDisposed = True Then _Instance = New frmNIProfileigenschaften End If _Instance.BringToFront() Return _Instance End Function ''' ''' Konstruktor des Panels. Laden der Profilnamen in die Auswahliste. ''' ''' Sub New() ' Dieser Aufruf ist für den Windows Form-Designer erforderlich. InitializeComponent() _MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log")) _Logger = _MyLogger.GetLogger() _windream = New ClassWindream_allgemein(_MyLogger) ' alle Profile in die Toolbar-Combobox eintragen Me.LoadProfilesInCombobox() Try Me.licenseManager = New ClassLicenseManager("#DigitalData9731258!#", My.Settings.licensekey) Me.licenseManager.licenseString = Me.licenseManager.DecodeLicenseKey(My.Settings.licensekey) Me.licenseManager.licenseStringArray = Me.licenseManager.SplitLicenseString(Me.licenseManager.licenseString) Me.licenseManager.LoadLicenses() Catch ex As Exception MsgBox("Fehler beim Laden der Lizenzen:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub Public Sub ReDimEx(ByRef MyArray As Object, ByVal iDimX As Integer, ByVal iDimY As Integer) Dim MyTempArray As Object Dim I As Integer Dim J As Integer MyTempArray = MyArray ReDim MyArray(iDimX, iDimY) For I = LBound(MyTempArray, 1) To UBound(MyTempArray, 1) For J = LBound(MyTempArray, 2) To UBound(MyTempArray, 2) If I <= iDimX And J <= iDimY Then MyArray(I, J) = MyTempArray(I, J) End If Next J Next I End Sub ' ++++++++++++++++++++++++++++++++++++++++++++++ Methoden ++++++++++++++++++++++++++++++++++++++++++++++ ''' ''' Schreibt die Profile in die Combobox in der Toolbar. ''' ''' Private Sub LoadProfilesInCombobox() 'Try ClassNIProfile.Init() Me.cmbProfilauswahl.DropDownItems.Clear() If ClassNIProfile.Profile IsNot Nothing Then Dim anz As Integer = 0 For Each item As ClassNIProfil In ClassNIProfile.Profile Me.cmbProfilauswahl.DropDownItems.Add(item.Profilname) ReDimEx(arrProfile, anz, 1) arrProfile(anz, 0) = item.Profilname arrProfile(anz, 1) = anz anz = anz + 1 Next Prof_Anzahl = anz Me.tslblAnzahl.Text = "Anzahl Profile: " & anz End If 'Catch ex As Exception ' MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der Profile in die Auswahlliste") 'End Try End Sub ''' ''' Wenn Änderungen am Profil vorgenommen wurden, wird gefragt ob das Profil gespeichert werden soll. ''' Yes : Profil wird gespeichert und anschließend wird das Hauptpanel geschlossen ''' No : das Hauptpanel wird geschlossen (ohne Speichern) ''' Cancel : das Schließen des Hauptpanels wird verhindert (das Profil bleibt erhalten) ''' ''' Gibt False zurück, wenn die Aktion abgebrochen wurde, sonst True. ''' Private Sub frmNIProfileigenschaften_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If Check_Aenderung() = "Abbruch" Then e.Cancel = True End If End Sub Private Function Check_Aenderung() '#### ' wenn ein Profil gewählt ist If Me._selectedProfile IsNot Nothing Then 'If Me._selectedProfile.IndexValidation = "" Then ' MsgBox("Bitte bestimmen Sie einen Index für die Markierung dieses Dokumentes im Fall: " & vbNewLine & "- Validierung/Überprüfung des Dokumentes notwendig " & vbNewLine & "- Nachindexierung fehlerhaft", MsgBoxStyle.Exclamation, "Fehlende Konfiguration:") ' Return "Abbruch" 'End If ' wenn es Änderungen am Profil gibt If Me._selectedProfile.HasChanges Then 'If Me._selectedProfile.DbArt = "xml" Then ' If Me._selectedProfile.vSQL_Anweisung = "" Then ' MsgBox("Bitte bestimmen Sie einen Index für Markierung: Validierung des Dokumentes - Nachindexierung fehlerhaft", MsgBoxStyle.Exclamation, "Fehlende Konfiguration:") ' Return "Abbruch" ' End If 'End If Dim result As MsgBoxResult = MsgBox("Möchten Sie Ihre Änderungen vor dem Schließen/Wechseln speichern?", MsgBoxStyle.YesNoCancel, "Änderungen übernehmen") If result = MsgBoxResult.Yes Then ' wenn die Daten gespeichert werden sollen ' die Änderungen speichern If Me._selectedProfile.Save(True, "profile") = True Then ' wenn das Speichern erfolgreich war ' die Profile neu in die Combobox der Toolbar laden (für den Fall das Profilname geändert wurde) Me.LoadProfilesInCombobox() Me.pnlProfileigenschaften.Visible = False ' die Profileigenschaften auf diesem Panel ausblenden ' den Speichern-Button deaktivieren Me.btnSpeichern.Enabled = False ' den Löschen-Button deaktivieren Me.btnLöschen.Enabled = False ' kein _selectedProfile wählen Me._selectedProfile = Nothing Return "Gespeichert" End If ElseIf result = MsgBoxResult.No Then ' wenn die Daten verworfen werden sollen ' wenn ein Profil selektiert ist: den originalen Profilnamen setzen If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.SetBackToOriginal() Me.pnlProfileigenschaften.Visible = False ' den Speichern-Button deaktivieren Me.btnSpeichern.Enabled = False ' den Löschen-Button deaktivieren Me.btnLöschen.Enabled = False ' kein _selectedProfile wählen Return "Nein" ElseIf result = MsgBoxResult.Cancel Then ' wenn die Aktion abgebrochen werden soll ' die nachfolgende Aktion (das Schließen aller Fenster und das Öffnen des neuen) wird verhindert Return "Abbruch" End If Else ' wenn keine Änderungen gemacht wurden Return "keineAenderung" ' wenn ein Profil selektiert ist: den originalen Profilnamen setzen If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.SetBackToOriginal() Me.pnlProfileigenschaften.Visible = False ' den Speichern-Button deaktivieren Me.btnSpeichern.Enabled = False ' den Löschen-Button deaktivieren Me.btnLöschen.Enabled = False End If End If 'Catch ex As Exception ' MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Überprüfen auf Änderungen an Profilen:") 'End Try End Function ' +++ Anzeige-Events +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ' +++ Formular-Events +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Private Sub btnWindreamsuche_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWindreamsuche.Click If Not Me.txtWindreamsuche.Text = "" Then Me.OFDWindreamsuche.FileName = Me.txtWindreamsuche.Text End If If Me.OFDWindreamsuche.ShowDialog = Windows.Forms.DialogResult.OK Then Me.txtWindreamsuche.Text = Me.OFDWindreamsuche.FileName End If End Sub Private Sub btnopenSuche_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnopenSuche.Click Try Dim p As New Process() p.StartInfo.FileName = Me.txtWindreamsuche.Text p.StartInfo.WindowStyle = ProcessWindowStyle.Normal p.Start() p.WaitForExit() p.Close() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei öffnen der windream-Suche:") End Try End Sub Private Sub txtWindreamsuche_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWindreamsuche.TextChanged If Not Me.txtWindreamsuche.Text = "" Then If txtWindreamsuche.Text.Contains("select") = False Then Me.btnopenSuche.Enabled = True End If Else Me.btnopenSuche.Enabled = False End If If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.WindreamSuche = Me.txtWindreamsuche.Text If Not Me.txtWindreamsuche.Text = Me._selectedProfile.OriginalWindreamSuche Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If 'If txtWindreamsuche.Text.Contains("select") Then ' txtWindreamsuche.ReadOnly = False 'Else ' txtWindreamsuche.ReadOnly = True 'End If End Sub Sub Lade_Profil(ByVal name As String) ' den Löschen-Button aktivieren Me.btnLöschen.Enabled = True Try ' das ausgewählte Profil in _selectedProfile laden Me._selectedProfile = ClassNIProfile.getProfilByName(name) ' wenn das selektierte Profil gefunden wurde If Me._selectedProfile IsNot Nothing Then Me.pnlProfileigenschaften.Visible = True Me.lblSave.Visible = False ' die Steuerelemente für die Profilinformationen mit den Daten füllen Me.txtProfilname.Text = Me._selectedProfile.Profilname Me.lblProfil.Text = "Gewähltes Profil: '" & Me._selectedProfile.Profilname & "'" Me.txtWindreamsuche.Text = Me._selectedProfile.WindreamSuche Me.lblOrdnerRechte.Visible = False If Me._selectedProfile.Dokumenttyp IsNot Nothing Then Me.txtObjekttyp.ForeColor = Drawing.Color.Black Me.txtObjekttyp.Text = Me._selectedProfile.Dokumenttyp.aName ' den Dokumenttyp eintragen Else Me.txtObjekttyp.ForeColor = Drawing.Color.Red Me.txtObjekttyp.Text = Me._selectedProfile.DokumenttypString ' den Dokumenttyp eintragen End If If CBool(Me._selectedProfile.Aktiv) = True Then Me.chkbxAktiv.Checked = True Me.chkbxAktiv.BackColor = Color.GreenYellow Else Me.chkbxAktiv.Checked = False Me.chkbxAktiv.BackColor = Color.Transparent End If Me.cmbIndexValidierung.Items.Clear() Me.cmbIndexFehler.Items.Clear() Me.cmbCrFolderIndex.Items.Clear() 'cmbMOREDokumentart.Items.Clear() 'cmbMoReKundenindex.Items.Clear() 'Dim indexe1 = _windream.GetIndicesByObjecttype(Me._selectedProfile.Dokumenttyp.aName) '_windream.GetIndices(Me._selectedProfile.Dokumenttyp.aName) Dim indexe = _windream.GetIndicesByObjecttype(Me._selectedProfile.Dokumenttyp.aName, True, "NI") If indexe IsNot Nothing Then Me.cmbIndexFehler.Items.Add("") Me.cmbIndexValidierung.Items.Add("") 'cmbMOREDokumentart.Items.Add("") 'cmbMoReKundenindex.Items.Add("") 'cmbMoReKundenindex.Items.Add("Standard-VZ") For Each index As String In indexe Select Case _windream.GetTypeOfIndexAsIntByName(index) Case 4 Me.cmbIndexValidierung.Items.Add(index) Me.cmbIndexFehler.Items.Add(index) Case 1 Me.cmbCrFolderIndex.Items.Add(index) INDEX_LIST.Add(index) 'cmbMOREDokumentart.Items.Add(index) 'cmbMoReKundenindex.Items.Add(index) Case 2 Me.cmbCrFolderIndex.Items.Add(index) INDEX_LIST.Add(index) 'cmbMOREDokumentart.Items.Add(index) 'cmbMoReKundenindex.Items.Add(index) Case 5 Me.cmbCrFolderIndex.Items.Add(index) INDEX_LIST.Add(index) 'cmbMOREDokumentart.Items.Add(index) 'cmbMoReKundenindex.Items.Add(index) 'Case Else 'MsgBox(_windream.GetTypeOfIndexAsIntByName(index) & vbNewLine & index) End Select Next 'Me.cmbIndexValidierung.SelectedIndex = -1 'Me.cmbIndexValidierung.SelectedItem = 0 'Me.cmbIndexFehler.SelectedIndex = -1 'Me.cmbIndexFehler.SelectedItem = 0 'Me.cmbCrFolderIndex.SelectedIndex = -1 'Me.cmbCrFolderIndex.SelectedValue = 0 End If 'If Me._selectedProfile.MR_DAIndex <> "" Then ' Me.cmbMOREDokumentart.SelectedIndex = Me.cmbMOREDokumentart.FindStringExact(Me._selectedProfile.MR_DAIndex) 'Else ' Me.cmbMOREDokumentart.SelectedIndex = 0 'End If 'If Me._selectedProfile.MR_KDIndex <> "" Then ' Me.cmbMoReKundenindex.SelectedIndex = Me.cmbMoReKundenindex.FindStringExact(Me._selectedProfile.MR_KDIndex) 'Else ' Me.cmbMoReKundenindex.SelectedIndex = 0 'End If If Me._selectedProfile.IndexValidation <> "" Then 'Wenn bereits ein Index gewählt wurde Me.cmbIndexValidierung.SelectedIndex = Me.cmbIndexValidierung.FindStringExact(Me._selectedProfile.IndexValidation) Else 'Wenn noch KEIN Index gewählt wurde Me.cmbIndexValidierung.SelectedIndex = -1 Me.cmbIndexValidierung.SelectedItem = "" End If If Me._selectedProfile.IndexFehler <> "" Then 'Wenn bereits ein Index gewählt wurde Me.cmbIndexFehler.SelectedIndex = Me.cmbIndexFehler.FindStringExact(Me._selectedProfile.IndexFehler) Else 'Wenn noch KEIN Index gewählt wurde Me.cmbIndexFehler.SelectedIndex = -1 Me.cmbIndexFehler.SelectedItem = "" End If 'NACHBEARBEITUNGSFUNKTION CREATE FOLDER If Me._selectedProfile.CrFolderIndex <> "" Then 'Wenn bereits ein Index gewählt wurde ' Me.cmbCrFolderIndex.SelectedIndex = Me.cmbCrFolderIndex.FindStringExact(Me._selectedProfile.CrFolderIndex) Me.txtCrFolderIndex.Text = Me._selectedProfile.CrFolderIndex Else 'Wenn noch KEIN Index gewählt wurde Me.cmbCrFolderIndex.SelectedItem = "" Me.txtCrFolderIndex.Text = "" End If Me.txtNBCrFolder.Text = Me._selectedProfile.CrFolder_Folder If CBool(Me._selectedProfile.CrFolder_Move) = True Then Me.chkcrfold_move.Checked = True Me.chkcrfold_move.BackColor = Color.GreenYellow Else Me.chkcrfold_move.Checked = False Me.chkcrfold_move.BackColor = Color.Transparent End If 'Move 2 Folder - Einfaches Verschieben in Ordner Me.txtMovetoFolder.Text = Me._selectedProfile.move2Folder Me.txtlastRun.Text = Me._selectedProfile.LastRun If CBool(Me._selectedProfile.NachbearbeitungAD) = True Then Me.chkbxAD.Checked = True Me.chkbxAD.BackColor = Color.GreenYellow Else Me.chkbxAD.Checked = False Me.chkbxAD.BackColor = Color.Transparent End If Me.CheckBoxwin_aut.Visible = False Select Case Me._selectedProfile.Ni_Art Case "xml" grbxLDAP.Visible = False Me.gbxDatenbank.Visible = True 'Nachindexierung über Datei Me.gbxDatei.Visible = True ListView1.Visible = True grbxVolltext.Visible = False Me.rbxls.Checked = False Me.rbxls.Enabled = False Me.rbxml.Checked = True Me.cmbEndung_xml.SelectedItem = Me._selectedProfile.xmlEnd If CBool(Me._selectedProfile.delete) = True Then Me.chkbxdelete.Checked = True Else Me.chkbxdelete.Checked = False End If Case "db" grbxLDAP.Visible = False grbxVolltext.Visible = False Me.gbxDatenbank.Visible = True Me.gbxDatei.Visible = False ListView1.Visible = False Case "fulltext" grbxLDAP.Visible = False grbxVolltext.Location = New Point(6, 6) grbxVolltext.Size = New Size(870, 355) grbxVolltext.Visible = True Me.gbxDatei.Visible = False Me.gbxDatenbank.Visible = False ListView1.Visible = False If Me._selectedProfile.Desk_windreamIndex <> "" Then 'Wenn bereits ein Index gewählt wurde txtIndex_Volltext.Text = Me._selectedProfile.Desk_windreamIndex End If Case "activedirectory" grbxVolltext.Visible = False Me.gbxDatei.Visible = False Me.gbxDatenbank.Visible = False grbxLDAP.Visible = True grbxLDAP.Dock = DockStyle.Fill Me.txtLDAP_Domaene.Text = _selectedProfile.DataSource If txtLDAP_Domaene.Text = "" Then Me.txtLDAP_Domaene.Text = "LDAP://" & Environment.UserDomainName & ".local" End If If _selectedProfile.Password <> "" And _selectedProfile.UserId <> "" Then Me.chkbxUserIdent.Checked = False Me.txtLDAP_User.Text = _selectedProfile.UserId licenseManager = New ClassLicenseManager("#DigitalData9731258!#") Dim PWDecode As String = licenseManager.DecodeLicenseKey(_selectedProfile.Password) Me.txtLDAP_PW.Text = PWDecode Else Me.chkbxUserIdent.Checked = True End If Case "nurOrdnerRechte" Me.lblOrdnerRechte.Visible = True Case "nur-ordner-indizes" Me.lblOrdnerRechte.Visible = True End Select 'Datenbank Angaben laden Me.cmbDbArt.SelectedItem = Me._selectedProfile.DbArt Me.txtDataSource2.Text = _selectedProfile.InitialCatalog Me.txtDataSource1.Text = Me._selectedProfile.DataSource Me.txtUserId.Text = Me._selectedProfile.UserId Me.txtPassword.Text = Me._selectedProfile.Password Select Case _selectedProfile.DbArt Case "Oracle" Me.lblDataSource.Text = "IP Oracle-Server:" Me.txtDataSource1.Width = 172 Me.txtDataSource1.ReadOnly = False Me.txtDataSource1.BackColor = System.Drawing.SystemColors.Window Me.txtDataSource1.Text = Me._selectedProfile.OriginalDataSource Me.btnMdbLocation.Visible = False Me.btnMdbLöschen.Visible = False Me.lblDSN.Visible = False Me.lblUserId.Text = "UserId:" Me.lblPassword.Text = "Passwort:" Me.lblInitialCatalog.Visible = True Me.lblInitialCatalog.Text = "Servicename:" Me.txtDataSource2.Visible = True Case "MS-SQL" Me.CheckBoxwin_aut.Visible = True End Select If Me._selectedProfile.DbArt = "MS-SQL" Or Me._selectedProfile.DbArt = "Oracle" Then Me.txtDataSource2.Visible = True Me.txtDataSource2.Text = Me._selectedProfile.InitialCatalog If txtDataSource2.Text <> "" Then Me.chkOR_ohne_TNS.Checked = True If Me._selectedProfile.UserId = "WINAUTH" Then Me.CheckBoxwin_aut.Checked = True Else Me.CheckBoxwin_aut.Checked = False End If Else Me.txtDataSource2.Visible = False End If If Me._selectedProfile.GetOrdnerTypes = True Then Me.chkbxGetOrdnerRechte.Checked = True OrdnerTypenEintragen() Me.cmbOrdnertyp.SelectedIndex = cmbOrdnertyp.FindStringExact(Me._selectedProfile.OrdnerType) Me.cmbOrdnertyp_Ebene.SelectedIndex = cmbOrdnertyp_Ebene.FindStringExact(Me._selectedProfile.OrdnerType_Ebene) Else Me.chkbxGetOrdnerRechte.Checked = False End If ' Das Profil auf gespeichert setzen, da ja keine Änderungen am Profil selbst gemacht wurden. Das Profil ' hat jedoch zu diesem Zeitpunkt den Status HasChanges(), da der Inhalt der Steuerelemente verändert wurde. Me._selectedProfile.setSaved() Me._selectedProfile._links.setLinksSaved() btnVerknüpfungen.Visible = True Else btnVerknüpfungen.Visible = False 'Me._selectedProfile.Dokumenttyp End If Catch ex As Exception MsgBox("Fehler bei Laden Profil: " & ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub cmbProfilauswahl_DropDownItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles cmbProfilauswahl.DropDownItemClicked If Me._selectedProfile IsNot Nothing Then Me.cmbIndexValidierung.SelectedIndex = -1 If _selectedProfile.HasChanges Then _selectedProfile.Save(True, "profile") Me.lblSave.Visible = True Else Me.lblSave.Visible = False End If ' wenn es sich bei dem ausgewählten Elementum das gleiche handelt wie das Aktive, dann nichts tun If e.ClickedItem.Text = Me._selectedProfile.Profilname Then Exit Sub End If End If Lade_Profil(e.ClickedItem.Text) For i = 0 To arrProfile.GetUpperBound(0) If arrProfile(i, 0) = e.ClickedItem.Text Then _pos = arrProfile(i, 1) End If Next TabControl1.SelectedIndex = 0 End Sub Private Sub btnHinzufügen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHinzufügen.Click 'frmLogin_NI.ShowDialog() frmNIProfilhinzufuegen.ShowDialog() ' wenn das Formular geschlossen wurde, werden die Profile neu in die Combobox geladen Me.LoadProfilesInCombobox() End Sub Private Sub txtProfilname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtProfilname.TextChanged CURRENT_PROFILENAME = "" If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.Profilname = Me.txtProfilname.Text CURRENT_PROFILENAME = Me._selectedProfile.Profilname If Not Me.txtProfilname.Text = Me._selectedProfile.OriginalProfilname Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub btnSpeichern_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSpeichern.Click Dim originalProfilname As String = Me._selectedProfile.OriginalProfilname ' wenn kein Profil gewählt wurde, soll das Event abgebrochen werden If Me._selectedProfile Is Nothing Then Exit Sub ' wenn Veränderungen am Profil gemacht wurden If Me._selectedProfile.HasChanges Then If Me.txtProfilname.Text = "" Then MsgBox("Es wurde kein Profilname angegeben. Bitte tragen Sie einen in das Feld Profilname ein.", MsgBoxStyle.Information, "Eingabe erwartet") Exit Sub End If If Me.txtWindreamsuche.Text = "" Then MsgBox("Es wurde keine windream-Suche angegeben. Bitte tragen Sie eine in das Feld windream-Speicherort ein.", MsgBoxStyle.Information, "Eingabe erwartet") Exit Sub End If If Me._selectedProfile.Ni_Art = "db" Then If Me.txtDataSource1.Text = "" Then MsgBox("Es wurde keine DataSource angegeben. Bitte tragen Sie eine in das Feld DataSource ein.", MsgBoxStyle.Information, "Eingabe erwartet") Exit Sub End If If Me.cmbDbArt.SelectedItem = "MS-SQL" Then If Me.txtDataSource2.Text = "" Then MsgBox("Es wurde kein InitialCatalog angegeben. Bitte tragen Sie einen Wert in das Feld ein.", MsgBoxStyle.Information, "Eingabe erwartet") End If End If If Me.cmbDbArt.SelectedIndex = -1 Then MsgBox("Es wurde kein Datenbanktyp ausgewählt. Bitte wählen Sie einen Typ aus.", MsgBoxStyle.Information, "Eingabe erwartet") Exit Sub End If End If ' prüfen ob der Profilname geändert wurde If Not Me._selectedProfile.OriginalProfilname = Me.txtProfilname.Text Then ' prüfen ob der eingegebene Profilname schon vorhanden ist If ClassNIProfile.Exists(Me.txtProfilname.Text) Then MsgBox("Der angegebene Profilname existiert bereits. Bitte wählen Sie einen anderen Profilnamen.", MsgBoxStyle.Information, "Ungültige Eingabe") Exit Sub Else ' sonst den neuen Profilnamen vorerst einmal ändern Me._selectedProfile.Profilname = Me.txtProfilname.Text End If End If ' die Änderungen speichern If Me._selectedProfile.Save(False, "profile") = True Then ' wenn das Speichern erfolgreich war Me.lblSave.Visible = True ' den Speichern-Button deaktivieren Me.btnSpeichern.Enabled = False If (Me.cmbIndexValidierung.Text <> "" Or Me.cmbIndexFehler.Text <> "") And Me._selectedProfile.checkIndexsql = "" Then MsgBox("Bitte vergessen Sie nicht einen Überprüfungs-SQL String für den deskriptiven Index in den Verknüpfungen zu hinterlegen: " & vbNewLine & "- Validierung/Überprüfung des Dokumentes notwendig " & vbNewLine & "- Nachindexierung fehlerhaft", MsgBoxStyle.Exclamation, "Konfiguration unvollständig") End If ' die Profile neu in die Combobox der Toolbar laden (für den Fall das Profilname geändert wurde) Me.LoadProfilesInCombobox() Else MsgBox("Das Profil konnte nicht erfolgreich gespeichert werden.", MsgBoxStyle.Exclamation, "Fehler beim Speichern eines Profils") Me.lblSave.Visible = False Me.txtProfilname.Text = originalProfilname Me.txtWindreamsuche.Text = Me._selectedProfile.WindreamSuche Me.cmbDbArt.SelectedItem = Me._selectedProfile.DbArt Me.txtDataSource1.Text = Me._selectedProfile.DataSource Me.txtUserId.Text = Me._selectedProfile.UserId Me.txtPassword.Text = Me._selectedProfile.Password End If End If End Sub Private Sub btnLöschen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLöschen.Click Try ' Fragen ob das Profil wirklich gelöscht werden soll Dim result As MsgBoxResult = MsgBox("Sind Sie sicher, dass sie das Profil '" & Me._selectedProfile.OriginalProfilname & "' löschen möchten?", MsgBoxStyle.YesNo, "Profil löschen") ' wenn das Profil gelöscht werden soll If result = MsgBoxResult.Yes Then ' das Profil löschen If ClassNIProfile.DeleteProfil(Me._selectedProfile.OriginalProfilname) Then Me.pnlProfileigenschaften.Visible = False ' den Speichern-Button deaktivieren Me.btnSpeichern.Enabled = False ' den Löschen-Button deaktivieren Me.btnLöschen.Enabled = False ' kein Profil als selektiert wählen Me._selectedProfile = Nothing Me.lblProfil.Text = "Kein Profil gewählt" ' die Profile neu in die Combobox laden Me.LoadProfilesInCombobox() 'Das erste Profil laden 'Try ' Lade_Profil(Me.cmbProfilauswahl.DropDownItems(0).ToString) 'Catch ex As Exception 'End Try End If End If Catch ex As Exception MsgBox("Fehler in Löschen Profil:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try End Sub Private Sub cmbDbArt_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbDbArt.SelectedIndexChanged If Me.cmbDbArt.SelectedIndex <> -1 Then Me.CheckBoxwin_aut.Visible = False Me.chkOR_ohne_TNS.Visible = False Select Case Me.cmbDbArt.SelectedItem Case "MS-SQL" Me.lblDataSource.Text = "DataSource*:" Me.txtDataSource1.Width = 172 Me.txtDataSource1.ReadOnly = False Me.txtDataSource1.BackColor = System.Drawing.SystemColors.Window Me.txtDataSource1.Text = "" Me.btnMdbLocation.Visible = False Me.btnMdbLöschen.Visible = False Me.lblDSN.Visible = False Me.lblUserId.Text = "UserId:" Me.lblPassword.Text = "Passwort:" Me.lblInitialCatalog.Visible = True Me.lblInitialCatalog.Text = "Initial Catalog*:" Me.txtDataSource2.Visible = True Me.CheckBoxwin_aut.Visible = True Case "ODBC" Me.lblDataSource.Text = "DSN*:" Me.txtDataSource1.Width = 172 Me.txtDataSource1.ReadOnly = False Me.txtDataSource1.BackColor = System.Drawing.SystemColors.Window Me.txtDataSource1.Text = "" Me.btnMdbLocation.Visible = False Me.btnMdbLöschen.Visible = False Me.lblDSN.Visible = True Me.lblUserId.Text = "UserId:" Me.lblPassword.Text = "Passwort:" Me.lblInitialCatalog.Visible = False Me.txtDataSource2.Visible = False Case "Ole (Access)" Me.lblDataSource.Text = ".mdb Datei*:" Me.txtDataSource1.Width = 376 Me.txtDataSource1.ReadOnly = True Me.txtDataSource1.BackColor = System.Drawing.SystemColors.Info Me.txtDataSource1.Text = "" Me.btnMdbLocation.Visible = True Me.btnMdbLöschen.Visible = True Me.lblDSN.Visible = False Me.lblUserId.Text = "UserId:" Me.lblPassword.Text = "Passwort:" Me.lblInitialCatalog.Visible = False Me.txtDataSource2.Visible = False Case "Oracle" Me.lblDataSource.Text = "HOST (IP-Adresse):" Me.txtDataSource1.Width = 172 Me.txtDataSource1.ReadOnly = False Me.txtDataSource1.BackColor = System.Drawing.SystemColors.Window Me.txtDataSource1.Text = "" Me.btnMdbLocation.Visible = False Me.btnMdbLöschen.Visible = False Me.lblDSN.Visible = False Me.lblUserId.Text = "UserId:" Me.lblPassword.Text = "Passwort:" Me.lblInitialCatalog.Visible = True Me.lblInitialCatalog.Text = "Servicename:" Me.txtDataSource2.Visible = True Me.chkOR_ohne_TNS.Visible = True End Select Me.txtDataSource1.Visible = True Me.txtUserId.Visible = True Me.txtPassword.Visible = True Else Me.txtDataSource1.Visible = False Me.txtUserId.Visible = False Me.txtPassword.Visible = False End If If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.DbArt = Me.cmbDbArt.SelectedItem If Not Me._selectedProfile.DbArt = Me._selectedProfile.OriginalDbArt Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False Me.txtDataSource1.Text = Me._selectedProfile.OriginalDataSource End If End If End Sub Private Sub txtDataSource_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDataSource1.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.DataSource = Me.txtDataSource1.Text If Not Me._selectedProfile.DataSource = Me._selectedProfile.OriginalDataSource Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub txtUserId_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtUserId.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.UserId = Me.txtUserId.Text If Not Me._selectedProfile.UserId = Me._selectedProfile.OriginalUserId Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub txtPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPassword.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.Password = Me.txtPassword.Text If Not Me._selectedProfile.Password = Me._selectedProfile.OriginalPassword Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub btnMdbLöschen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMdbLöschen.Click Me.txtDataSource1.Text = "" End Sub Private Sub btnMdbLocation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMdbLocation.Click If Me.dlgMdbLocation.ShowDialog = Windows.Forms.DialogResult.OK Then Me.txtDataSource1.Text = Me.dlgMdbLocation.FileName End If If Not Me._selectedProfile.DataSource = Me._selectedProfile.OriginalDataSource Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End Sub Private Sub txtInitialCatalog_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDataSource2.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.InitialCatalog = Me.txtDataSource2.Text If Not Me._selectedProfile.InitialCatalog = Me._selectedProfile.OriginalInitalCatalog Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub btnVerknüpfungen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVerknüpfungen.Click ClassNIProfile.aktivesProfil = Me._selectedProfile ClassNIProfile.aktivesProfilAusProfileigenschaften = True Cursor = Cursors.WaitCursor Dim frm As New frmNIVerknuepfungen frm = frmNIVerknuepfungen.Instance frm.MdiParent = frmStart frm.Show() frm.BringToFront() Cursor = Cursors.Default End Sub Private Sub chkbxAktiv_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkbxAktiv.CheckedChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.Aktiv = Me.chkbxAktiv.Checked If Not Me._selectedProfile.Aktiv = Me._selectedProfile.OriginalAktiv Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If If Me.chkbxAktiv.Checked Then Me.chkbxAktiv.BackColor = Color.GreenYellow Else Me.chkbxAktiv.BackColor = Color.Transparent End If End Sub Private Sub chkbxAktiv_CheckStateChanged(sender As System.Object, e As System.EventArgs) Handles chkbxAktiv.CheckStateChanged If Me.chkbxAktiv.CheckState = CheckState.Checked Then Me.chkbxAktiv.BackColor = Color.GreenYellow Else Me.chkbxAktiv.BackColor = Color.Transparent End If End Sub Private Sub chkbxdelete_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkbxdelete.CheckedChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.delete = Me.chkbxdelete.Checked If Not Me.chkbxdelete.Checked = Me._selectedProfile.Originaldelete Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub cmbEndung_xml_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbEndung_xml.SelectedIndexChanged If Me.cmbEndung_xml.SelectedIndex <> -1 Then If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.xmlEnd = Me.cmbEndung_xml.Text If Not Me._selectedProfile.xmlEnd = Me._selectedProfile.Original_xmlEnd Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End If End Sub Private Sub cmbIndexValidierung_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbIndexValidierung.SelectedIndexChanged If Me._selectedProfile IsNot Nothing Then If Me.cmbIndexValidierung.SelectedIndex <> -1 Then Me._selectedProfile.IndexValidation = Me.cmbIndexValidierung.Text If Not Me._selectedProfile.IndexValidation = Me._selectedProfile.OriginalIndexValidation Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End If End Sub Private Sub tsbtnFirstProfil_Click(sender As System.Object, e As System.EventArgs) Handles tsbtnfirst.Click If Me._selectedProfile IsNot Nothing Then If _selectedProfile.HasChanges Then _selectedProfile.Save(True, "profile") End If Else 'Noch kein Profil geladen also das erste laden If arrProfile.GetUpperBound(0) >= 0 Then _pos = 0 Lade_Profil(arrProfile(0, 0)) End If Exit Sub End If If arrProfile.GetUpperBound(0) >= 0 Then Lade_Profil(arrProfile(arrProfile.GetLowerBound(0), 0)) _pos = arrProfile.GetLowerBound(0) End If End Sub Private Sub tsbtnpreviousProfil_Click(sender As System.Object, e As System.EventArgs) Handles tsbtnprevious.Click If Me._selectedProfile IsNot Nothing Then If _selectedProfile.HasChanges Then _selectedProfile.Save(True, "profile") End If Else 'Noch kein Profil geladen also das erste laden If arrProfile.GetUpperBound(0) >= 0 Then _pos = 0 Lade_Profil(arrProfile(0, 0)) End If Exit Sub End If 'Eine Position niedriger _pos = _pos - 1 If arrProfile.GetLowerBound(0) <= _pos Then For i = 0 To arrProfile.GetUpperBound(0) If arrProfile(i, 1) = _pos Then Lade_Profil(arrProfile(i, 0)) End If Next Else 'Erste Position _pos = arrProfile.GetLowerBound(0) MsgBox("Dies ist das erste Profil", MsgBoxStyle.Information, "Hinweis:") End If End Sub Private Sub tsbtnnextProfil_Click(sender As System.Object, e As System.EventArgs) Handles tsbtnnext.Click If Me._selectedProfile IsNot Nothing Then If _selectedProfile.HasChanges Then _selectedProfile.Save(True, "profile") End If Else 'Noh kein Profil geladen also das erste laden If arrProfile.GetUpperBound(0) > 0 Then _pos = 0 Lade_Profil(arrProfile(0, 0)) End If Exit Sub End If 'Eine Position höher _pos = _pos + 1 'MsgBox(_pos & vbNewLine & "AnzahL: " & arrProfile.GetUpperBound(0)) If arrProfile.GetUpperBound(0) >= _pos Then For i = 0 To arrProfile.GetUpperBound(0) If arrProfile(i, 1) = _pos Then Lade_Profil(arrProfile(i, 0)) End If Next Else 'MsgBox("letztes") _pos = arrProfile.GetUpperBound(0) MsgBox("Dies ist das letzte Profil", MsgBoxStyle.Information, "Hinweis:") End If End Sub Private Sub tsbtnLastProfil_Click(sender As System.Object, e As System.EventArgs) Handles tsbtnlast.Click If Me._selectedProfile IsNot Nothing Then If _selectedProfile.HasChanges Then _selectedProfile.Save(True, "profile") End If Else 'Noch kein Profil geladen also das erste laden If arrProfile.GetUpperBound(0) >= 0 Then _pos = arrProfile.GetUpperBound(0) Lade_Profil(arrProfile(arrProfile.GetUpperBound(0), 0)) End If Exit Sub End If If arrProfile.GetUpperBound(0) >= 0 Then Lade_Profil(arrProfile(arrProfile.GetUpperBound(0), 0)) _pos = arrProfile.GetUpperBound(0) End If End Sub Private Sub txtPassword_MaskInputRejected(sender As System.Object, e As System.Windows.Forms.MaskInputRejectedEventArgs) Handles txtPassword.MaskInputRejected End Sub Private Sub btnCheck_Con_Click(sender As System.Object, e As System.EventArgs) Handles btnCheck_Con.Click Try Dim connstr As String If Me.cmbDbArt.SelectedIndex <> -1 Then 'während Verbindungsaufbau Sanduhr-Mauszeiger Cursor = Cursors.WaitCursor Select Case Me.cmbDbArt.SelectedItem Case "MS-SQL" Dim con As String If CheckBoxwin_aut.Checked Then con = "Data Source=" & Me.txtDataSource1.Text & ";Initial Catalog=" & Me.txtDataSource2.Text & ";Trusted_Connection=True;" Else con = "Server=" & Me.txtDataSource1.Text & ";Database=" & Me.txtDataSource2.Text & ";User Id=" & Me.txtUserId.Text & ";Password=" & Me.txtPassword.Text & ";" End If Dim connection As New SqlClient.SqlConnection(con) connstr = con connection.Open() Cursor = Cursors.Default MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:") My.Settings.Save() Case "Oracle" Try Dim conn As New OracleConnectionStringBuilder If chkOR_ohne_TNS.Checked Then connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & txtDataSource1.Text & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & txtDataSource2.Text & ")));User Id=" & txtUserId.Text & ";Password=" & txtPassword.Text & ";" Else conn.DataSource = txtDataSource2.Text conn.UserID = txtUserId.Text conn.Password = txtPassword.Text conn.PersistSecurityInfo = True conn.ConnectionTimeout = 120 connstr = conn.ConnectionString End If Dim connection As New OracleConnection(connstr) connection.Open() MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:") My.Settings.Save() Catch ex As Exception MsgBox(ex.Message & vbNewLine & vbNewLine & connstr, MsgBoxStyle.Critical, "Fehler bei Verbindungsaufbau Oracle:") End Try Case "ODBC" Dim connectionString As String connectionString = $"DSN={txtDataSource1.Text};UID={txtUserId.Text};Pwd={txtPassword.Text};" Try Dim conn As OdbcConnection Dim dr As OdbcDataReader conn = New OdbcConnection(connectionString) conn.Open() conn.Close() conn.Dispose() MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:") Catch ex As Exception MsgBox(ex.Message & vbNewLine & vbNewLine & connectionString, MsgBoxStyle.Critical, "Fehler bei Verbindungsaufbau ODBC:") End Try Case Else MsgBox("Test zur Zeit nicht möglich", MsgBoxStyle.Information, "Achtung:") End Select End If Catch ex As Exception MsgBox("Fehler beim Verbindungstest:" & vbNewLine & ex.Message, MsgBoxStyle.Critical) End Try Cursor = Cursors.Default End Sub Private Sub cmbIndexFehler_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbIndexFehler.SelectedIndexChanged If Me._selectedProfile IsNot Nothing Then If Me.cmbIndexFehler.SelectedIndex <> -1 Then Me._selectedProfile.IndexFehler = Me.cmbIndexFehler.Text If Not Me._selectedProfile.IndexFehler = Me._selectedProfile.OriginalIndexFehler Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End If End Sub Public Function FileOwner(ByVal Filename As String) As String Dim oFile As New IO.FileInfo(Filename) Dim oFS As System.Security.AccessControl.FileSecurity = oFile.GetAccessControl Return oFS.GetOwner(GetType(System.Security.Principal.NTAccount)).Value End Function Public Function FileOwner2(ByVal Fi As String) As String Dim oFile As New IO.FileInfo(Fi) Dim ds As Security.AccessControl.FileSecurity = oFile.GetAccessControl Dim ir As Security.Principal.IdentityReference = ds.GetOwner(GetType(Security.Principal.NTAccount)) Return ir.Value.ToString End Function Private Sub txtIndex_Volltext_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtIndex_Volltext.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.Desk_windreamIndex = Me.txtIndex_Volltext.Text If Not Me.txtIndex_Volltext.Text = Me._selectedProfile.OriginalwindreamIndex Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub frmNIProfileigenschaften_Load(sender As Object, e As EventArgs) Handles Me.Load If LICENSE_MoveRename = True Then grpbxMORE.Enabled = True Else grpbxMORE.Enabled = False End If If Me._selectedProfile Is Nothing Then Me.pnlProfileigenschaften.Visible = False Else Lade_Profil(Me._selectedProfile.Profilname) End If End Sub Private Sub chkbxUserIdent_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxUserIdent.CheckedChanged If chkbxUserIdent.Checked = False Then Me.chkbxUserIdent.Text = "Identifizierung über dedizierten User" lblLDAP_PW.Visible = True lblLDAP_User.Visible = True 'lblLDAP_Domaene.Visible = True 'txtLDAP_Domaene.Visible = True txtLDAP_PW.Visible = True txtLDAP_User.Visible = True Else lblLDAP_PW.Visible = False lblLDAP_User.Visible = False 'lblLDAP_Domaene.Visible = False 'txtLDAP_Domaene.Visible = False 'txtLDAP_Domaene.Text = "" txtLDAP_PW.Visible = False txtLDAP_PW.Text = "" txtLDAP_User.Visible = False txtLDAP_User.Text = "" Me.chkbxUserIdent.Text = "Identifizierung über aktuellen User: " & Environment.UserDomainName & "\" & Environment.UserName End If End Sub Private Sub txtLDAP_Domaene_TextChanged(sender As Object, e As EventArgs) Handles txtLDAP_Domaene.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.DataSource = Me.txtLDAP_Domaene.Text If Not Me._selectedProfile.DataSource = Me._selectedProfile.OriginalDataSource Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub txtLDAP_User_TextChanged(sender As Object, e As EventArgs) Handles txtLDAP_User.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.UserId = Me.txtLDAP_User.Text If Not Me._selectedProfile.UserId = Me._selectedProfile.OriginalUserId Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub txtLDAP_PW_TextChanged(sender As Object, e As EventArgs) Handles txtLDAP_PW.TextChanged If Me._selectedProfile IsNot Nothing Then licenseManager = New ClassLicenseManager("#DigitalData9731258!#") Dim encodePW As String = licenseManager.EncodeLicenseKey(txtLDAP_PW.Text, "#DigitalData9731258!#") Me._selectedProfile.Password = encodePW If Not Me._selectedProfile.Password = Me._selectedProfile.OriginalPassword Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub Private Sub btnTestLDAP_Click(sender As Object, e As EventArgs) Handles btnTestLDAP.Click If txtLDAP_Domaene.Text = "" Then MsgBox("Bitte die Domäne unbedingt für den Test angeben!", MsgBoxStyle.Exclamation) Me.txtLDAP_Domaene.Text = "LDAP://" & Environment.UserDomainName & ".local" Me.txtLDAP_Domaene.Focus() Exit Sub End If Dim Ergebnis As ArrayList = ClassActiveDirectory.Test_Connect("", "sAMAccountName", txtLDAP_Domaene.Text, txtLDAP_User.Text, txtLDAP_PW.Text) If Ergebnis Is Nothing = False Then If Ergebnis.Count >= 1 Then MsgBox("Es konnte erfolgreich per LDAP auf die Attribute zugegriffen werden!", MsgBoxStyle.Information, "Erfolg:") Else MsgBox("Es konnte NICHT per LDAP auf die Attribute zugegriffen werden!", MsgBoxStyle.Information, "Erfolg:") End If End If End Sub Private Sub CheckBoxwin_aut_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBoxwin_aut.CheckedChanged If CheckBoxwin_aut.Checked Then Me.txtUserId.Enabled = False Me.txtPassword.Enabled = False Me.txtUserId.Text = "WINAUTH" Me.txtPassword.Text = "" Else Me.txtUserId.Enabled = True Me.txtPassword.Enabled = True Me.txtUserId.Text = "" Me.txtPassword.Text = "" End If End Sub Private Sub btbNBaddCrFolder_Click(sender As Object, e As EventArgs) Handles btbNBaddCrFolder.Click ' wenn im Formular der OK-Button geklickt wurde If Me.FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then ' den Speicherort der windream-Suche in die TextBox eintragen Me.txtNBCrFolder.Text = Me.FolderBrowserDialog1.SelectedPath End If End Sub Private Sub txtNBCrFolder_TextChanged(sender As Object, e As EventArgs) Handles txtNBCrFolder.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.CrFolder_Folder = Me.txtNBCrFolder.Text If Not Me.txtNBCrFolder.Text = Me._selectedProfile.OriginalCrFolder_Folder Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If If Me.txtNBCrFolder.Text = "" Then chkcrfold_move.Checked = False End If End If End Sub Private Sub chkcrfold_move_CheckedChanged(sender As Object, e As EventArgs) Handles chkcrfold_move.CheckedChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.CrFolder_Move = Me.chkcrfold_move.Checked If Not Me.chkcrfold_move.Checked = Me._selectedProfile.OriginalCrFolder_Move Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If If Me.chkcrfold_move.Checked Then Me.chkcrfold_move.BackColor = Color.GreenYellow Else Me.chkcrfold_move.BackColor = Color.Transparent End If End Sub Private Sub chkbxAD_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxAD.CheckedChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.NachbearbeitungAD = Me.chkbxAD.Checked If Not Me.chkbxAD.Checked = Me._selectedProfile.OriginalNachbearbeitungAD Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If If Me.chkbxAD.Checked Then Me.chkbxAD.BackColor = Color.GreenYellow Else Me.chkbxAD.BackColor = Color.Transparent End If End Sub Private Sub btnmovetoFolderDialog_Click_1(sender As Object, e As EventArgs) Handles btnmovetoFolderDialog.Click If Me._selectedProfile.MR_DAIndex <> "" Or Me._selectedProfile.MR_KDIndex <> "" Then MsgBox("Für dieses Profil wurde Move and Rename bereits aktiviert! (Fertig indexierte Dateien werden DOKUMENTART-Abhängig in ein Zielverzeichnis verschoben!)" & vbNewLine & "Bitte deaktivieren Sie diese Option in den Verknüpfungen!", MsgBoxStyle.Critical, "Achtung:") Me.txtMovetoFolder.Text = "" Exit Sub End If ' wenn im Formular der OK-Button geklickt wurde If Me.FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then ' den Speicherort der windream-Suche in die TextBox eintragen Me.txtMovetoFolder.Text = Me.FolderBrowserDialog1.SelectedPath End If End Sub Private Sub txtMovetoFolder_TextChanged_1(sender As Object, e As EventArgs) Handles txtMovetoFolder.TextChanged If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.move2Folder = Me.txtMovetoFolder.Text If Not Me.txtMovetoFolder.Text = Me._selectedProfile.Originalmove2Folder Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End Sub 'Private Sub cmbMoReKundenindex_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles cmbMoReKundenindex.SelectedIndexChanged ' If Me.cmbMoReKundenindex.SelectedIndex <> -1 Then ' If Me._selectedProfile IsNot Nothing Then ' Me._selectedProfile.MR_KDIndex = cmbMoReKundenindex.SelectedItem ' If Not Me._selectedProfile.MR_KDIndex = Me._selectedProfile.OriginalMR_KDIndex Then ' If cmbMoReKundenindex.Text = "Standard-VZ" Then ' Me.lblHinweisKundenindex.Text = "Dokumente werden im allgemeinen Kundenverzeichnis abgelegt!" ' Else ' Me.lblHinweisKundenindex.Text = "Dokumente werden im spezifischen Kundenordner abgelegt!" ' End If ' Me.btnSpeichern.Enabled = True ' Else ' Me.btnSpeichern.Enabled = False ' End If ' End If ' End If 'End Sub 'Private Sub cmbMOREDokumentart_SelectedIndexChanged_1(sender As Object, e As EventArgs) Handles cmbMOREDokumentart.SelectedIndexChanged ' If Me.cmbMOREDokumentart.SelectedIndex <> -1 Then ' If txtMovetoFolder.Text <> "" Then ' MsgBox("Achtung Sie haben Move2Folder aktiviert! Die Kombination mit Move and Rename ist nicht zulässig!", MsgBoxStyle.Exclamation) ' End If ' If Me._selectedProfile IsNot Nothing Then ' Me._selectedProfile.MR_DAIndex = cmbMOREDokumentart.SelectedItem ' If Not Me._selectedProfile.MR_DAIndex = Me._selectedProfile.OriginalMR_DAIndex Then ' Me.btnSpeichern.Enabled = True ' Else ' Me.btnSpeichern.Enabled = False ' End If ' End If ' End If 'End Sub Private Sub rbxls_CheckedChanged(sender As Object, e As EventArgs) Handles rbxls.CheckedChanged MsgBox("Funktion nicht aktiv - Individuelle Anfrage bei Digital Data stellen") rbxml.Checked = True End Sub Private Sub chkbxGetOrdnerRechte_CheckedChanged(sender As Object, e As EventArgs) Handles chkbxGetOrdnerRechte.CheckedChanged If chkbxGetOrdnerRechte.Checked Then Me.cmbOrdnertyp.Enabled = True OrdnerTypenEintragen() 'Me.cmbOrdnertyp.SelectedIndex = cmbOrdnertyp.FindStringExact(Me._selectedProfile.OrdnerType) Me.cmbOrdnertyp_Ebene.Enabled = True 'Me.cmbOrdnertyp_Ebene.SelectedIndex = cmbOrdnertyp_Ebene.FindStringExact(Me._selectedProfile.OrdnerType_Ebene) Else Me.cmbOrdnertyp.Enabled = False Me.cmbOrdnertyp_Ebene.Enabled = False End If If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.GetOrdnerTypes = Me.chkbxGetOrdnerRechte.Checked If Not Me.chkbxGetOrdnerRechte.Checked = Me._selectedProfile.OriginalGetOrdnerTypes Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If If Me.chkbxGetOrdnerRechte.Checked Then Me.chkbxGetOrdnerRechte.BackColor = Color.GreenYellow Me.TreeViewOrdnerVererbung.Visible = True Me.TreeViewOrdnerVererbung.ExpandAll() Else Me._selectedProfile.OrdnerType = "" Me._selectedProfile.OrdnerType_Ebene = "Parent" Me.chkbxGetOrdnerRechte.BackColor = Color.Transparent Me.TreeViewOrdnerVererbung.Visible = False End If End Sub Private Sub OrdnerTypenEintragen() Try Dim oOrdnerTyp As WINDREAMLib.WMObject ' Combobox leeren Me.cmbOrdnertyp.Items.Clear() ' alle Objekttypen durchlaufen For Each oOrdnerTyp In _windream.GetOrdnertypenAsObjects ' und in die Combobox eintragen Me.cmbOrdnertyp.Items.Add(oOrdnerTyp.aName) Next Catch ex As Exception MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Eintragen der Ordnertypen:") End Try End Sub Private Sub txtCrFolderIndex_TextChanged(sender As Object, e As EventArgs) Handles txtCrFolderIndex.TextChanged Me._selectedProfile.CrFolderIndex = Me.txtCrFolderIndex.Text If Not Me._selectedProfile.CrFolderIndex = Me._selectedProfile.OriginalCrFolderIndex Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End Sub Private Sub btnaddcrFolderParameter_Click(sender As Object, e As EventArgs) Handles btnaddcrFolderParameter.Click Dim str As String If (txtCrFolderIndex.Text = "") = False Then str = txtCrFolderIndex.Text & "\" End If If cmbCrFolderIndex.SelectedIndex <> -1 Then Me.txtCrFolderIndex.Text = str & "[%" & cmbCrFolderIndex.Text & "]" cmbCrFolderIndex.SelectedIndex = -1 ElseIf cmbCrFolderDate.SelectedIndex <> -1 Then Me.txtCrFolderIndex.Text = str & "[V%" & cmbCrFolderDate.Text & "]" cmbCrFolderDate.SelectedIndex = -1 ElseIf txtcrFoldermanuell.Text <> "" Then Me.txtCrFolderIndex.Text = str & "[M%" & txtcrFoldermanuell.Text & "]" txtcrFoldermanuell.Text = "" End If End Sub Private Sub btncrFolder_delete_Click(sender As Object, e As EventArgs) Handles btncrFolder_delete.Click Me.txtCrFolderIndex.Text = "" End Sub Private Sub cmbOrdnertyp_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbOrdnertyp.SelectedIndexChanged If Me.cmbOrdnertyp.SelectedIndex <> -1 Then If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.OrdnerType = cmbOrdnertyp.SelectedItem If Not cmbOrdnertyp.SelectedItem = Me._selectedProfile.OriginalOrdnerType Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End If End Sub Private Sub cmbOrdnertyp_Ebene_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbOrdnertyp_Ebene.SelectedIndexChanged If Me.cmbOrdnertyp_Ebene.SelectedIndex <> -1 Then If Me._selectedProfile IsNot Nothing Then Me._selectedProfile.OrdnerType_Ebene = cmbOrdnertyp_Ebene.SelectedItem If Not cmbOrdnertyp_Ebene.SelectedItem = Me._selectedProfile.OriginalOrdnerType_Ebene Then Me.btnSpeichern.Enabled = True Else Me.btnSpeichern.Enabled = False End If End If End If End Sub Private Sub Label18_Click(sender As Object, e As EventArgs) Handles Label18.Click End Sub Private Sub cmbCrFolderIndex_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCrFolderIndex.SelectedIndexChanged End Sub Private Sub cmbCrFolderDate_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbCrFolderDate.SelectedIndexChanged End Sub Private Sub txtcrFoldermanuell_TextChanged(sender As Object, e As EventArgs) Handles txtcrFoldermanuell.TextChanged End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnMoveRename.Click If CURRENT_PROFILENAME = "" Then MsgBox("Please choose a Profile!", MsgBoxStyle.Exclamation) Exit Sub End If CURRENT_IndexList = INDEX_LIST frmNIMoveRename.ShowDialog() End Sub End Class