以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  备注列权限问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=53392)

--  作者:643561836
--  发布时间:2014/7/7 9:42:00
--  备注列权限问题
已设置编辑权限,在列中可以按不同部门权限编辑,但在下面的备注列就不受控了,所有部门都能编辑!
图片点击可在新窗口打开查看此主题相关图片如下:002.jpg
图片点击可在新窗口打开查看

请部如何设置下面的备注列窗口才能按用户权限编辑?

--  作者:有点甜
--  发布时间:2014/7/7 9:43:00
--  
 你需要在DataColchanging里面写入对应代码,如果没有权限,就 e.Cancel = True
--  作者:643561836
--  发布时间:2014/7/7 9:54:00
--  
请问此段代码如何简化好,让不同部门编辑不同列,现在的代码如何有增加列的时候就会做好多修改?

\' 让不同部门编辑不同的列

Select Case User.Group    \' 禁止部门 编辑相关列.
 
    Case "客服部"
        Select Case e.Col.Name
            Case "PMC回复交期","物料备齐日期","外购物料标识","生产周期","在产标识","排产计划日期","物料到货标识","外购物料日期","PMC备注","生产部备注","采购部备注"
                e.Cancel = True
        End Select

   
    Case "PMC"
        Select Case e.Col.Name
            Case  "开始日期","结束日期","PMC接收日期","T6单号","产品型号","产品数量","进仓时间","发货日期","客户名称","项目名称","跟单负责人","大区","省份","城市","订单类别","单价","订单级别","创建者","在产标识","销售额","生产周期","排产计划日期","物料到货标识","外购物料日期","物流单号","业务员","订单级别","客服部备注","生产部备注","采购部备注"
                e.Cancel = True
        End Select

    Case "生产部"
        Select Case e.Col.Name
            Case  "开始日期","结束日期","PMC接收日期","PMC回复交期","物料备齐日期","T6单号","产品型号","产品数量","发货日期","客户名称","项目名称","跟单负责人","大区","省份","城市","订单类别","单价","订单级别","创建者","销售额","外购物料日期","外购物料标识","物料到货标识","物流单号","业务员","订单级别" ,"客服部备注","PMC备注","采购部备注"
                e.Cancel = True
        End Select
        
      Case "采购部"
        Select Case e.Col.Name
            Case  "开始日期","结束日期","PMC接收日期","T6单号","产品型号","产品数量","PMC回复交期","进仓时间","发货日期","客户名称","项目名称","跟单负责人","大区","省份","城市","订单类别","单价","订单级别","创建者","物料备齐日期","在产标识","销售额","在产标识","生产周期","排产计划日期","物流单号","业务员","订单级别" ,"客服部备注","PMC备注","生产部备注"

                e.Cancel = True
        End Select

 Case "销售部"
        Select Case e.Col.Name
            Case  "开始日期","结束日期","PMC接收日期","T6单号","产品型号","产品数量","PMC回复交期","异常记录","进仓时间","发货日期","客户名称","项目名称","跟单负责人","大区","省份","城市","订单类别","单价","订单级别","创建者","物料备齐日期","在产标识","销售额","外购物料日期","外购物料标识","生产周期","排产计划日期","物料到货标识","物流单号","业务员","订单级别" ,"客服部备注","PMC备注","生产部备注","采购部备注"
                e.Cancel = True
        End Select


    Case "经理"
        Select Case e.Col.Name
            Case  "开始日期","结束日期","PMC接收日期","T6单号","产品型号","产品数量","PMC回复交期","异常记录","进仓时间","发货日期","客户名称","项目名称","跟单负责人","大区","省份","城市","订单类别","单价","订单级别","创建者","物料备齐日期","在产标识","销售额","外购物料日期","外购物料标识","生产周期","排产计划日期","物料到货标识","物流单号","业务员","客服部备注","PMC备注","生产部备注","采购部备注"
                e.Cancel = True
        End Select
     
        
      
End Select


--  作者:有点甜
--  发布时间:2014/7/7 9:55:00
--  
 这个没办法,你的权限写在了事件里,增加列,肯定是要改代码的。
--  作者:有点甜
--  发布时间:2014/7/7 9:57:00
--  

 如果希望在表里面设置权限管理,可以参考 http://www.foxtable.com/help/topics/2405.htm

 


--  作者:643561836
--  发布时间:2014/7/7 9:57:00
--  
出错
图片点击可在新窗口打开查看此主题相关图片如下:003.jpg
图片点击可在新窗口打开查看

--  作者:Bin
--  发布时间:2014/7/7 9:59:00
--  
用DataCol  不要盲目套用