Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]无法触发datacolchanged事件

1楼
dahai 发表于:2024/5/21 11:04:00

想完成的任务《返仓单》库房确认列 鼠标点击 待返仓—>已返仓,触发了《返仓单》的datacolchanged事件,修改了阿里云后台表《返仓明细》 库房确认列,由待返仓—>已返仓,触发返仓明细的datacolchanged事件。但是发现无法触发《返仓明细》的datacolchanged事件,我在论坛查看了相关问题解答,论坛上说“
只有在foxtable里的表格更改数据才能触发DataColChanged。直接更改后台数据不会触发foxtable的任何事件
我想问的是,有什么好办法能够同步触发吗?



表《返仓单》中的datacolchanged设置代码如下:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim frs As list(Of DataRow) = DataTables("返仓明细").SQLSelect("返仓单号 = '" & e.DataRow("返仓单号") & "'")
        For Each fr As DataRow In frs
            fr("库房确认") = "已返仓"
            fr.Save()
        Next 
    End If
end if

《返仓明细》的datacolchanged事件代码:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim fr As DataRow = DataTables("入库明细").SQLFind("入库单号 = '" & e.DataRow("入库单号") & "'")
        If fr IsNot Nothing Then
            e.DataRow("供应商") = fr("供应商")
            e.DataRow("入库用途") = fr("入库用途")
            e.DataRow("入库分类") = fr("分类")
            e.DataRow("备注") = fr("备注")
        End If
     end if
end if
2楼
有点蓝 发表于:2024/5/21 11:14:00
表《返仓单》中的datacolchanged设置代码如下:
If e.DataCol.Name = "库房确认" Then
    If e.OldValue = "待返仓" And e.NewValue = "已返仓" Then
        Dim frs As list(Of DataRow) = DataTables("返仓明细").SQLSelect("返仓单号 = '" & e.DataRow("返仓单号") & "'")
        For Each dr As DataRow In frs
dim s as string = dr("库房确认")
            dr("库房确认") = "已返仓"
if s = "待返仓" then
        Dim fr As DataRow = DataTables("入库明细").SQLFind("入库单号 = '" & dr("入库单号") & "'")
        If fr IsNot Nothing Then
            dr("供应商") = fr("供应商")
            dr("入库用途") = fr("入库用途")
            dr("入库分类") = fr("分类")
            dr("备注") = fr("备注")
        End If
end if
        Next 
DataTables("返仓明细").SQLUpdate(frs)
    End If
end if

SQLSelect必须由SQLUpdate保存:http://www.foxtable.com/webhelp/topics/2901.htm
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01953 s, 2 queries.