Foxtable(狐表)用户栏目专家坐堂 → 下拉输入窗口出错


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

主题:下拉输入窗口出错

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/1/21 15:53:00 [显示全部帖子]

 

If  e.DataRow.GetChildRows("执行动态").Count > 0 Then
    e.DataRow.GetChildRows("执行动态")(0)("欠交数量") = e.DataRow("计划数量")
End If


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/1/21 16:06:00 [显示全部帖子]

写在前面

 

 

Select Case e.DataCol.Name                    '采用流水账设计,自动计算是否交完货
    Case "欠交数量"
        If e.DataRow ("欠交数量") = 0 Then
            Dim nma() As String = {"计划编号","车号","入库单号"}  'A表数据来源列
            Dim nmb() As String = {"计划编号","车号","入库单号"}  'B表数据接收列
            Dim drr As DataRow = DataTables("合同明细").AddNew
            For i As Integer = 0 To nma.Length - 1
                drr(nmb(i)) = e.DataRow(nma(i))
            Next
        End If
    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
            Dim drr As DataRow = DataTables("订单").find("计划编号='" & mr("计划编号") & "'")
            mr("欠交数量") = drr("计划数量") - 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)("实际交货数量")
        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
                    Dim drr As DataRow = DataTables("订单").find("计划编号='" & mr("计划编号") & "'")
                    dr("欠交数量") = drr("计划数量") - dr("实际交货数量")
                End If
            End If
            If dr IsNot Nothing Then
                drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [计划编号] = '" & dr("计划编号") & "'", "[_SortKey]")
                Dim drr As DataRow = DataTables("订单").find("计划编号='" & dr("计划编号") & "'")
                If drr IsNot Nothing Then
                    drs(0)("欠交数量")= drr("计划数量")
                End If
                For i As Integer = 1 To drs.Count - 1
                    drs(i)("欠交数量") = drs(i-1)("欠交数量") - drs(i)("实际交货数量")
                Next
            End If
        End If
End Select


 回到顶部