以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  禁止编辑不起作用  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=18551)

--  作者:lsfdf
--  发布时间:2012/4/17 11:10:00
--  禁止编辑不起作用

禁止编辑不起作用是

Select Case e.DataCol.Name

    Case "发货确认"

        Dim dt As DataTable = DataTables("产品表")

        Dim drs As List(Of DataRow) \'定义一个DataRow集合

        drs = dt.Select("编码 = \'" & e.DataRow("编码") & "\'and 批次 = \'" & e.DataRow("批次") & "\'")

     If drs.Count = 0 Then

     

      If e.DataCol.Name = "发货确认" Then \'如果修改的是标注列

       MessageBox.Show("无相关产品")

             e.Cancel = True \'那么禁止编辑

        End If

    End If

        e.DataRow.Save()    

  

End Select

<!--EndFragment-->

 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:管理项目1.table


--  作者:狐狸爸爸
--  发布时间:2012/4/17 11:57:00
--  
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目345.table


--  作者:czy
--  发布时间:2012/4/17 12:06:00
--  
Select Case e.DataCol.Name
    Case "发货确认"
        If e.NewValue = True Then
            Dim dr As DataRow = DataTables("产品表").Find("编码 = \'" & e.DataRow("编码") & "\'and 批次 = \'" & e.DataRow("批次") & "\'")
            If dr Is Nothing Then
                MessageBox.Show("无相关产品")
                e.DataRow("发货确认") = e.OldValue
            End If
        End If
End Select