以文本方式查看主题

-  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=43309)

--  作者:seal51
--  发布时间:2013/12/4 11:02:00
--  逻辑列勾选


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

订单明细表里的所有5项已完成都打钩后, 订单主表里的已完成自动打钩
订单明细表里的所有5项已完成都打钩后, 订单主表里的已完成自动打钩, 发现订单明细表里有一项未完成,去掉勾后订单主表的已完成自动去掉勾勾


--  作者:Bin
--  发布时间:2013/12/4 11:10:00
--  
这个之前有人问过一模一样的问题,你到论坛上找找也许还能找到例子

在订单明细表中的DataColChanged事件
if e.datacol.name="已完成" then
   dim rlist as list(of datarow)=e.datatable.select("订单编号=\'" & e.datarow(" 订单编号") & "\' and 已完成=true")
   if rlist.count=e.datatable.select("订单编号=\'" & e.datarow(" 订单编号") &"\'").count then
     e.DataRow.GetParentRow("订单主表")("已完成")=true
    else
      e.DataRow.GetParentRow("订单主表")("已完成")=false
   end if
end if

--  作者:seal51
--  发布时间:2013/12/4 11:18:00
--  
上次就是我问的,问题没解决,再问一次, 谢谢!
--  作者:Bin
--  发布时间:2013/12/4 11:19:00
--  
都做过例子,怎么没解决? 我记得做过例子测试的.
--  作者:seal51
--  发布时间:2013/12/4 11:22:00
--  
.NET Framework 版本:2.0.50727.3649
Foxtable 版本:2013.10.14.1
错误所在事件:表,订单明细表,DataColChanged
详细错误信息:
Exception has been thrown by the target of an invocation.
Column \' 订单编号\' does not belong to table 订单明细表.

--  作者:Bin
--  发布时间:2013/12/4 11:23:00
--  
多了个空格 去一下
--  作者:seal51
--  发布时间:2013/12/4 13:38:00
--  
.NET Framework 版本:2.0.50727.3649
Foxtable 版本:2013.10.14.1
错误所在事件:表,订单明细表,DataColChanged
详细错误信息:
Exception has been thrown by the target of an invocation.
Object reference not set to an instance of an object.

--  作者:seal51
--  发布时间:2013/12/4 13:41:00
--  

发错了

 


--  作者:有点甜
--  发布时间:2013/12/4 20:10:00
--  
 If e.DataCol.name="已完成" Then
    If  e.DataRow.GetParentRow("订单主表") IsNot Nothing Then
        Dim rlist As List(of DataRow)=e.DataTable.Select("订单编号=\'" & e.DataRow(" 订单编号") & "\' and 已完成=true")
        If rlist.count=e.DataTable.Select("订单编号=\'" & e.DataRow(" 订单编号") &"\'").count Then
            e.DataRow.GetParentRow("订单主表")("已完成")=True
        Else
            e.DataRow.GetParentRow("订单主表")("已完成")=False
        End If
    End If
End If

--  作者:seal51
--  发布时间:2014/2/27 15:05:00
--  
以下是引用Bin在2013-12-4 11:10:00的发言:
这个之前有人问过一模一样的问题,你到论坛上找找也许还能找到例子

在订单明细表中的DataColChanged事件
if e.datacol.name="已完成" then
   dim rlist as list(of datarow)=e.datatable.select("订单编号=\'" & e.datarow(" 订单编号") & "\' and 已完成=true")
   if rlist.count=e.datatable.select("订单编号=\'" & e.datarow(" 订单编号") &"\'").count then
     e.DataRow.GetParentRow("订单主表")("已完成")=true
    else
      e.DataRow.GetParentRow("订单主表")("已完成")=false
   end if
 
这个代码有个问题, 就是订单明细表一旦新增数据, 订单主表的已完成就自动打钩了, 我要的是订单明细表了所有的已完成都打钩后订单主表里的已完成才能打钩, 求解!
end if