jj 29.09 user rights
This commit is contained in:
@@ -8,7 +8,28 @@
|
||||
_Instance.BringToFront()
|
||||
Return _Instance
|
||||
End Function
|
||||
Private Sub Save_Data()
|
||||
|
||||
Private Sub Save_User_Rights_Data()
|
||||
Try
|
||||
Me.Validate()
|
||||
Me.TBPMO_RIGHT_USERBindingSource.EndEdit()
|
||||
|
||||
If DD_DMSDataSet.TBPMO_RIGHT_USER.GetChanges() Is Nothing = False Then
|
||||
'Me.TBPMO_RIGHT_USERDataGridView.CurrentRow.Cells("colADDED_WHO").Value = Environment.UserName
|
||||
Me.TBPMO_RIGHT_USERBindingSource.EndEdit()
|
||||
Me.TBPMO_RIGHT_USERTableAdapter.Update(DD_DMSDataSet.TBPMO_RIGHT_USER)
|
||||
tschangedlabel.Text = "Right User changed - " & Now
|
||||
tschangedlabel.Visible = True
|
||||
Else
|
||||
tschangedlabel.Visible = False
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Save_User_Rights_Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub Save_Group_Rights_Data()
|
||||
Try
|
||||
Me.Validate()
|
||||
Me.TBPMO_RIGHT_GROUPBindingSource.EndEdit()
|
||||
@@ -23,37 +44,43 @@
|
||||
tschangedlabel.Visible = False
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Save_Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
MsgBox("Error in Save_Group_Rights_Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Sub Load_Datagrid(ByVal _Datagrid As DataGridView, ByVal _settings_String As String)
|
||||
Dim settings() As String
|
||||
If My.Settings(_settings_String) <> String.Empty Then
|
||||
settings = My.Settings(_settings_String).Split("$"c)
|
||||
For idx As Integer = 0 To _Datagrid.Columns.Count - 1
|
||||
Dim sv() As String = settings(idx).Split("/"c)
|
||||
_Datagrid.Columns(idx).DisplayIndex = CInt(sv(0))
|
||||
_Datagrid.Columns(idx).Width = CInt(sv(1))
|
||||
Next
|
||||
End If
|
||||
Try
|
||||
Dim settings() As String
|
||||
If My.Settings(_settings_String) <> String.Empty Then
|
||||
settings = My.Settings(_settings_String).Split("$"c)
|
||||
For idx As Integer = 0 To _Datagrid.Columns.Count - 1
|
||||
Dim sv() As String = settings(idx).Split("/"c)
|
||||
_Datagrid.Columns(idx).DisplayIndex = CInt(sv(0))
|
||||
_Datagrid.Columns(idx).Width = CInt(sv(1))
|
||||
Next
|
||||
End If
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
Sub Save_Datagrid(ByVal _Datagrid As DataGridView, ByVal _settings_String As String)
|
||||
Dim settings As String = String.Empty
|
||||
For idx As Integer = 0 To _Datagrid.Columns.Count - 1
|
||||
settings += _Datagrid.Columns(idx).DisplayIndex.ToString()
|
||||
settings += "/"
|
||||
settings += _Datagrid.Columns(idx).Width.ToString
|
||||
settings += "$"
|
||||
Next
|
||||
My.Settings(_settings_String) = settings
|
||||
Try
|
||||
Dim settings As String = String.Empty
|
||||
For idx As Integer = 0 To _Datagrid.Columns.Count - 1
|
||||
settings += _Datagrid.Columns(idx).DisplayIndex.ToString()
|
||||
settings += "/"
|
||||
settings += _Datagrid.Columns(idx).Width.ToString
|
||||
settings += "$"
|
||||
Next
|
||||
My.Settings(_settings_String) = settings
|
||||
Catch ex As Exception
|
||||
My.Settings(_settings_String) = String.Empty
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub frmRight_Management_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
Save_Datagrid(TBPMO_RIGHT_GROUPDataGridView, "TBPMO_RIGHT_GROUPDataGridView")
|
||||
Save_Datagrid(TBPMO_RIGHT_USERDataGridView, "TBPMO_RIGHT_USERDataGridView")
|
||||
End Sub
|
||||
Private Sub frmGroup_Rights_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
Refresh_Entities()
|
||||
@@ -62,12 +89,28 @@
|
||||
Me.TBWH_USER_GROUPSTableAdapter.Fill(Me.DD_ECMAdmin.TBWH_USER_GROUPS)
|
||||
Me.TBDD_USER_GROUPSTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.TBDD_USER_GROUPSTableAdapter.Fill(Me.DD_DMSDataSet.TBDD_USER_GROUPS)
|
||||
Me.TBPMO_RIGHT_USERTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.TBPMO_RIGHT_USERTableAdapter.Fill(Me.DD_DMSDataSet.TBPMO_RIGHT_USER)
|
||||
Me.TBDD_USERTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.TBDD_USERTableAdapter.Fill(Me.DD_DMSDataSet.TBDD_USER)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Loading Form:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
Refresh_Rights_Groups()
|
||||
Refresh_Rights_Users()
|
||||
Load_Datagrid(TBPMO_RIGHT_GROUPDataGridView, "TBPMO_RIGHT_GROUPDataGridView")
|
||||
Load_Datagrid(TBPMO_RIGHT_USERDataGridView, "TBPMO_RIGHT_USERDataGridView")
|
||||
End Sub
|
||||
|
||||
Sub Refresh_Rights_Users()
|
||||
Try
|
||||
Me.TBPMO_RIGHT_USERTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
Me.TBPMO_RIGHT_USERTableAdapter.Fill(Me.DD_DMSDataSet.TBPMO_RIGHT_USER)
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Refresh_Users_Groups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Sub Refresh_Rights_Groups()
|
||||
Try
|
||||
Me.TBPMO_RIGHT_GROUPTableAdapter.Connection.ConnectionString = MyConnectionString
|
||||
@@ -83,7 +126,6 @@
|
||||
Catch ex As System.Exception
|
||||
MsgBox("Error in Refresh_Entities:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TBPMO_RIGHT_GROUPBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBPMO_RIGHT_GROUPBindingSource.AddingNew
|
||||
@@ -91,14 +133,22 @@
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton1_Click(sender As Object, e As EventArgs) Handles ToolStripButton1.Click
|
||||
Save_Data()
|
||||
Save_Group_Rights_Data()
|
||||
End Sub
|
||||
|
||||
Private Sub TBPMO_RIGHT_GROUPBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBPMO_RIGHT_GROUPBindingSource.CurrentChanged
|
||||
Private Sub TBPMO_RIGHT_GROUPBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBPMO_RIGHT_GROUPBindingSource.CurrentChanged, TBPMO_RIGHT_USERBindingSource.CurrentChanged
|
||||
tschangedlabel.Visible = False
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click
|
||||
Refresh_Rights_Groups()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton3_Click(sender As Object, e As EventArgs) Handles ToolStripButton3.Click
|
||||
Save_User_Rights_Data()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton4_Click(sender As Object, e As EventArgs) Handles ToolStripButton4.Click
|
||||
Refresh_Rights_Users()
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user