狐爸:您帮看下面代码,为何'操作者'组能控制筛选数据,而'管理者'组不执行条件筛选了呢?
For Each t As Table In Tables
t.Visible = True
t.AllowEdit = True
For Each c As Col In t.Cols
c.Visible = True
c.AllowEdit = True
Next
Next
Tables("权限").Visible = (User.Type <> UserTypeEnum.User )
Dim zzx As String
zjl = "总经理"
If User.Group="操作者" Then
Dim dr As DataRow
dr = DataTables("员工信息库").Find("姓名= '" & User.Name & "'")
If dr IsNot Nothing Then
DataTables("绩效").LoadFilter ="[考核部门]='" & dr("部门") & "' And [建议考核人] <> '"& zjl & "'"
DataTables("绩效").Load()
Else
If User.group = "管理者" Then
DataTables("绩效").LoadFilter =" [建议考核人] <> '"& zjl & "'"
DataTables("绩效").Load()
Else
messagebox.show("此账户已停用!点击确定后将关闭程序.")
Syscmd.Project.Exit()
End If
End If
End If
If User.Type = UserTypeEnum.User Then
For Each dr As DataRow In DataTables("权限").Select("用户名 = '" & User.Name & "'" )
If dr.IsNull("列名") Then
Tables(dr("表名")).Visible = Not dr("不可见")
Tables(dr("表名")).AllowEdit = Not dr("不可编辑")
Else
Tables(dr("表名")).Cols(dr("列名")).Visible = Not dr("不可见")
Tables(dr("表名")).Cols(dr("列名")).AllowEdit = Not dr("不可编辑")
End If
Next
End If
[此贴子已经被作者于2011-6-30 20:45:10编辑过]