Foxtable(狐表)用户栏目专家坐堂 → [求助]代码问题


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

主题:[求助]代码问题

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 9:38:00 [显示全部帖子]

 

[此贴子已经被作者于2016/7/5 9:37:50编辑过]

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 9:38:00 [显示全部帖子]

 

[此贴子已经被作者于2016/7/5 9:39:14编辑过]

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 9:46:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "杆径","长度","编号"
        Dim dc As DataRow = e.DataRow
        Dim pc As DataRow
        Dim filter1 As String
        Dim filter2 As String
       
        filter2 = "编号 = '" & dc("编号") & "'"
        For Each gw As String In DataTables("生产表").GetValues("工位", filter2)
            If e.DataTable.DataCols.contains(gw) Then
                Dim nl As String = ""
                If gw = "平锻机1"
                    nl = "能力_350t"
                ElseIf gw = "平锻机2"
                    nl = "能力_450t"
                ElseIf gw = "平锻机3"
                    nl = "能力_500t"
                ElseIf gw = "平锻机4"
                    nl = "能力_800t"
                End If
                filter1 = "杆径 = '" & dc("杆径") & "' And 长度 = '" & dc("长度") & "' and " & nl & " is not Null"
                pc = DataTables("能力表").Find(filter1)
                If pc IsNot Nothing Then
                    dc(gw) = pc(nl)
                Else
                    dc(gw) = Nothing
                End If
               
            End If
        Next
       
End Select

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 11:03:00 [显示全部帖子]

Select Case e.DataCol.Name
    Case "杆径","长度","编号"
        Dim dc As DataRow = e.DataRow
        Dim pc As DataRow
        Dim filter1 As String
        Dim filter2 As String
       
        filter2 = "编号 = '" & dc("编号") & "'"
        For Each gw As String In DataTables("生产表").GetValues("工位", filter2)
            gw = "本工序_日生产能力_" & gw
            If e.DataTable.DataCols.contains(gw) Then
                Dim nl As String = ""
                If gw = "平锻机1"
                    nl = "能力_350t"
                ElseIf gw = "平锻机2"
                    nl = "能力_450t"
                ElseIf gw = "平锻机3"
                    nl = "能力_500t"
                ElseIf gw = "平锻机4"
                    nl = "能力_800t"
                End If
                filter1 = "杆径 = '" & dc("杆径") & "' And 长度 = '" & dc("长度") & "' and " & nl & " is not Null"
                pc = DataTables("能力表").Find(filter1)
                If pc IsNot Nothing Then
                    dc(gw) = pc(nl)
                Else,
                    dc(gw) = Nothing
                End If
               
            End If
        Next
       
End Select


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 11:28:00 [显示全部帖子]

Dim dc As DataRow = e.DataRow
Dim pc As DataRow

Dim filter1 As String
Dim filter2 As String

filter2 = "执行合同编号 = '" & dc("合同编号") & "'"
For Each gw As String In DataTables("生产安排表").GetValues("工位", filter2)
    gw = "本工序_日生产能力_" & gw
    If e.DataTable.DataCols.contains(gw) Then
        Dim nl As String = ""
        If gw = "平锻机1"
            nl = "日生产能力_锻造_350t"
        ElseIf gw = "平锻机2"
            nl = "日生产能力_锻造_450t"
        ElseIf gw = "平锻机3"
            nl = "日生产能力_锻造_350t"
        ElseIf gw = "平锻机4"
            nl = "日生产能力_锻造_450t"
        ElseIf gw = "平锻机5"
            nl = "日生产能力_锻造_500t"
        ElseIf gw = "平锻机6"
            nl = "日生产能力_锻造_800t"
        End If
        If nl > "" Then
            filter1 = "品种_杆径 = '" & dc("品种_杆径") & "' And 品种_长度 = '" & dc("品种_长度") & "' and " & nl & " is not Null"
            pc = DataTables("工序能力表").Find(filter1)
            If pc IsNot Nothing Then
                dc(gw) = pc(nl)
            Else
                dc(gw) = Nothing
            End If
            endif
        End If
    Next


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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 17:11:00 [显示全部帖子]

        filter2 = "执行合同编号 = '" & dc("合同编号") & "'"
dc("第一列") = 0
dc("第二列") = 0
dc("第三列") = 0
dc("第四列") = 0
        For Each gw As String In DataTables("生产安排表").GetValues("工位", filter2)

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/7/5 17:22:00 [显示全部帖子]

改成你的列名就行

 回到顶部