This commit is contained in:
Digital Data - Marlon Schreiber
2019-03-26 16:47:02 +01:00
parent 0a4720c931
commit 5daf8617ed
18 changed files with 1850 additions and 801 deletions

View File

@@ -4848,7 +4848,9 @@ Public Class frmConstructor_Main
Load_Level1()
End If
sw.Done()
TimerFileHandle.Enabled = True
If LogErrorsOnly = False Then ClassLogger.Add("", False)
FORM_SHOWN = True
End Sub
Sub Jump_Record()
@@ -5797,6 +5799,7 @@ Public Class frmConstructor_Main
docCM_RenameMain.Enabled = False
docCM_InWork.Enabled = False
docCM_linkRecord.Enabled = False
docCM_Showlinks.Enabled = False
docCM_CheckRights.Enabled = False
docCM_DeleteFile.Enabled = False
docCM_RemoveLink.Enabled = False
@@ -5808,6 +5811,7 @@ Public Class frmConstructor_Main
docCM_RenameMain.Enabled = True
docCM_InWork.Enabled = True
docCM_linkRecord.Enabled = True
docCM_Showlinks.Enabled = True
docCM_CheckRights.Enabled = True
docCM_DeleteFile.Enabled = True
docCM_RemoveLink.Enabled = True
@@ -7156,4 +7160,87 @@ Public Class frmConstructor_Main
Save_DocGrid_Layout()
End Sub
Private Sub TimerFileHandle_Tick(sender As Object, e As EventArgs) Handles TimerFileHandle.Tick
Try
Dim oSql = $"SELECT GUID FROM TBPMO_DOC_USER_REFRESH_VIEW WHERE USER_ID = {USER_GUID} AND REFRESHED_WHEN IS NULL"
Dim oDTGUID As DataTable = ClassDatabase.Return_Datatable(oSql)
If oDTGUID.Rows.Count = 1 Then
Dim oupd = $"UPDATE TBPMO_DOC_USER_REFRESH_VIEW SET REFRESHED_WHEN = GETDATE() WHERE GUID = {oDTGUID.Rows(0).Item(0)}"
If ClassDatabase.Execute_non_Query(oupd, False) = True Then
MsgBox("Attention: The docID of one document changed! The DocSearch will be refreshed!", MsgBoxStyle.Information)
RUN_WDSEARCH_GRID()
End If
End If
''oDT_ProcessDoc.Columns.Add("STATE", Type.GetType("System.String"))
''oDT_ProcessDoc.AcceptChanges()
''For Each oDatarow As DataRow In oDT_ProcessDoc.Rows
'' Dim exists As Boolean = False
'' For Each oProcess As Process In Process.GetProcesses()
'' If oProcess.Id = oDatarow.Item("PROCESS_ID") Then
'' 'process found so it's running so return true
'' If LogErrorsOnly = False Then ClassLogger.Add($"Process {oProcess.ProcessName} still running - {oProcess.Id.ToString}", False)
'' exists = True
'' End If
'' Next
'' If exists = False Then
'' oDatarow.Item("STATE") = "NOT RUNNING"
'' End If
''Next
''oDT_ProcessDoc.AcceptChanges()
'For Each oRow_Check As DataRow In oDT_ProcessDoc.Rows
' 'If IsDBNull(oRow_Check.Item("STATE")) Then
' ' Continue For
' 'End If
' 'If oRow_Check.Item("STATE") = "NOT RUNNING" Then
' Dim oGUID = oRow_Check.Item("GUID")
' Dim oDocID = oRow_Check.Item("OLD_DOC_ID")
' Dim oVersionID = oRow_Check.Item("VERSION_ID")
' Dim oDocPath = oRow_Check.Item("DOC_PATH")
' oSql = $"SELECT Count(DocID) FROM VWPMO_DOC_SYNC WHERE DocID = {oDocID}"
' Dim oFileExists = ClassDatabase.Execute_Scalar(oSql, False)
' If oFileExists = 0 Then
' CURRENT_OFFICE_FILE_CHANGED = True
' ClassLogger.Add($"The docId [{oDocID}] of handled file {oDocPath} changed during editing mode!", False)
' oSql = $"SELECT MAX(dwDocID) FROM windream60.dbo.BaseAttributes WHERE dwVersionID = {oVersionID}"
' Dim oNEW_DOC As DataTable = ClassDatabase.Return_Datatable(oSql, False)
' If oNEW_DOC.Rows.Count = 1 And Not IsDBNull(oNEW_DOC.Rows(0).Item(0)) Then
' Dim oNEWDocID = oNEW_DOC.Rows(0).Item(0)
' ClassLogger.Add($"New DocID is: {oNEWDocID}!!", False)
' oSql = $"EXEC PRPMO_DOC_CHANGE_DOCID {oDocID},{oNEWDocID},'{USER_USERNAME}'"
' If LogErrorsOnly = False Then ClassLogger.Add(oSql, False)
' If ClassDatabase.Execute_non_Query(oSql, False) = False Then
' ClassLogger.Add($"Could not relink the DocID!!", False)
' Else
' oSql = $"UPDATE TBPMO_DOC_ID_CHANGED SET NEW_DOC_ID = {oNEWDocID}, CHANGED_WHEN = GETDATE() WHERE GUID = {oGUID}"
' ClassDatabase.Execute_non_Query(oSql, False)
' End If
' Else
' ClassLogger.Add($"Could not get the new DOCID [{oSql}]!!", False)
' End If
' End If
' 'End If
'Next
Catch ex As Exception
ClassLogger.Add($"Unexpected error in TimerFileHandleTick [{ex.Message}]!!", True)
End Try
End Sub
Private Sub VerknüpfungenAnzeigenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles docCM_Showlinks.Click
Try
ClassWindreamDocGrid.GetDocItems(GridViewDoc_Search)
If IsNothing(ClassWindreamDocGrid.DT_RESULTFILES) Then
MsgBox("Could not read File Parameters (LinkRecord)!", MsgBoxStyle.Exclamation)
Exit Sub
End If
Refresh_Selected_Table()
Dim frm As New frmDoc_Links
frm.Show()
frm.BringToFront()
Catch ex As Exception
MsgBox("Unexpected Error in Showing DocLinks: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
End Class