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


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

主题:条件添加

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
条件添加  发帖心情 Post By:2018/1/5 10:17:00 [只看该作者]

用户已被锁定

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | 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("生产批次")& "'")

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/5 12:19:00 [只看该作者]

用户已被锁定

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/5 13:17: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 dr3 As DataRow In dt2.Select("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "'")
        Dim dr2 As DataRow = t1.find("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "'")
        If dr2 Is Nothing Then
            dr2 = 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
        end if
    Next
Next

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/5 13:49:00 [只看该作者]

用户已被锁定

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/5 13:51:00 [只看该作者]

用户已被锁定

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/5 14:19: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 dr3 As DataRow In dt2.Select("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "' and 加工工序 = '" & dr1("加工工序") & "'")
        Dim dr2 As DataRow = t1.find("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "' and 加工工序 = '" & dr1("加工工序") & "'")
        If dr2 Is Nothing Then
            dr2 = 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
        end if
    Next
Next

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/5 15:39:00 [只看该作者]

用户已被锁定

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/1/5 17:11: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 dr3 As DataRow In dt2.Select("成品编码 = '" & dr1("成品编码")& "' and 生产批次 = '" & dr1("生产批次")& "'")
        Dim dr2 As DataRow = t1.find("成品编码 = '" & dr3("成品编码")& "' and 生产批次 = '" & dr3("生产批次")& "' and 加工工序 = '" & dr3("加工工序") & "'")
        If dr2 Is Nothing Then
            dr2 = 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
        end if
    Next
Next

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


加好友 发短信
等级:九尾狐 帖子:2159 积分:14971 威望:0 精华:0 注册:2017/10/12 13:00:00
  发帖心情 Post By:2018/1/5 21:07:00 [只看该作者]

用户已被锁定

 回到顶部
总数 11 1 2 下一页