Foxtable(狐表)用户栏目专家坐堂 → [求助]关于数据表关联的问题


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

主题:[求助]关于数据表关联的问题

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2013/4/20 14:09:00 [显示全部帖子]

表1的DataColChanged事件中
IF e.dataCol.Name="状态" then
  IF e.dataRow("状态")="取消" then
   dim rList as List(of datarow) = datatables("表2").select("单号='" & e.datarow("单号") & "'")
   for i as Integer = 0 to rList.Count - 1
     rList(i)("状态")="取消"
    next
  end if
end if


表2的 DataCloChanged事件中
if e.dataCol.Name = "状态" then
  IF e.dataRow("状态")="取消" then
   dim rList as List(of datarow) = datatables("表2").select("单号='" & e.datarow("单号") & "'")
   dim isCancel as Boolean = false
   for i as Integer = 0 to rList.Count - 1
     if rList(i)("状态")="确认" then
       isCancel = True
     end if
    next
   if isCancel=false then
    datatables("表1").Find("单号='" & e.datarow("单号") & "'")("状态")="取消"
   end if
  end if
end if



 回到顶部