Foxtable(狐表)用户栏目专家坐堂 → 条件添加


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

主题:条件添加

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


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/1/5 11:52:00 [显示全部帖子]

这个意思?

For Each dr3 As DataRow In dt2.Select("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "'")

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


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/1/5 22:51:00 [显示全部帖子]

Dim t1 As DataTable = e.Form.Controls("毛坯工序").Table.DataTable
Dim dt1 As DataTable = DataTables("毛坯工序维护_条码维护")
Dim dt2 As DataTable = DataTables("生产排产表")
Dim Cols1() As String = {"成品编码","毛坯编码","生产批次","批次序号","毛坯产地","投产日期"}
Dim Cols2() As String = {"成品编码","毛坯编码","生产批次","批次序号","毛坯产地","投产日期"}
Dim Cols3() As String = {"加工工序","加工内容","成品描述"}
Dim Cols4() As String = {"加工工序","加工内容","成品描述"}
For Each dr1 As DataRow In dt1.Select("")
    For Each arr As String() In dt2.GetValues("成品编码|生产批次|加工工序","成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "'")
        Dim dr3 As DataRow = dt2.find("成品编码 = '" & arr(0) & "' and 生产批次 = '" & arr(1) & "' and 加工工序 = '" & arr(2) & "'")
        Dim dr2 As DataRow = t1.AddNew()
        For i As Integer = 0 To Cols1.Length -1
            dr2(Cols2(i)) = dr1(Cols1(i))
        Next
        For i As Integer = 0 To Cols3.Length -1
            dr2(Cols4(i)) = dr3(Cols3(i))
        Next
    Next
Next

 回到顶部