Foxtable(狐表)用户栏目专家坐堂 → 求助:按条件引用数据


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

主题:求助:按条件引用数据

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2015/1/14 20:58:00 [显示全部帖子]

datacolchanged事件

 

Select Case e.DataCol.Name
    Case "客户名称","物品种类", "入厂时间"
        If e.DataRow.IsNull("客户名称") OrElse e.DataRow.IsNull("物品种类") Then
            e.DataRow("应收金额") = Nothing
        Else
            Dim dt1 As DataTable = DataTables("客户信息")
            Dim fdr1, fdr2 As DataRow
            If dt1.DataCols.Contains("物品种类_" & e.DataRow("物品种类")) Then
                fdr1 = dt1.Find("客户名称 = '" & e.DataRow("客户名称") & "'")
                If fdr1 IsNot Nothing Then
                    e.DataRow("应收金额") = fdr1("物品种类_" & e.DataRow("物品种类"))
                End If
            End If
            If e.DataRow.IsNull("入厂时间") = False Then
                dt1 = DataTables("价格时限")
                fdr2 = dt1.Find("物品种类 = '" & e.DataRow("物品种类") & "'")
                If fdr2 IsNot Nothing Then
                    e.DataRow("清洗时限") = fdr2("清洗时限_" & cdate(e.DataRow("入厂时间")).Month & "月")
                   
                    If fdr1 Is Nothing Then
                        e.DataRow("应收金额") = fdr2("清洗价格")
                    End If
                End If
            End If
           
        End If
End Select


 回到顶部