以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 权限管理错误 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=32207) |
-- 作者:wzy20071130 -- 发布时间:2013/4/27 13:36:00 -- 权限管理错误 我用这个权限小例http://www.foxtable.com/bbs/dispbbs.asp?boardid=5&Id=23959&page=2 导入到我自己做的系统里面 可是在项目属性那afteropenproject这里放入 For Each t As Table In Tables t.Visible = False For Each c As col In t.Cols c.Visible = False c.AllowEdit = False Next Next Forms("登录窗口").Show() Dim roles() As String = _userGroup.Split(",") For Each role As String In roles Dim drs As List(Of DataRow) = DataTables("权限").Select("可见 = \'" & role & "\' or 可见 like \'" & role & ",*\' or 可见 like \'*," & role & ",*\' Or 可见 like \'*," & role & "\'") For Each dr As DataRow In drs If dr.Isnull("表名") AndAlso dr.Isnull("列名") Then For Each t As Table In Tables t.Visible = True Next Else If dr.isnull("列名") Then Tables(dr("表名")).Visible = True For Each c As col In Tables(dr("表名")).Cols c.Visible = True Next Else Tables(dr("表名")).Visible = True For Each c As col In Tables(dr("表名")).Cols If dr("列名") = c.name OrElse dr("列名") Like c.name & ",*" OrElse dr("列名") Like "*," & c.name & ",*" OrElse dr("列名") Like "*," & c.name Then c.Visible = True End If Next End If Next drs = DataTables("权限").Select("可编辑 = \'" & role & "\' or 可编辑 like \'" & role & ",*\' or 可编辑 like \'*," & role & ",*\' Or 可编辑 like \'*," & role & "\'") For Each dr As DataRow In drs If dr.Isnull("表名") AndAlso dr.Isnull("列名") Then For Each t As Table In Tables t.Visible = True t.AllowEdit = True Next Else If dr.isnull("列名") Then Tables(dr("表名")).Visible = True For Each c As col In Tables(dr("表名")).Cols c.Visible = True c.AllowEdit = True Next Else Tables(dr("表名")).Visible = True For Each c As col In Tables(dr("表名")).Cols If dr("列名") = c.name OrElse dr("列名") Like c.name & ",*" OrElse dr("列名") Like "*," & c.name & ",*" OrElse dr("列名") Like "*," & c.name Then c.Visible = True c.AllowEdit = True End If Next End If Next Next 却提示错误代码:Dim roles() As String = _userGroup.Split(",") 不然我放入代码 怎么回事啊?
|
-- 作者:zerov -- 发布时间:2013/4/27 14:06:00 -- roles在全局代码设置了没有? |
-- 作者:wzy20071130 -- 发布时间:2013/4/28 10:49:00 -- 以下是引用zerov在2013-4-27 14:06:00的发言: roles在全局代码设置了没有? 谢谢,是这个情况 我改了后,登录了一下 每次都需要登录俩次 弹出俩次登录窗口 一次是fox自带的 一个是我新建的窗口 怎么让fox自带的窗口不弹出啊?
|
-- 作者:XYT -- 发布时间:2013/4/28 10:52:00 -- http://www.foxtable.com/help/topics/2729.htm
|
-- 作者:wzy20071130 -- 发布时间:2013/4/28 11:24:00 -- 我文件里面没有这俩个文件啊logform1.txt logform2.txt [此贴子已经被作者于2013-4-28 11:24:31编辑过]
|
-- 作者:狐狸爸爸 -- 发布时间:2013/4/28 14:29:00 -- 设置默认用户就行了: http://www.foxtable.com/help/topics/1796.htm
|