For Each c As Winform.Control In e.Form.Controls
If Typeof c Is WinForm.button Then
If User.IsRole("查看") Then
If e.sender.name = "btndyyl" Or e.sender.name = "btnzjdy" Then
c.Enabled = True
Else
c.Enabled = False
End If
Else
c.Enabled = True
End If
End If
Next
角色等于“查看”时,窗口中的按钮只有两个可用,其余不可用。
角色不等于“查看”时,窗口中的按钮全部可以用。
如何修改代码?