Merge branch 'master' of http://172.24.11.74:90/scm/git/ProcessManagerClient
This commit is contained in:
commit
b49b4df36f
Binary file not shown.
@ -65,15 +65,8 @@ Public Class ClassInit
|
||||
Else
|
||||
LICENSE_COUNT = 0
|
||||
End If
|
||||
Dim oLicDateString As String = split(1)
|
||||
Dim cultureInfo As System.Globalization.CultureInfo
|
||||
cultureInfo = New System.Globalization.CultureInfo("de-DE")
|
||||
cultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy"
|
||||
|
||||
|
||||
Dim oLicDate As Date = Convert.ToDateTime(oLicDateString, cultureInfo)
|
||||
Dim oMyDate As Date = Convert.ToDateTime(Now.ToShortDateString, cultureInfo)
|
||||
If oLicDate <= oMyDate Then
|
||||
If LICENSE_VALID = False Then
|
||||
MsgBox("Your license has expired!" & vbNewLine & "Last valid date: " & split(1) & vbNewLine & "Please contact Your sysadmin", MsgBoxStyle.Exclamation)
|
||||
LICENSE_EXPIRED = True
|
||||
LICENSE_COUNT = 0
|
||||
@ -194,6 +187,7 @@ Public Class ClassInit
|
||||
vWLaufwerk = DT.Rows(0).Item("STRING1")
|
||||
vVERSION_DELIMITER = DT.Rows(0).Item("VERSION_DELIMITER")
|
||||
vFILE_DELIMITER = DT.Rows(0).Item("FILE_DELIMITER")
|
||||
LICENSE_VALID = DT.Rows(0).Item("LICENSE_VALID")
|
||||
Try
|
||||
WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP")
|
||||
Catch ex As Exception
|
||||
|
||||
@ -35,6 +35,7 @@ Module ModuleRuntimeVariables
|
||||
Public LICENSE_COUNT As Integer = 0
|
||||
Public LICENSE_EXPIRED As Boolean = False
|
||||
Public LICENSE_PROFILES As Integer = 0
|
||||
Public LICENSE_VALID As Boolean = False
|
||||
Public USERCOUNT_LOGGED_IN As Integer = 0
|
||||
Public CURRENT_INDEX_ID As Integer
|
||||
Public CURRENT_OBJECTTYPE As String
|
||||
|
||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.9.5.4")>
|
||||
<Assembly: AssemblyVersion("1.9.5.5")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
|
||||
@ -22,7 +22,7 @@ Public Class frmLicense
|
||||
Private Sub btnnewLicenses_Click(sender As System.Object, e As System.EventArgs) Handles btnnewLicenses.Click
|
||||
Try
|
||||
If Me.txtNewlizences.Text <> "" And txtProfile.Text <> "" Then
|
||||
Dim dt As Date = CDate(dtp_Gültigkeit.Text)
|
||||
Dim dt As Date = CDate(dtp_Gültigkeit.Value)
|
||||
Dim oDateddMMyyyy = dt.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture)
|
||||
Dim result As String = Me._lizenzManager.EncodeLicenseKey(txtNewlizences.Text & "#" & oDateddMMyyyy & "#" & txtProfile.Text, "#DigitalData35452!#")
|
||||
txtlicensekey.Text = result
|
||||
@ -48,17 +48,34 @@ Public Class frmLicense
|
||||
Else
|
||||
lizenzzahl = "0"
|
||||
End If
|
||||
dtp_Gültigkeit.Value = split(1)
|
||||
Try
|
||||
dtp_Gültigkeit.Value = CDate(split(1))
|
||||
Catch ex As Exception
|
||||
Dim oLicDateString As String = split(1)
|
||||
Dim cultureInfo As System.Globalization.CultureInfo
|
||||
cultureInfo = New System.Globalization.CultureInfo("de-DE")
|
||||
cultureInfo.DateTimeFormat.ShortDatePattern = "dd.MM.yyyy"
|
||||
|
||||
|
||||
Dim oLicDate As Date = Convert.ToDateTime(oLicDateString, cultureInfo)
|
||||
Try
|
||||
dtp_Gültigkeit.Value = oLicDate
|
||||
Catch ex1 As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in Setting DTP-Value:")
|
||||
End Try
|
||||
|
||||
End Try
|
||||
|
||||
txtProfile.Text = split(2)
|
||||
LICENSE_PROFILES = split(2)
|
||||
Me.lblAktuelleLizenzen.Text = "Aktuelle Anzahl Lizenzen: " & lizenzzahl
|
||||
If Neu = True Then
|
||||
If CInt(lizenzzahl) > 0 Then
|
||||
MsgBox("Die Lizenz wurde aktualisiert!", MsgBoxStyle.Information, "Erfolgsmeldung:")
|
||||
MsgBox("License was refreshed!", MsgBoxStyle.Information, "Success:")
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:")
|
||||
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in LicenseManager-RefreshLicense:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ Public Class frmMain
|
||||
Private GridCursorLocation As Point
|
||||
Private GRID_LOAD_TYPE As String = "OVERVIEW"
|
||||
Private GRID_INV_COL_REMOVED As Boolean = False
|
||||
Private NO_WORKFLOWITEMS As Boolean = False
|
||||
'Private _windream As New ClassWindream_allgemein
|
||||
|
||||
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
@ -209,6 +210,9 @@ Public Class frmMain
|
||||
End Function
|
||||
|
||||
Private Sub SaveGridLayout()
|
||||
If NO_WORKFLOWITEMS = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
Try
|
||||
Dim xml As String = GetXML_LayoutName()
|
||||
GridView_Docs.SaveLayoutToXml(xml, OptionsLayoutBase.FullLayout)
|
||||
@ -218,6 +222,10 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub RestoreLayout()
|
||||
If NO_WORKFLOWITEMS = True Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Try
|
||||
Dim xml As String = GetXML_LayoutName()
|
||||
GridView_Docs.RestoreLayoutFromXml(xml, OptionsLayoutBase.FullLayout)
|
||||
@ -532,7 +540,11 @@ Public Class frmMain
|
||||
sql = sql.Replace("@DATE", Now.ToShortDateString)
|
||||
sql = sql.Replace("@PROFILE_ID", CURRENT_CLICKED_PROFILE_ID)
|
||||
CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True)
|
||||
|
||||
If CURR_DT_PROFILEGRID.Rows.Count = 0 Then
|
||||
NO_WORKFLOWITEMS = True
|
||||
Else
|
||||
NO_WORKFLOWITEMS = False
|
||||
End If
|
||||
Create_Basic_View()
|
||||
|
||||
Dim Columns_Removed = GridView_CheckInvalidColumns()
|
||||
@ -657,7 +669,11 @@ Public Class frmMain
|
||||
CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True)
|
||||
|
||||
If Not IsNothing(CURR_DT_PROFILEGRID) Then
|
||||
|
||||
If CURR_DT_PROFILEGRID.Rows.Count = 0 Then
|
||||
NO_WORKFLOWITEMS = True
|
||||
Else
|
||||
NO_WORKFLOWITEMS = False
|
||||
End If
|
||||
Create_Basic_View()
|
||||
|
||||
Try
|
||||
@ -670,8 +686,6 @@ Public Class frmMain
|
||||
GridView_Docs.GroupedColumns(I).Tag = GridView_Docs.Columns.Item("PROFILE_ID")
|
||||
Next
|
||||
|
||||
|
||||
|
||||
GridView_Docs.OptionsBehavior.AutoExpandAllGroups = True
|
||||
GridView_Docs.OptionsView.ShowGroupedColumns = False
|
||||
Catch ex As Exception
|
||||
@ -1072,8 +1086,12 @@ Public Class frmMain
|
||||
CURR_DT_PROFILEGRID = ClassDatabase.Return_Datatable(sql, True)
|
||||
|
||||
If Not IsNothing(CURR_DT_PROFILEGRID) Then
|
||||
NO_WORKFLOWITEMS = False
|
||||
If CURR_DT_PROFILEGRID.Rows.Count = 0 Then
|
||||
lblViewType.Text = "Aktuell keine Workflowdaten vorhanden!"
|
||||
|
||||
NO_WORKFLOWITEMS = True
|
||||
|
||||
'MsgBox("Aktuell keine Workflowdaten vorhanden!", MsgBoxStyle.Information)
|
||||
GridControl_Docs.Visible = False
|
||||
pnlNavigator.Visible = False
|
||||
|
||||
@ -12,6 +12,7 @@ Imports System.Text.RegularExpressions
|
||||
Imports System.ComponentModel
|
||||
Imports DD_LIB_Standards
|
||||
Imports DigitalData.Controls.LookupGrid
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class frmValidator
|
||||
Dim viewerID
|
||||
@ -1669,8 +1670,8 @@ Public Class frmValidator
|
||||
Private Function Return_VektorArray(ByVal oDocument As WMObject, vktIndexName As String, NIIndexe As Object, CheckDuplikat As Boolean, vType As Object)
|
||||
Dim ValueArray()
|
||||
|
||||
Try
|
||||
Dim missing As Boolean = False
|
||||
' Try
|
||||
Dim missing As Boolean = False
|
||||
Dim Anzahl As Integer = 0
|
||||
|
||||
'Jeden Wert des Vektorfeldes durchlaufen
|
||||
@ -1760,9 +1761,9 @@ Public Class frmValidator
|
||||
End If
|
||||
|
||||
Return ValueArray
|
||||
Catch ex As Exception
|
||||
Return valueArray
|
||||
End Try
|
||||
'Catch ex As Exception
|
||||
' Return ValueArray
|
||||
'End Try
|
||||
|
||||
|
||||
End Function
|
||||
@ -2130,6 +2131,27 @@ Public Class frmValidator
|
||||
End If
|
||||
|
||||
End If
|
||||
Case "DigitalData.Controls.LookupGrid.LookupControl"
|
||||
Try
|
||||
Dim lookup As LookupControl = inctrl
|
||||
Dim wertWD = aktivesDokument.GetVariableValue(idxname)
|
||||
If wertWD.GetType.ToString.Contains("System.Object") Then
|
||||
Dim oArrlist As New List(Of String)
|
||||
For Each oVectorRow As Object In wertWD
|
||||
|
||||
oArrlist.Add(oVectorRow.ToString)
|
||||
Next
|
||||
lookup.SelectedValues = oArrlist
|
||||
|
||||
Else
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unvorhergesehener Unexpected error in AddVorschlag_ComboBox - Indexname: " & indexname & " - Fehler: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl:")
|
||||
End Try
|
||||
|
||||
Case "System.Windows.Forms.DateTimePicker"
|
||||
controltype = "DateTimePicker"
|
||||
Dim DTP As DateTimePicker = inctrl
|
||||
@ -2239,272 +2261,272 @@ Public Class frmValidator
|
||||
'Eingaben auf Form überprüfen
|
||||
If Check_UpdateIndexe() = False Then
|
||||
'lblerror.Visible = False
|
||||
'Try
|
||||
Dim _error As Boolean = False
|
||||
Me.TBPM_PROFILE_FINAL_INDEXINGTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_PROFILE_FINAL_INDEXING, CURRENT_ProfilName)
|
||||
Dim dtfinal As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_FINAL_INDEXING
|
||||
If dtfinal.Rows.Count > 0 Then
|
||||
'Jetzt finale Indexe setzen
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Finale(r) Index(e) für Dok: " & aktivesDokument.aName & " soll gesetzt werden", False)
|
||||
For Each dr As DataRow In dtfinal.Rows
|
||||
Dim value As String = dr.Item("VALUE").ToString
|
||||
If value.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ###
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexierung mit dynamischem SQL!", False)
|
||||
Dim SQL_COMMAND = dr.Item("SQL_COMMAND")
|
||||
Try
|
||||
Dim _error As Boolean = False
|
||||
Me.TBPM_PROFILE_FINAL_INDEXINGTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_PROFILE_FINAL_INDEXING, CURRENT_ProfilName)
|
||||
Dim dtfinal As DataTable = DD_DMSLiteDataSet.TBPM_PROFILE_FINAL_INDEXING
|
||||
If dtfinal.Rows.Count > 0 Then
|
||||
'Jetzt finale Indexe setzen
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Finale(r) Index(e) für Dok: " & aktivesDokument.aName & " soll gesetzt werden", False)
|
||||
For Each dr As DataRow In dtfinal.Rows
|
||||
Dim value As String = dr.Item("VALUE").ToString
|
||||
If value.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ###
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexierung mit dynamischem SQL!", False)
|
||||
Dim SQL_COMMAND = dr.Item("SQL_COMMAND")
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> SQL_COMMAND before ReplaceAllValues: " & SQL_COMMAND, False)
|
||||
SQL_COMMAND = clsPatterns.ReplaceAllValues(SQL_COMMAND, pnldesigner, aktivesDokument, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> SQL_COMMAND after ReplaceAllValues: " & SQL_COMMAND, False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> SQL_COMMAND before ReplaceAllValues: " & SQL_COMMAND, False)
|
||||
SQL_COMMAND = clsPatterns.ReplaceAllValues(SQL_COMMAND, pnldesigner, aktivesDokument, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> SQL_COMMAND after ReplaceAllValues: " & SQL_COMMAND, False)
|
||||
|
||||
'' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
'' einen Regulären Ausdruck laden
|
||||
'Dim regulärerAusdruck As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(preg)
|
||||
'' die Vorkommen im SQL-String auslesen
|
||||
'Dim elemente As System.Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(SQL_COMMAND)
|
||||
''####
|
||||
'' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
'For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
' Try
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
' Dim WDINDEXNAME = element.Value.Substring(2, element.Value.Length - 3)
|
||||
' Dim wertWD = aktivesDokument.GetVariableValue(WDINDEXNAME)
|
||||
' If Not IsNothing(wertWD) Then
|
||||
' SQL_COMMAND = SQL_COMMAND.ToString.Replace(element.Value, wertWD)
|
||||
' Else
|
||||
' ClassLogger.Add(">> Achtung Indexwert ist nothing!", False)
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
|
||||
' End Try
|
||||
'Next
|
||||
'' Regulären Ausdruck zum Auslesen der Indexe definieren
|
||||
'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
'' einen Regulären Ausdruck laden
|
||||
'Dim regulärerAusdruck As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(preg)
|
||||
'' die Vorkommen im SQL-String auslesen
|
||||
'Dim elemente As System.Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(SQL_COMMAND)
|
||||
''####
|
||||
'' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
'For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
' Try
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
' Dim WDINDEXNAME = element.Value.Substring(2, element.Value.Length - 3)
|
||||
' Dim wertWD = aktivesDokument.GetVariableValue(WDINDEXNAME)
|
||||
' If Not IsNothing(wertWD) Then
|
||||
' SQL_COMMAND = SQL_COMMAND.ToString.Replace(element.Value, wertWD)
|
||||
' Else
|
||||
' ClassLogger.Add(">> Achtung Indexwert ist nothing!", False)
|
||||
' End If
|
||||
' Catch ex As Exception
|
||||
' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
|
||||
' End Try
|
||||
'Next
|
||||
|
||||
|
||||
|
||||
Dim dynamic_value = ClassDatabase.Execute_Scalar(SQL_COMMAND, MyConnectionString, True)
|
||||
Dim dynamic_value = ClassDatabase.Execute_Scalar(SQL_COMMAND, MyConnectionString, True)
|
||||
|
||||
If Not IsNothing(dynamic_value) Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add("DYNAMIC VALUE IS: " & dynamic_value.ToString, False)
|
||||
value = dynamic_value
|
||||
Else
|
||||
ClassLogger.Add("ATTENTION: DYNAMIC VALUE IS NOTHING!")
|
||||
End If
|
||||
Else
|
||||
If value.StartsWith("v") Then
|
||||
Select Case dr.Item("VALUE").ToString
|
||||
Case "vDate"
|
||||
value = Now.ToShortDateString
|
||||
Case "vUserName"
|
||||
value = Environment.UserName
|
||||
Case Else
|
||||
value = dr.Item("VALUE")
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim result() As String
|
||||
ReDim Preserve result(0)
|
||||
result(0) = value
|
||||
|
||||
If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then
|
||||
Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME"))
|
||||
'Hier muss nun separat als Vektorfeld indexiert werden
|
||||
If Indexiere_VektorfeldPM(PM_String, PROFIL_VEKTORINDEX) = False Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME").ToString.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False)
|
||||
Else
|
||||
errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
End If
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Jetzt das indexieren", False)
|
||||
If Indexiere_File(aktivesDokument, dr.Item("INDEXNAME"), result) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add("")
|
||||
'Nun das Logging
|
||||
If PROFIL_LOGINDEX <> "" Then
|
||||
Dim logstr = Return_LOGString(value, "DDFINALINDEX", dr.Item("INDEXNAME"))
|
||||
Indexiere_VektorfeldPM(logstr, PROFIL_LOGINDEX)
|
||||
If Not IsNothing(dynamic_value) Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add("DYNAMIC VALUE IS: " & dynamic_value.ToString, False)
|
||||
value = dynamic_value
|
||||
Else
|
||||
ClassLogger.Add("ATTENTION: DYNAMIC VALUE IS NOTHING!")
|
||||
End If
|
||||
|
||||
Else
|
||||
errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
If value.StartsWith("v") Then
|
||||
Select Case dr.Item("VALUE").ToString
|
||||
Case "vDate"
|
||||
value = Now.ToShortDateString
|
||||
Case "vUserName"
|
||||
value = Environment.UserName
|
||||
Case Else
|
||||
value = dr.Item("VALUE")
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If _error = True Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'Wenn kein Fehler nach der finalen Indexierung gesetzt wurde
|
||||
|
||||
If _error = False Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Tabelle updaten und co", False)
|
||||
'Das Dokument freigeben und als editiert markieren
|
||||
Dim sql = String.Format("UPDATE TBPM_PROFILE_FILES SET IN_WORK = 0, WORK_USER = '{0}', EDIT = 1 WHERE GUID = {1}", Environment.UserName, CURRENT_DOC_GUID)
|
||||
ClassDatabase.Execute_non_Query(sql)
|
||||
'TBPM_PROFILE_FILESTableAdapter.CmdSETWORK(False, "", Document_ID)
|
||||
''Das Dokument
|
||||
'TBPM_PROFILE_FILESTableAdapter.CmdSetEdit(Document_ID)
|
||||
Dim WORK_HISTORY_ENTRY = Nothing
|
||||
Dim result() As String
|
||||
ReDim Preserve result(0)
|
||||
result(0) = value
|
||||
|
||||
Try
|
||||
WORK_HISTORY_ENTRY = CURRENT_DT_PROFILE.Rows(0).Item("WORK_HISTORY_ENTRY")
|
||||
If IsDBNull(WORK_HISTORY_ENTRY) Then
|
||||
If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then
|
||||
Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME"))
|
||||
'Hier muss nun separat als Vektorfeld indexiert werden
|
||||
If Indexiere_VektorfeldPM(PM_String, PROFIL_VEKTORINDEX) = False Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME").ToString.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False)
|
||||
Else
|
||||
errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
End If
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Jetzt das indexieren", False)
|
||||
If Indexiere_File(aktivesDokument, dr.Item("INDEXNAME"), result) = True Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> FINALER INDEX '" & dr.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add("")
|
||||
'Nun das Logging
|
||||
If PROFIL_LOGINDEX <> "" Then
|
||||
Dim logstr = Return_LOGString(value, "DDFINALINDEX", dr.Item("INDEXNAME"))
|
||||
Indexiere_VektorfeldPM(logstr, PROFIL_LOGINDEX)
|
||||
End If
|
||||
|
||||
Else
|
||||
errormessage = "Fehler beim finalen Indexieren:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
End If
|
||||
End If
|
||||
If _error = True Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
'Wenn kein Fehler nach der finalen Indexierung gesetzt wurde
|
||||
|
||||
If _error = False Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Tabelle updaten und co", False)
|
||||
'Das Dokument freigeben und als editiert markieren
|
||||
Dim sql = String.Format("UPDATE TBPM_PROFILE_FILES SET IN_WORK = 0, WORK_USER = '{0}', EDIT = 1 WHERE GUID = {1}", Environment.UserName, CURRENT_DOC_GUID)
|
||||
ClassDatabase.Execute_non_Query(sql)
|
||||
'TBPM_PROFILE_FILESTableAdapter.CmdSETWORK(False, "", Document_ID)
|
||||
''Das Dokument
|
||||
'TBPM_PROFILE_FILESTableAdapter.CmdSetEdit(Document_ID)
|
||||
Dim WORK_HISTORY_ENTRY = Nothing
|
||||
|
||||
Try
|
||||
WORK_HISTORY_ENTRY = CURRENT_DT_PROFILE.Rows(0).Item("WORK_HISTORY_ENTRY")
|
||||
If IsDBNull(WORK_HISTORY_ENTRY) Then
|
||||
WORK_HISTORY_ENTRY = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
WORK_HISTORY_ENTRY = Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
WORK_HISTORY_ENTRY = Nothing
|
||||
End Try
|
||||
End Try
|
||||
|
||||
|
||||
If Not IsNothing(WORK_HISTORY_ENTRY) Then
|
||||
If WORK_HISTORY_ENTRY <> String.Empty Then
|
||||
Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
' einen Regulären Ausdruck laden
|
||||
Dim regulärerAusdruck As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(preg)
|
||||
' die Vorkommen im SQL-String auslesen
|
||||
Dim elemente As System.Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(WORK_HISTORY_ENTRY)
|
||||
'####
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False)
|
||||
Dim CTRL_ID = element.Value.Substring(2, element.Value.Length - 3)
|
||||
CTRL_ID = CTRL_ID.Replace("CTRLID", "")
|
||||
Dim value_from_control
|
||||
For Each inctrl As Control In Me.pnldesigner.Controls
|
||||
If IsNothing(inctrl.Tag) Then
|
||||
Continue For
|
||||
End If
|
||||
If inctrl.Tag = CTRL_ID Then
|
||||
'######
|
||||
Dim Type As String = inctrl.GetType.ToString
|
||||
Select Case Type
|
||||
Case "System.Windows.Forms.TextBox"
|
||||
Try
|
||||
value_from_control = inctrl.Text
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
|
||||
Case "System.Windows.Forms.ComboBox"
|
||||
Dim cmb As ComboBox = inctrl
|
||||
Try
|
||||
value_from_control = cmb.Text
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
Case "System.Windows.Forms.DateTimePicker"
|
||||
Dim dtp As DateTimePicker = inctrl
|
||||
Try
|
||||
value_from_control = dtp.Value.ToString
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
|
||||
Case "System.Windows.Forms.CheckBox"
|
||||
Dim chk As CheckBox = inctrl
|
||||
Try
|
||||
value_from_control = chk.Checked
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
End Select
|
||||
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(value_from_control) And value_from_control <> String.Empty Then
|
||||
WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message)
|
||||
End Try
|
||||
Next
|
||||
If WORK_HISTORY_ENTRY.ToString.Contains("@DATE") Then
|
||||
WORK_HISTORY_ENTRY.ToString.Replace("@DATE", Now.ToShortDateString)
|
||||
End If
|
||||
If WORK_HISTORY_ENTRY.ToString.Contains("@USERNAME") Then
|
||||
WORK_HISTORY_ENTRY.ToString.Replace("@USERNAME", Environment.UserName)
|
||||
End If
|
||||
Else
|
||||
WORK_HISTORY_ENTRY = ""
|
||||
End If
|
||||
End If
|
||||
Dim ins = String.Format("INSERT INTO TBPM_FILES_WORK_HISTORY (PROFIL_ID, DOC_ID,WORKED_BY,WORKED_WHERE,STATUS_COMMENT) VALUES ({0},{1},'{2}','{3}','{4}')", CURRENT_ProfilGUID, CURRENT_DOC_ID, Environment.UserName, Environment.MachineName, WORK_HISTORY_ENTRY)
|
||||
ClassDatabase.Execute_non_Query(ins)
|
||||
|
||||
Close_document_viewer()
|
||||
If Document_Path.ToLower.EndsWith(".pdf") Then
|
||||
If Not IsNothing(WORK_HISTORY_ENTRY) Then
|
||||
If CBool(CURRENT_DT_PROFILE.Rows(0).Item("ANNOTATE_WORK_HISTORY_ENTRY")) = True Then
|
||||
sql = String.Format("SELECT * FROM TBPM_FILES_WORK_HISTORY WHERE GUID = (SELECT MAX(GUID) FROM TBPM_FILES_WORK_HISTORY WHERE PROFIL_ID = {0} AND DOC_ID = {1})", CURRENT_ProfilGUID, CURRENT_DOC_ID)
|
||||
Dim DT_ENTRY As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not IsNothing(DT_ENTRY) Then
|
||||
If DT_ENTRY.Rows.Count = 1 Then
|
||||
Dim AnnotationString = DT_ENTRY.Rows(0).Item("WORKED_WHEN") & " " & DT_ENTRY.Rows(0).Item("WORKED_BY") & ": " & DT_ENTRY.Rows(0).Item("STATUS_COMMENT")
|
||||
ClassAnnotation.Annotate_PDF("Workflow-State:", AnnotationString, 0)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Dim value = CURRENT_DT_PROFILE.Rows(0).Item("ANNOTATE_ALL_WORK_HISTORY_ENTRIES")
|
||||
If CBool(value) = True Then
|
||||
sql = String.Format("SELECT * FROM TBPM_FILES_WORK_HISTORY WHERE DOC_ID = {1} ORDER BY GUID", CURRENT_ProfilGUID, CURRENT_DOC_ID)
|
||||
Dim DT_ENTRIES As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not IsNothing(DT_ENTRIES) Then
|
||||
If DT_ENTRIES.Rows.Count > 0 Then
|
||||
Dim AnnotationString As String = ""
|
||||
For Each rw As DataRow In DT_ENTRIES.Rows
|
||||
AnnotationString = AnnotationString & rw.Item("WORKED_WHEN") & " " & rw.Item("WORKED_BY") & ": " & rw.Item("STATUS_COMMENT") & vbNewLine
|
||||
If WORK_HISTORY_ENTRY <> String.Empty Then
|
||||
Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
' einen Regulären Ausdruck laden
|
||||
Dim regulärerAusdruck As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(preg)
|
||||
' die Vorkommen im SQL-String auslesen
|
||||
Dim elemente As System.Text.RegularExpressions.MatchCollection = regulärerAusdruck.Matches(WORK_HISTORY_ENTRY)
|
||||
'####
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
Try
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False)
|
||||
Dim CTRL_ID = element.Value.Substring(2, element.Value.Length - 3)
|
||||
CTRL_ID = CTRL_ID.Replace("CTRLID", "")
|
||||
Dim value_from_control
|
||||
For Each inctrl As Control In Me.pnldesigner.Controls
|
||||
If IsNothing(inctrl.Tag) Then
|
||||
Continue For
|
||||
End If
|
||||
If inctrl.Tag = CTRL_ID Then
|
||||
'######
|
||||
Dim Type As String = inctrl.GetType.ToString
|
||||
Select Case Type
|
||||
Case "System.Windows.Forms.TextBox"
|
||||
Try
|
||||
value_from_control = inctrl.Text
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
|
||||
Case "System.Windows.Forms.ComboBox"
|
||||
Dim cmb As ComboBox = inctrl
|
||||
Try
|
||||
value_from_control = cmb.Text
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
Case "System.Windows.Forms.DateTimePicker"
|
||||
Dim dtp As DateTimePicker = inctrl
|
||||
Try
|
||||
value_from_control = dtp.Value.ToString
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
|
||||
Case "System.Windows.Forms.CheckBox"
|
||||
Dim chk As CheckBox = inctrl
|
||||
Try
|
||||
value_from_control = chk.Checked
|
||||
Catch ex As Exception
|
||||
value_from_control = String.Empty
|
||||
End Try
|
||||
End Select
|
||||
|
||||
End If
|
||||
Next
|
||||
ClassAnnotation.Annotate_PDF("Workflow History:", AnnotationString, 0, 10, 40)
|
||||
If Not IsNothing(value_from_control) And value_from_control <> String.Empty Then
|
||||
WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message)
|
||||
End Try
|
||||
Next
|
||||
If WORK_HISTORY_ENTRY.ToString.Contains("@DATE") Then
|
||||
WORK_HISTORY_ENTRY.ToString.Replace("@DATE", Now.ToShortDateString)
|
||||
End If
|
||||
If WORK_HISTORY_ENTRY.ToString.Contains("@USERNAME") Then
|
||||
WORK_HISTORY_ENTRY.ToString.Replace("@USERNAME", Environment.UserName)
|
||||
End If
|
||||
Else
|
||||
WORK_HISTORY_ENTRY = ""
|
||||
End If
|
||||
End If
|
||||
Dim ins = String.Format("INSERT INTO TBPM_FILES_WORK_HISTORY (PROFIL_ID, DOC_ID,WORKED_BY,WORKED_WHERE,STATUS_COMMENT) VALUES ({0},{1},'{2}','{3}','{4}')", CURRENT_ProfilGUID, CURRENT_DOC_ID, Environment.UserName, Environment.MachineName, WORK_HISTORY_ENTRY)
|
||||
ClassDatabase.Execute_non_Query(ins)
|
||||
|
||||
Close_document_viewer()
|
||||
If Document_Path.ToLower.EndsWith(".pdf") Then
|
||||
If Not IsNothing(WORK_HISTORY_ENTRY) Then
|
||||
If CBool(CURRENT_DT_PROFILE.Rows(0).Item("ANNOTATE_WORK_HISTORY_ENTRY")) = True Then
|
||||
sql = String.Format("SELECT * FROM TBPM_FILES_WORK_HISTORY WHERE GUID = (SELECT MAX(GUID) FROM TBPM_FILES_WORK_HISTORY WHERE PROFIL_ID = {0} AND DOC_ID = {1})", CURRENT_ProfilGUID, CURRENT_DOC_ID)
|
||||
Dim DT_ENTRY As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not IsNothing(DT_ENTRY) Then
|
||||
If DT_ENTRY.Rows.Count = 1 Then
|
||||
Dim AnnotationString = DT_ENTRY.Rows(0).Item("WORKED_WHEN") & " " & DT_ENTRY.Rows(0).Item("WORKED_BY") & ": " & DT_ENTRY.Rows(0).Item("STATUS_COMMENT")
|
||||
ClassAnnotation.Annotate_PDF("Workflow-State:", AnnotationString, 0)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Dim value = CURRENT_DT_PROFILE.Rows(0).Item("ANNOTATE_ALL_WORK_HISTORY_ENTRIES")
|
||||
If CBool(value) = True Then
|
||||
sql = String.Format("SELECT * FROM TBPM_FILES_WORK_HISTORY WHERE DOC_ID = {1} ORDER BY GUID", CURRENT_ProfilGUID, CURRENT_DOC_ID)
|
||||
Dim DT_ENTRIES As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not IsNothing(DT_ENTRIES) Then
|
||||
If DT_ENTRIES.Rows.Count > 0 Then
|
||||
Dim AnnotationString As String = ""
|
||||
For Each rw As DataRow In DT_ENTRIES.Rows
|
||||
AnnotationString = AnnotationString & rw.Item("WORKED_WHEN") & " " & rw.Item("WORKED_BY") & ": " & rw.Item("STATUS_COMMENT") & vbNewLine
|
||||
Next
|
||||
ClassAnnotation.Annotate_PDF("Workflow History:", AnnotationString, 0, 10, 40)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
'wenn Move2Folder aktiviert wurde
|
||||
If Move2Folder <> "" Then
|
||||
idxerr_message = allgFunk.Move2Folder(Document_Path, Move2Folder, CURRENT_ProfilGUID, _windream)
|
||||
If idxerr_message <> "" Then
|
||||
errormessage = "Fehler bei Move2Folder:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
'wenn Move2Folder aktiviert wurde
|
||||
If Move2Folder <> "" Then
|
||||
idxerr_message = allgFunk.Move2Folder(Document_Path, Move2Folder, CURRENT_ProfilGUID, _windream)
|
||||
If idxerr_message <> "" Then
|
||||
errormessage = "Fehler bei Move2Folder:" & vbNewLine & idxerr_message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
_error = True
|
||||
End If
|
||||
End If
|
||||
'Validierungsfile löschen wenn vorhanden
|
||||
allgFunk.Delete_xffres(Document_Path, _windream)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Delete_xffres ausgeführt", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> All Input clear", False)
|
||||
Anzahl_validierte_Dok += 1
|
||||
'tstrlbl_Info.Text = "Anzahl Dateien: " & TBPM_PROFILE_FILESTableAdapter.cmdGet_Anzahl(PROFIL_ID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Anzahl hochgesetzt", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Validierung erfolgreich abgeschlossen", False)
|
||||
ClassLogger.Add("", False)
|
||||
If CURRENT_JUMP_DOC_GUID <> 0 Then
|
||||
Me.Close()
|
||||
Else
|
||||
'Das nächste Dokument laden
|
||||
Load_Next_Document(False)
|
||||
|
||||
set_foreground()
|
||||
If first_control Is Nothing = False Then first_control.Focus()
|
||||
End If
|
||||
End If
|
||||
'Validierungsfile löschen wenn vorhanden
|
||||
allgFunk.Delete_xffres(Document_Path, _windream)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Delete_xffres ausgeführt", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> All Input clear", False)
|
||||
Anzahl_validierte_Dok += 1
|
||||
'tstrlbl_Info.Text = "Anzahl Dateien: " & TBPM_PROFILE_FILESTableAdapter.cmdGet_Anzahl(PROFIL_ID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Anzahl hochgesetzt", False)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Validierung erfolgreich abgeschlossen", False)
|
||||
ClassLogger.Add("", False)
|
||||
If CURRENT_JUMP_DOC_GUID <> 0 Then
|
||||
Me.Close()
|
||||
Else
|
||||
'Das nächste Dokument laden
|
||||
Load_Next_Document(False)
|
||||
|
||||
set_foreground()
|
||||
If first_control Is Nothing = False Then first_control.Focus()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
'Catch ex As Exception
|
||||
' errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message
|
||||
' My.Settings.Save()
|
||||
' frmError.ShowDialog()
|
||||
' ClassLogger.Add(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True)
|
||||
'End Try
|
||||
Catch ex As Exception
|
||||
errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message
|
||||
My.Settings.Save()
|
||||
frmError.ShowDialog()
|
||||
ClassLogger.Add(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True)
|
||||
End Try
|
||||
Else
|
||||
'lblerror.Visible = True
|
||||
'lblerror.Text = errmessage
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user