Foxtable(狐表)用户栏目专家坐堂 → 求一代码连接


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

主题:求一代码连接

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/25 10:17:00 [显示全部帖子]

Dim dr As DataRow = e.DataRow
Dim dt1 As DataTable = DataTables("入库")
Dim dt2 As DataTable = DataTables("出库")
Select Case  e.DataCol.Name
    Case  "序号"
        dr("入库数量") = dt1.Compute("Sum(入库数量)","[序号] = '" & dr("序号") & "'")
        dr("入库额") = dt1.Compute("Sum(入库额)","[序号] = '" & dr("序号") & "'")
        dr("出库数量") = dt2.Compute("Sum(出库数量)","[序号] = '" & dr("序号") & "'")
        dr("出库额") = dt2.Compute("Sum(出库额)","[序号] = '" & dr("序号") & "'")
    Case "入库数量","出库数量"
        For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
            Dim Val1 As Double = e.DataTable.Compute("Sum(入库数量)","[_SortKey] <= " & dr("_SortKey"))
            Dim Val2 As Double = e.DataTable.Compute("Sum(出库数量)","[_SortKey] <= " & dr("_SortKey"))
            dr("库存量") = Val1 - Val2
        Next
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/25 11:02:00 [显示全部帖子]

Dim dr As DataRow = e.DataRow
Dim dt1 As DataTable = DataTables("入库")
Dim dt2 As DataTable = DataTables("出库")
Select Case e.DataCol.Name
    Case  "序号"
        dr("入库数量") = dt1.Compute("Sum(入库数量)","[序号] = '" & dr("序号") & "'")
        dr("入库额") = dt1.Compute("Sum(入库额)","[序号] = '" & dr("序号") & "'")
        dr("出库数量") = dt2.Compute("Sum(出库数量)","[序号] = '" & dr("序号") & "'")
        dr("出库额") = dt2.Compute("Sum(出库额)","[序号] = '" & dr("序号") & "'")
    Case "入库数量","出库数量"
        For Each dr2 As DataRow  In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
            Dim Val1 As Double = e.DataTable.Compute("Sum(入库数量)","[_SortKey] <= " & dr2("_SortKey"))
            Dim Val2 As Double = e.DataTable.Compute("Sum(出库数量)","[_SortKey] <= " & dr2("_SortKey"))
            dr2("库存量") = Val1 - Val2
        Next
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
狐狸爸爸
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2011/8/25 11:29:00 [显示全部帖子]

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:进销存.rar


 回到顶部