This commit is contained in:
SchreiberM
2016-08-18 10:58:31 +02:00
parent fd0e907262
commit bcee2404d5
30 changed files with 9903 additions and 8876 deletions

View File

@@ -1,9 +1,11 @@
Imports DD
Imports DD_Rights
Imports System.ComponentModel
Public Class frmCheckRightsEntity
Private DT_FILES As DataTable
Private _error As Boolean = False
Private countfiles As Integer = 0
Private WorkingFiles As Integer = 0
Private Sub frmCheckRightsEntity_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
Dim sql = String.Format("SELECT T.FORM_ID, [dbo].[FNPMO_GETOBJECTCAPTION]('{0}','FORMVIEW_TITLE' + CONVERT(VARCHAR(5), T.[FORM_VIEW_ID]), 1) AS FORM_TITLE FROM VWPMO_CONSTRUCTOR_FORMS T WHERE DOCUMENT_VIEW = 1", USER_LANGUAGE)
@@ -11,6 +13,7 @@ Public Class frmCheckRightsEntity
cmbentity.DataSource = DT
cmbentity.ValueMember = DT.Columns(0).ColumnName
cmbentity.DisplayMember = DT.Columns(1).ColumnName
lblstate.Visible = False
Catch ex As Exception
MsgBox("Unexpected error in load form: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
@@ -28,6 +31,11 @@ Public Class frmCheckRightsEntity
MsgBox("Could not init rights management. " & vbNewLine & "Check logfile", MsgBoxStyle.Critical)
Exit Sub
End If
btncancel.Visible = True
lblstate.Visible = True
lblstate.Text = "Starting Background Worker...."
countfiles = DT_FILES.Rows.Count - 1
WorkingFiles = 0
ProgressBar1.Maximum = DT_FILES.Rows.Count
AddHandler BW_RightsEntity.DoWork, AddressOf bw_DoWork
'.. und starten
@@ -40,6 +48,8 @@ Public Class frmCheckRightsEntity
End Sub
Private Sub BW_RightsEntity_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles BW_RightsEntity.ProgressChanged
Dim state = "Working on file '" & WorkingFiles.ToString & "' of '" & countfiles.ToString & "'"
lblstate.Text = state
Me.ProgressBar1.Value = e.ProgressPercentage
End Sub
Private Sub bw_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
@@ -53,7 +63,8 @@ Public Class frmCheckRightsEntity
Exit For
Else
If DD_Rights.ClassRights.Collect_Users(row.Item("RECORD_ID")) = True Then
If DD_Rights.ClassRights.File_DeleteAndSetRight(row.Item("FULL_FILENAME"), True) Then
WorkingFiles += 1
If DD_Rights.ClassRights.File_DeleteAndSetRight(row.Item("DocID"), row.Item("FULL_FILENAME"), True) Then
If DD_Rights.ClassRights.MSG_RESULT <> "" Then
MsgBox("Unexpected Errors in setting rights: " & vbNewLine & DD_Rights.ClassRights.MSG_RESULT, MsgBoxStyle.Exclamation)
_error = True
@@ -81,6 +92,7 @@ Public Class frmCheckRightsEntity
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
MsgBox("All rights of files belonging to entity were checked and refreshed successfully!", MsgBoxStyle.Information)