This commit is contained in:
SchreiberM
2016-09-01 12:44:54 +02:00
parent 55b4b1e4ec
commit ba5e88b91b
19 changed files with 3153 additions and 2853 deletions

View File

@@ -33,8 +33,7 @@ Public Class frmCheckRightsEntity
BW_RightsEntity = New BackgroundWorker
BW_RightsEntity.WorkerReportsProgress = True
BW_RightsEntity.WorkerSupportsCancellation = True
Dim MAX_DOC_ID = clsDatabase.Execute_Scalar("SELECT DOC_ID FROM TBPMO_KONFIGURATION WHERE GUID = 1")
Dim sqlfiles = String.Format("SELECT * FROM VWPMO_WD_DOC_SEARCH where ENTITY_ID = {0} AND DocID > {1} ORDER BY DocID", ENTITY_ID, MAX_DOC_ID)
Dim sqlfiles = String.Format("SELECT * FROM VWPMO_WD_DOC_SEARCH where ENTITY_ID = {0} ORDER BY DocID", ENTITY_ID)
DT_FILES = clsDatabase.Return_Datatable(sqlfiles)
If DD_Rights.ClassRights.Init(ENTITY_ID, chklogging.Checked, DT_FILES.Rows.Count) = False Then
MsgBox("Could not init rights management. " & vbNewLine & "Check logfile", MsgBoxStyle.Critical)
@@ -94,38 +93,23 @@ Public Class frmCheckRightsEntity
Private Sub btncancel_Click(sender As Object, e As EventArgs) Handles btncancel.Click
' Cancel the asynchronous operation.
Me.BW_RightsEntity.CancelAsync()
Dim result As MsgBoxResult
result = MessageBox.Show("Would You like to save the DocID for the next run?", "Confirmation:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
If clsDatabase.Execute_non_Query("UPDATE TBPMO_KONFIGURATION SET DOC_ID = " & CURR_DOCID & " WHERE GUID = 1") = False Then
End If
End If
End Sub
Private Sub BW_RightsEntity_RunWorkerCompleted(sender As Object, e As RunWorkerCompletedEventArgs) Handles BW_RightsEntity.RunWorkerCompleted
Try
btncancel.Visible = False
lblstate.Visible = False
ProgressBar1.Visible = False
If _error = False Then
clsDatabase.Execute_non_Query("UPDATE TBPMO_SERVICE_RIGHT_CONFIG SET RUN_SERVICE = 1 WHERE GUID = 1")
If righterrors = True Then
MsgBox("All rights of files belonging to entity were checked and refreshed, " & vbNewLine & "BUT some Userrights could not be set. Check the logfile!", MsgBoxStyle.Exclamation, "Attention")
Else
MsgBox("All rights of files belonging to entity were queued for central rights service!" & vbNewLine & "Rights will be set within the next 5 minutes!", MsgBoxStyle.Information)
End If
clsDatabase.Execute_non_Query("UPDATE TBPMO_SERVICE_RIGHT_CONFIG SET RUN_SERVICE = 1 WHERE GUID = 1")
Else
MsgBox("Some errors occured while preparing and queuing rights...please check the log!" & vbNewLine & ">> " & ClassRights.COUNT_FILES.ToString & " files schould be worked." & _
">> " & ClassRights.WORKED_FILES.ToString & " were worked successfully.", MsgBoxStyle.Exclamation)
End If
clsDatabase.Execute_non_Query("UPDATE TBPMO_KONFIGURATION SET DOC_ID = 0 WHERE GUID = 1")
Catch ex As Exception
End Try