Foxtable(狐表)用户栏目专家坐堂 → [公告]关于BOM的展开


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

主题:[公告]关于BOM的展开

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:112432 积分:572434 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/8/26 15:12:00 [显示全部帖子]

Dim dt As DataTable = DataTables("物料清单")
DataTables("表c").DataRows.Clear
Dim txt1 = e.Form.Controls("textbox1").text
Dim txt2 = val(e.Form.Controls("textbox2").text)
Dim filter As String
If txt1 > "" Then
    filter = "主物料 = '" & txt1 & "'"
Else
    filter = "主物料 is null"
End If
Dim drs As List(of DataRow) =dt.SQLSelect(filter)
Dim lst As new List(of String)
Do While drs.Count > 0
    lst.Clear
    For Each dr As DataRow In drs
        Dim bh As String = dr("子物料")
        Dim ndr As DataRow = DataTables("表c").AddNew
        ndr("物料编码") = bh
        lst.Add(bh)
        Dim fdr As DataRow = DataTables("产品表").Find("物料编码 = '" & bh & "'")
        If fdr IsNot Nothing Then
            ndr("物料名称") = fdr("物料名称")
        End If
        ndr("用量") = dr("用量")
        ndr("需求量") = dr("用量") * txt2
        'Functions.Execute("sum",dr, txt2)
    Next
    drs = dt.SQLSelect("主物料 in ('" & String.Join("','",lst.ToArray) & "')")
Loop

 回到顶部