Foxtable(狐表)用户栏目专家坐堂 → 登陆者不能在窗口中查找


  共有1973人关注过本帖树形打印复制链接

主题:登陆者不能在窗口中查找

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/26 10:45:00 [显示全部帖子]

If e.Sender.Name.SubString(0,4) = "_cmb" Then '如果名称符合
    Dim cmb As WinForm.ComboBox = e.Sender
    If cmb.Items.Count > 0 Then  '如果已经设置了项目
        Return '则返回
    End If
    Dim t  As  Table = cmb.BindTable '获得绑定的Table
    Dim c As Col = cmb.BindCol '获得绑定的Col
    Dim dr As  DataRow =  DataTables("组合框代码").Find("[表] = '" & t.Name & "' And [列] = '" & c.Name &  "'")
    If dr IsNot Nothing Then  '如果在项目表找到对应的行
        cmb.Combolist = dr("列表项目") '则设置列表项目
    End If
End  If

Dim ctl As WinForm.Control = e.Sender
Dim r As Row = Tables("制造质量管理").Current
If r IsNot Nothing Then
    If User.Name = "开发者" Then
        ctl.ReadOnly = BooleanEnum.False '允许编辑
    Else
        If User.Name = r("检验员") Then
            ctl.ReadOnly = BooleanEnum.False '允许编辑
        Else
            ctl.ReadOnly = BooleanEnum.True '禁止编辑
        End If
    End If
End If
If ctl.name = "TextBox17" Then
    If User.Name = "开发者" Then
        ctl.ReadOnly = BooleanEnum.False '允许编辑
    Else
        ctl.ReadOnly = BooleanEnum.True
    End If
End If


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/26 22:39:00 [显示全部帖子]

以下是引用cxmxjwlmq在2018/4/26 22:05:00的发言:

甜老师:我把代码加到后面,但还是不行,别的登陆者登陆还是不能用查询

 

 

不明白你到底要实现什么。是允许使用还是不能使用?

 

If ctl.name = "TextBox17" Then
    If User.Name = "开发者" Then
        ctl.ReadOnly = BooleanEnum.False '允许编辑
    Else
        ctl.ReadOnly = BooleanEnum.False '允许编辑
    End If
End If


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/26 22:45:00 [显示全部帖子]

看4楼代码。

 回到顶部