Foxtable(狐表)用户栏目专家坐堂 → [求助]关于索引数据并自动填充的问题


  共有4114人关注过本帖平板打印复制链接

主题:[求助]关于索引数据并自动填充的问题

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/12/10 11:08:00 [只看该作者]

  Select Case e.DataCol.Name
    Case "车间名称","工序明细","产品图号"
        If e.DataRow.IsNull("车间名称") Then
            e.DataRow("工时明细") = Nothing
        Else
            Dim filter As String = "产品图号 = '" & e.DataRow("产品图号") & "'"
            Dim fdr As DataRow = DataTables("工时统计表").Find(filter)
            Dim sum As Double = 0
            Dim str As String = ""
            If fdr IsNot Nothing Then
                For Each dc As DataCol In DataTables("工时统计表").DataCols
                    If dc.Name.StartsWith("工序_") AndAlso fdr(dc.name) > 0 Then
                        Dim dr As DataRow = DataTables("工序明细").Find("车间 = '" & e.DataRow("车间名称") & "' and 工序列名称 = '" & dc.Name & "'")
                        If dr IsNot Nothing Then
                            str &= dr("工序名称") & ","
                        End If
                        sum += fdr(dc.name)
                    End If
                Next
            End If
            e.DataRow("工序明细") = str.trim(",")
            e.DataRow("工时明细") = sum
        End If
End Select

 回到顶部
总数 26 1 2 3 下一页