Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:求代码

1楼
wqc360 发表于:2010/3/15 16:45:00
求红色部分正确代码,意思是当关联表“生产目录”的“工艺工时_天数”列单元格不为空值时,往下执行
if e.DataCol.Name = "图号"  OrElse e.DataCol.Name = "工序_序号" Then
    if dr.IsNull("图号")  OrElse dr.IsNull("派工单号") OrElse dr.IsNull("工序_序号") OrElse dr.IsNull("工艺工时_天数") OrElse dr("状态") = "暂停" Then
        dr("计划日期_结束") = Nothing
        dr("计划日期_开始") = Nothing
    Else
        Dim Sum As Double = Tables("生产工序").Compute("Sum(工艺工时_天数)","[图号] = '" & dr("图号") & "' And [派工单号] = '" & dr("派工单号") & "' And [状态]= '执行'  And [工序_序号] <= " & dr("工序_序号") )
        Dim Sum1 As Double = Tables("生产工序").Compute("Sum(工艺工时_天数)","[图号] = '" & dr("图号") & "' And [派工单号] = '" & dr("派工单号") & "' And [状态]= '执行' And [工序_序号] >= " & dr("工序_序号"))
        Dim pr As DataRow = dr.GetParentrow("生产目录")
        Dim pr1 As String = pr("工艺工时_天数")
        if pr1 IsNot Nothing Then
            if pr IsNot Nothing Then
                dr("计划日期_结束") = pr("到料日期").AddDays(Sum * (pr("生产周期")/pr("工艺工时_天数")))
                dr("计划日期_开始") = pr("完工日期").AddDays(-Sum1 * (pr("生产周期")/pr("工艺工时_天数"))+0.5)
            Else
                dr("计划日期_结束") = Nothing
                dr("计划日期_开始") = Nothing
            End If
        End If
    End If
End If
2楼
mr725 发表于:2010/3/15 17:06:00
If pr.IsNull("工艺工时_天数")
3楼
wqc360 发表于:2010/3/15 21:32:00
谢谢mr725
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.