Foxtable(狐表)用户栏目专家坐堂 → 列的编辑问题


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

主题:列的编辑问题

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


加好友 发短信
等级:六尾狐 帖子:1462 积分:9802 威望:0 精华:0 注册:2020/11/4 22:15:00
列的编辑问题  发帖心情 Post By:2025/4/16 9:49:00 [只看该作者]

如何实现按当前用户限制表A的列是否编辑?需求如图,下面代码如何改?
Select Case User.Name
    Case
 "张三",
"李四"
        
Select Case e.Col.Name
            Case
 "第一列","第二列","第三列"

                e.Cancel = 
True
        
End Select
    
Case "王五""赵六"
        
Select Case e.Col.Name
            Case
 "第四列","第五列","第六列"

                e.Cancel = 
True
        
End Select
End
 Select
If
 e.Col.Name = "第十列" Then
    If User.Name <> "张经理" Then
        e.Cancel = 
True
    
End If
End
 If


图片点击可在新窗口打开查看此主题相关图片如下:列是否可编辑.jpg
图片点击可在新窗口打开查看


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


加好友 发短信
等级:超级版主 帖子:113511 积分:578050 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2025/4/16 10:09:00 [只看该作者]

Select Case e.Col.Name
   Case
 "直接上级","间接上级"
if e.row("经办人") = user.name
      e.Cancel = 
True
end if
End Select

Select Case e.Col.Name
   Case
 "直接上级意见"
case else
if e.row("直接上级") = user.name
      e.Cancel = 
True
end if
   Case "间接上级意见"
case else
if e.row("间接上级") = user.name
      e.Cancel = 
True
end if
End Select
if e.row("审核") = "已审核"
      e.Cancel = 
True
end if

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


加好友 发短信
等级:六尾狐 帖子:1462 积分:9802 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2025/4/16 10:33:00 [只看该作者]

Select Case e.Col.Name
   Case
 "直接上级意见"
case else
if e.row("直接上级") = user.name
      e.Cancel = 
True
end if
   Case "间接上级意见"
case else
if e.row("间接上级") = user.name
      e.Cancel = 
True
end if
End Select

报错不能同在一起

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


加好友 发短信
等级:超级版主 帖子:113511 积分:578050 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2025/4/16 10:53:00 [只看该作者]


[此贴子已经被作者于2025/4/16 10:53:13编辑过]

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


加好友 发短信
等级:六尾狐 帖子:1462 积分:9802 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2025/4/16 10:54:00 [只看该作者]

Select Case e.Col.Name
   Case
 "直接上级","间接上级"
if e.row("经办人") = user.name
      e.Cancel = 
True
end if
End Select

Select Case e.Col.Name
   Case
 "直接上级意见"
case else
if e.row("直接上级") = user.name
      e.Cancel = 
True
end if
End Select
Select Case e.Col.Name
   Case "间接上级意见"
case else
if e.row("间接上级") = user.name
      e.Cancel = 
True
end if
End Select
if e.row("审核") = "已审核"
      e.Cancel = 
True
end if


执行后,没限制列的编辑,没达到需求,如何改?

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


加好友 发短信
等级:超级版主 帖子:113511 积分:578050 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2025/4/16 10:54:00 [只看该作者]

Select Case e.Col.Name
   Case
 "直接上级意见"
case else
if e.row("直接上级") = user.name
      e.Cancel = 
True
end if
End Select
Select Case e.Col.Name
   Case "间接上级意见"
case else
if e.row("间接上级") = user.name
      e.Cancel = 
True
end if
End Select

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


加好友 发短信
等级:六尾狐 帖子:1462 积分:9802 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2025/4/16 12:03:00 [只看该作者]

执行后,当前登录用户是张三时,全部列都可以编辑,需求是"直接上级意见"和"间接上级意见"列是不编辑,其他列是可编辑,还是达不到需求是什么原因如何改?

_user.name设为用户的全局变量

Select Case e.Col.Name
   Case
 "直接上级","间接上级"
if e.row("经办人") = _user.name
      e.Cancel = True
end if
End Select
Select Case e.Col.Name
   Case
 "直接上级意见"
case else
if e.row("直接上级") = _user.name
      e.Cancel = True
end if
End Select
Select Case e.Col.Name
   Case "间接上级意见"
case else
if e.row("间接上级") = _user.name
      e.Cancel = True
end if
End Select

if e.row("审核") = "已审核"
      e.Cancel = 
True
end if


执行后,对窗口上表绑定窗口的控件的文本框没限制,如何改?
[此贴子已经被作者于2025/4/16 12:30:33编辑过]

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


加好友 发短信
等级:超级版主 帖子:113511 积分:578050 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2025/4/16 13:30:00 [只看该作者]

窗口控件参考:http://www.foxtable.com/webhelp/topics/2342.htm

表格权限请上传实例说明

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


加好友 发短信
等级:六尾狐 帖子:1462 积分:9802 威望:0 精华:0 注册:2020/11/4 22:15:00
  发帖心情 Post By:2025/4/16 14:50:00 [只看该作者]

Dim ctl As WinForm.Control = e.Sender
Select
 Case ctl.BindingField
    Case 
"
Tables("窗口_Table1").Cols("日期")", "A.第二列""A.第三列"
        If User.Name = 
"
张三" Then
            ctl.ReadOnly = BooleanEnum.False 
'
允许编辑
        Else
            ctl.ReadOnly = BooleanEnum.True 
'
禁止编辑
        End If

"Tables("窗口_Table1").Cols("日期")", 报错?


Dim c1 As Col = Tables("窗口_Table1").Cols("直接上级")
Dim ctl As WinForm.Control = e.Sender
Select Case ctl.BindingField
    Case "r.直接上级意见"
        If c1 = _HLName Then   报错提示,Col无法转string?如何改?
            ctl.ReadOnly = BooleanEnum.False '允许编辑
        Else
            ctl.ReadOnly = BooleanEnum.True '禁止编辑
        End If
[此贴子已经被作者于2025/4/16 15:15:15编辑过]

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


加好友 发短信
等级:超级版主 帖子:113511 积分:578050 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2025/4/16 15:20:00 [只看该作者]

建议重头学一遍编程基础

Case "窗口_Table1.日期"

If c1.name = _HLName Then

 回到顶部
总数 14 1 2 下一页