MS_04.01
This commit is contained in:
@@ -105,7 +105,7 @@ Public Class frmWD_IndexFile
|
||||
'den Entity-Key auslesen
|
||||
Dim DT As DataTable
|
||||
sql = "Select Top 1 * from TBPMO_WD_OBJECTTYPE where Upper(object_type) = Upper('" & ClassWindream._WDObjekttyp & "')"
|
||||
dt = ClassDatabase.Return_Datatable(sql)
|
||||
DT = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not dt Is Nothing Then
|
||||
If dt.Rows.Count = 1 Then
|
||||
'den Entity-Key auslesen
|
||||
@@ -150,8 +150,12 @@ Public Class frmWD_IndexFile
|
||||
stg1 = "Success:"
|
||||
End If
|
||||
If multiindex = False Then MsgBox(stg, MsgBoxStyle.Information, stg1)
|
||||
ClassDatabase.Execute_Scalar("UPDATE TBPMO_FILES_USER SET WORKED = 1 WHERE GUID = " & CURRENT_FILEID)
|
||||
|
||||
ClassDatabase.Execute_Scalar("UPDATE TBPMO_FILES_USER SET WORKED = 1 WHERE GUID = " & CURRENT_FILEID, True)
|
||||
For Each row As DataRow In CURRENT_TBPMO_FILES_USER.Rows
|
||||
If row.Item("GUID") = CURRENT_FILEID Then
|
||||
row.Item("WORKED") = 1
|
||||
End If
|
||||
Next
|
||||
'Die Originaldatei löschen
|
||||
If droptype = "dragdrop file" And indexierung_erfolgreich = True Then
|
||||
If chkdelete_origin.Checked = True Then
|
||||
@@ -334,7 +338,7 @@ Public Class frmWD_IndexFile
|
||||
End If
|
||||
If Not IsNothing(CURRENT_TBPMO_INDEX_MAN) Then
|
||||
If CURRENT_TBPMO_INDEX_MAN.Rows.Count > 0 Then
|
||||
If CheckWrite_IndexeMan() = False Then
|
||||
If ClassFileResult.CheckWrite_IndexeMan(grbxControls) = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
@@ -349,125 +353,6 @@ Public Class frmWD_IndexFile
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Function Return_CURRENT_TBPMO_INDEX_MAN_VALUE(CONTROL_GUID As Integer, COL_NAME As String)
|
||||
Try
|
||||
' Presuming the DataTable has a column named ENTITY_ID and TYPE_NODE.
|
||||
Dim expression As String
|
||||
expression = "GUID = " & CONTROL_GUID
|
||||
Dim foundRowsLevel0() As DataRow
|
||||
' Use the Select method to find all rows matching the filter.
|
||||
foundRowsLevel0 = CURRENT_TBPMO_INDEX_MAN.Select(expression)
|
||||
Dim i As Integer
|
||||
' For each row create a Node
|
||||
For i = 0 To foundRowsLevel0.GetUpperBound(0)
|
||||
Return foundRowsLevel0(i)(COL_NAME)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unvorhergesehener Fehler in Return_CURRENT_TBPMO_INDEX_MAN_VALUE - Fehler: " & vbNewLine & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Function SET_CURRENT_TBPMO_INDEX_MAN_VALUE(CONTROL_GUID As Integer, VALUE As String)
|
||||
Try
|
||||
For Each row As DataRow In CURRENT_TBPMO_INDEX_MAN.Rows
|
||||
If row.Item("GUID") = CONTROL_GUID Then
|
||||
row.Item("MAN_VALUE") = VALUE
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unvorhergesehener Fehler in SET_CURRENT_TBPMO_INDEX_MAN_VALUE - Fehler: " & vbNewLine & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Function CheckWrite_IndexeMan()
|
||||
'#### Zuerst manuelle Werte indexieren ####
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >>In CheckWrite_IndexeMan", False)
|
||||
Dim result As Boolean = False
|
||||
For Each ctrl As Control In Me.grbxControls.Controls
|
||||
' ' MsgBox(ctrl.Name)
|
||||
If ctrl.Name.StartsWith("txt") Then
|
||||
Dim box As TextBox = ctrl
|
||||
If box.Text = "" Then
|
||||
Dim optional_index = Return_CURRENT_TBPMO_INDEX_MAN_VALUE(box.Tag, "OPTIONAL") 'ClassDatabase.Execute_Scalar("SELECT OPTIONAL FROM TBPMO_INDEX_MAN WHERE GUID = " & box.Tag, True)
|
||||
If Not IsNothing(optional_index) Then
|
||||
If CBool(optional_index) = False Then
|
||||
MsgBox("Please insert a value!", MsgBoxStyle.Exclamation, "Missing input:")
|
||||
box.Focus()
|
||||
Return False
|
||||
Else
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(box.Tag, "")
|
||||
'Indexwert_Postprocessing(Replace(box.Name, "txt", ""), "")
|
||||
result = True
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
'If Indexwert_checkValueDB(Replace(box.Name, "txt", ""), box.Text) = False Then
|
||||
' ClassLogger.Add(" - Der eingegebene Wert wurde nicht in der Datenbank gefunden", False)
|
||||
' MsgBox("Der eingegebene Wert wurde nicht in der Datenbank gefunden!", MsgBoxStyle.Exclamation, "Fehlerhafte Indexierung:")
|
||||
' box.Focus()
|
||||
' Return False
|
||||
'Else
|
||||
' 'Indexwert_Postprocessing(Replace(box.Name, "txt", ""), box.Text)
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(box.Tag, "")
|
||||
|
||||
result = True
|
||||
'End If
|
||||
End If
|
||||
End If
|
||||
If ctrl.Name.StartsWith("cmb") Then
|
||||
Dim cmb As ComboBox = ctrl
|
||||
If cmb.Text = "" Then
|
||||
Dim optional_index = Return_CURRENT_TBPMO_INDEX_MAN_VALUE(cmb.Tag, "OPTIONAL") 'ClassDatabase.Execute_Scalar("SELECT OPTIONAL FROM TBPMO_INDEX_MAN WHERE GUID = " & box.Tag, True)
|
||||
If Not IsNothing(optional_index) Then
|
||||
If CBool(optional_index) = False Then
|
||||
MsgBox("Please choose a value!", MsgBoxStyle.Exclamation, "Missing input:")
|
||||
cmb.Focus()
|
||||
Return False
|
||||
Else
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(cmb.Tag, "")
|
||||
'Indexwert_Postprocessing(Replace(box.Name, "txt", ""), "")
|
||||
result = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(cmb.Tag, cmb.Text)
|
||||
' Indexwert_Postprocessing(Replace(cmb.Name, "cmb", ""), cmb.Text)
|
||||
result = True
|
||||
End If
|
||||
End If
|
||||
If ctrl.Name.StartsWith("dtp") Then
|
||||
Dim dtp As DateTimePicker = ctrl
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(dtp.Tag, dtp.Value)
|
||||
'Indexwert_Postprocessing(Replace(dtp.Name, "dtp", ""), dtp.Text)
|
||||
result = True
|
||||
End If
|
||||
If ctrl.Name.StartsWith("chk") Then
|
||||
Dim chk As CheckBox = ctrl
|
||||
SET_CURRENT_TBPMO_INDEX_MAN_VALUE(chk.Tag, chk.Checked)
|
||||
'Indexwert_Postprocessing(Replace(chk.Name, "chk", ""), chk.Checked)
|
||||
result = True
|
||||
End If
|
||||
If ctrl.Name.StartsWith("lbl") = False And result = False Then
|
||||
ClassLogger.Add("Die Überprüfung der manuellen Indices ist fehlerhaft. Bitte informieren Sie den Systembetreuer", True)
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unvorhergesehener Fehler in CheckWrite_IndexeMan - Fehler: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unerwarteter Unexpected error in CheckWrite_IndexeMan:")
|
||||
Return False
|
||||
End Try
|
||||
|
||||
|
||||
End Function
|
||||
Sub Indexing_File(doctype_id As Integer)
|
||||
Try
|
||||
Me.Cursor = Cursors.WaitCursor
|
||||
@@ -478,7 +363,7 @@ Public Class frmWD_IndexFile
|
||||
'Die erste Datei indexieren
|
||||
If WORK_FILE(Me.txtFilepath.Text, Me.PATHTextBox.Text, doctype_id, My.Settings.WD_INDEXDOKART_SAVE, True) = True Then
|
||||
'Und nun die folgenden
|
||||
Dim DTFiles2Work As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPMO_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_FILEID & " AND UPPER(USER_WORK) = UPPER('" & USER_USERNAME & "')")
|
||||
Dim DTFiles2Work As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM TBPMO_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_FILEID & " AND UPPER(USER_WORK) = UPPER('" & USER_USERNAME & "')", True)
|
||||
If Not DTFiles2Work Is Nothing Then
|
||||
Dim err = False
|
||||
For Each filerow As DataRow In DTFiles2Work.Rows
|
||||
@@ -621,7 +506,7 @@ Public Class frmWD_IndexFile
|
||||
Else
|
||||
sel = "select MANUAL_SUBFOLDER FROM TBPMO_WD_FORMVIEW_DOKTYPES WHERE FORMVIEW_ID = (SELECT GUID FROM TBPMO_FORM_VIEW WHERE FORM_ID = " & CURRENT_ENTITY_ID & " and SCREEN_ID = " & CURRENT_SCREEN_ID & ")"
|
||||
End If
|
||||
Dim chk = ClassDatabase.Execute_Scalar(sel)
|
||||
Dim chk = ClassDatabase.Execute_Scalar(sel, True)
|
||||
If Not IsNothing(chk) Then
|
||||
If CBool(chk) = True Then
|
||||
lblSubfolder.Visible = True
|
||||
@@ -759,7 +644,7 @@ Public Class frmWD_IndexFile
|
||||
Try
|
||||
Dim indexname = cmb.Name.Replace("cmb", "")
|
||||
Dim sql = "SELECT GUID,NAME,SQL_RESULT FROM TBPMO_INDEX_MAN where SUGGESTION = 1 AND SQL_RESULT like '%@" & indexname & "%' and DOCTYPE_ID = " & CURRENT_DOKARTID & " ORDER BY SEQUENCE"
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(sql)
|
||||
If Not IsNothing(DT) Then
|
||||
If DT.Rows.Count > 0 Then
|
||||
Dim cmbname = "cmb" & DT.Rows(0).Item("NAME")
|
||||
@@ -791,9 +676,9 @@ Public Class frmWD_IndexFile
|
||||
' Exit Sub
|
||||
'End If
|
||||
|
||||
Dim conid = Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "CONNECTION_ID") ' DT_INDEX.Rows(0).Item("CONNECTION_ID")
|
||||
Dim sql_result = Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "SQL_RESULT") 'DT_INDEX.Rows(0).Item("SQL_RESULT")
|
||||
Dim NAME = Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "NAME") 'DT_INDEX.Rows(0).Item("NAME")
|
||||
Dim conid = ClassMoreMetadata.Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "CONNECTION_ID") ' DT_INDEX.Rows(0).Item("CONNECTION_ID")
|
||||
Dim sql_result = ClassMoreMetadata.Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "SQL_RESULT") 'DT_INDEX.Rows(0).Item("SQL_RESULT")
|
||||
Dim NAME = ClassMoreMetadata.Return_CURRENT_TBPMO_INDEX_MAN_VALUE(INDEX_GUID, "NAME") 'DT_INDEX.Rows(0).Item("NAME")
|
||||
If Not IsNothing(conid) And Not IsNothing(sql_result) And Not IsNothing(NAME) Then
|
||||
For Each ctrl As Control In Me.grbxControls.Controls
|
||||
If ctrl.Name = "cmb" & NAME.ToString Then
|
||||
@@ -1013,7 +898,7 @@ Public Class frmWD_IndexFile
|
||||
End If
|
||||
'den Entity-Key auslesen
|
||||
sql = "Select Top 1 * from TBPMO_WD_OBJECTTYPE where Upper(object_type) = Upper('" & OBJECT_TYPETextBox.Text & "')"
|
||||
dt = ClassDatabase.Return_Datatable(sql)
|
||||
dt = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not dt Is Nothing Then
|
||||
If dt.Rows.Count = 1 Then
|
||||
lvwIndices.Items.Add(dt.Rows(0).Item("IDXNAME_ENTITYID").ToString)
|
||||
@@ -1054,14 +939,29 @@ Public Class frmWD_IndexFile
|
||||
End Sub
|
||||
Private Sub frmWD_Index_Dokart_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
Try
|
||||
CURRENT_FILENAME = ""
|
||||
Me.VWDDINDEX_AUTOMTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
chkMultiIndexer.Checked = False
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> frmWD_Index_Dokart_Load", False)
|
||||
chkdelete_origin.Checked = False
|
||||
chkdelete_origin.Visible = False
|
||||
CURRENT_FILENAME = ClassDatabase.Execute_Scalar("SELECT FILENAME2WORK FROM TBPMO_FILES_USER WHERE GUID = " & CURRENT_FILEID)
|
||||
Dim HandleType As String = ClassDatabase.Execute_Scalar("SELECT HANDLE_TYPE FROM TBPMO_FILES_USER WHERE GUID = " & CURRENT_FILEID)
|
||||
MULTIFILES = ClassDatabase.Execute_Scalar("SELECT COUNT(*) FROM TBPMO_FILES_USER WHERE WORKED = 0 AND GUID <> " & CURRENT_FILEID & " AND UPPER(USER_WORK) = UPPER('" & USER_USERNAME & "')")
|
||||
Dim HandleType As String
|
||||
For Each row As DataRow In CURRENT_TBPMO_FILES_USER.Rows
|
||||
If row.Item("GUID") = CURRENT_FILEID Then
|
||||
CURRENT_FILENAME = row.Item("FILENAME2WORK")
|
||||
HandleType = row.Item("HANDLE_TYPE")
|
||||
End If
|
||||
Next
|
||||
If CURRENT_FILENAME = "" Then
|
||||
MsgBox("Chekc the Temp Files Table, as it seems to be empty!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
MULTIFILES = 0
|
||||
For Each row As DataRow In CURRENT_TBPMO_FILES_USER.Rows
|
||||
If row.Item("GUID") <> CURRENT_FILEID Then
|
||||
MULTIFILES += 1
|
||||
End If
|
||||
Next
|
||||
If MULTIFILES > 0 Then
|
||||
chkMultiIndexer.Text = "Multi-Indexing - Alle nachfolgenden Dateien (" & MULTIFILES & ") identisch indexieren"
|
||||
chkMultiIndexer.Visible = True
|
||||
@@ -1085,7 +985,6 @@ Public Class frmWD_IndexFile
|
||||
ElseIf HandleType = "SCAM" Then
|
||||
droptype = "scan"
|
||||
End If
|
||||
TBPMO_FILES_USERTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
VWPMO_DOKUMENTTYPESTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.VWPMO_DOKUMENTTYPESTableAdapter.Fill(Me.DD_DMSDataSet.VWPMO_DOKUMENTTYPES, CURRENT_FORMVIEW_ID)
|
||||
|
||||
@@ -1094,7 +993,7 @@ Public Class frmWD_IndexFile
|
||||
If DD_DMSDataSet.VWPMO_DOKUMENTTYPES.Rows.Count = 0 Then
|
||||
If CURRENT_ENTITY_REDUNDANT_ID <> 0 Then
|
||||
|
||||
Dim FVID = ClassDatabase.Execute_Scalar(String.Format("SELECT GUID FROM TBPMO_FORM_VIEW WHERE FORM_ID = {0} and SCREEN_ID = 1", CURRENT_ENTITY_REDUNDANT_ID))
|
||||
Dim FVID = ClassDatabase.Execute_Scalar(String.Format("SELECT GUID FROM TBPMO_FORM_VIEW WHERE FORM_ID = {0} and SCREEN_ID = 1", CURRENT_ENTITY_REDUNDANT_ID), True)
|
||||
Me.VWPMO_DOKUMENTTYPESTableAdapter.Fill(Me.DD_DMSDataSet.VWPMO_DOKUMENTTYPES, FVID)
|
||||
If DD_DMSDataSet.VWPMO_DOKUMENTTYPES.Rows.Count = 0 Then
|
||||
MsgBox("No documenttypes for the redundant entity configured either! Indexing is not possible!" & vbNewLine & "Please check the configuration!", MsgBoxStyle.Exclamation)
|
||||
@@ -1107,10 +1006,10 @@ Public Class frmWD_IndexFile
|
||||
CURRENT_FORMVIEW_ID = FVID
|
||||
End If
|
||||
Else
|
||||
MsgBox("No dcumenttypes for this entity configured! Indexing is not possible!" & vbNewLine & "Please check the configuration!", MsgBoxStyle.Exclamation)
|
||||
MsgBox("No documenttypes for this entity configured! Indexing is not possible!" & vbNewLine & "Please check the configuration!", MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in frmWD_Index_Dokart_Load:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
|
||||
Reference in New Issue
Block a user