Foxtable(狐表)用户栏目专家坐堂 → 请教


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

主题:请教

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


加好友 发短信
等级:幼狐 帖子:139 积分:1110 威望:0 精华:0 注册:2013/10/9 11:32:00
请教  发帖心情 Post By:2014/3/19 8:57:00 [只看该作者]

Select Case e.DataCol.Name
    Case
"产品","入库","出库"
        Dim
dr As DataRow
        Dim
mr As DataRow = e.DataRow
        Dim
drs As List(of DataRow)
        dr
= e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [产品] = '" & mr("产品") & "'", "[_SortKey] Desc"
)
        If
dr Is Nothing Then
            mr
("库存") = mr("入库") - mr("出库"
)
            dr
=
mr
        End If

        drs
= e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [产品] = '" & dr("产品") & "'"
, "[_SortKey]")
        For
i As Integer = 1 To drs.Count - 1
           
drs(i)("库存") = drs(i-1)("库存") + drs(i)("入库") - drs(i)("出库")
        Next
        If
e.DataCol.Name = "产品" AndAlso e.OldValue IsNot Nothing AndAlso e.OldValue <> e.NewValue Then
            dr
= e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [产品] = '" & e.OldValue & "'", "[_SortKey] Desc"
)
            If
dr Is Nothing Then
                dr
= e.DataTable.Find("[产品] = '" & e.OldValue & "'", "[_SortKey]"
)
                If
dr IsNot Nothing Then
                    dr
("库存") = dr("入库") - dr("出库"
)
                End If
            End If
            If
dr IsNot Nothing Then
                drs
= e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [产品] = '" & dr("产品") & "'"
, "[_SortKey]")
                For
i As Integer = 1 To drs.Count - 1
               
    drs(i)("库存") = drs(i-1)("库存") + drs(i)("入库") - drs(i)("出库")
                Next
            End If
        End If
End Select






代码有错误吗???

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


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/3/19 9:00:00 [只看该作者]

请问你要实现的效果是什么,以上代码出现什么错?

能上个例子就更好了.

 回到顶部