以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  判断着色  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=85938)

--  作者:260964006
--  发布时间:2016/6/6 11:58:00
--  判断着色


图片点击可在新窗口打开查看此主题相关图片如下:1111.jpg
图片点击可在新窗口打开查看

If e.Row.IsNull("零件名称") = False Then
    If e.Row("车型") = "售后"  Then
        If e.Row("A点_供应商简称") = Nothing Then
            If e.Col.Name = "A点_供应商简称" Then
                e.Style = "到期"
            End If
        Else  If e.Row("A点_售后含税单价") = Nothing Then
            If e.Col.Name = "A点_售后含税单价" Then
                e.Style = "到期"
            End If
        Else  If e.Row("A点_合同编号") = Nothing Then
            If e.Col.Name = "A点_合同编号" Then
                e.Style = "到期"
            End If
        Else  If e.Row("A点占比") = "100"  Then
            If e.Row("A点_供应商简称") = Nothing Then
                If e.Col.Name = "A点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_含税单价") = Nothing Then
                If e.Col.Name = "A点_含税单价" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_合同编号") = Nothing Then
                If e.Col.Name = "A点_合同编号" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_供应商简称") = Nothing Then
                If e.Col.Name = "A点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_含税单价") = Nothing Then
                If e.Col.Name = "A点_含税单价" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_合同编号") = Nothing Then
                If e.Col.Name = "A点_合同编号" Then
                    e.Style = "到期"
                End If
                If e.Row("B点_供应商简称") = Nothing Then
                    If e.Col.Name = "B点_供应商简称" Then
                        e.Style = "到期"
                    End If
                Else  If e.Row("B点_含税单价") = Nothing Then
                    If e.Col.Name = "B点_含税单价" Then
                        e.Style = "到期"
                    End If
                Else  If e.Row("B点_合同编号") = Nothing Then
                    If e.Col.Name = "B点_合同编号" Then
                        e.Style = "到期"
                    End If
                End If
            End If
        End If
    End If
End If

怎么“非售后”都不能执行呢?


--  作者:大红袍
--  发布时间:2016/6/6 12:01:00
--  

你要判断才会执行

 

If e.Row.IsNull("零件名称") = False Then
    If e.Row("车型") = "售后"  Then
        \'售后

    Else

         \'非售后

    End If

End If


--  作者:260964006
--  发布时间:2016/6/6 12:48:00
--  
怎么修改上面的程序?谢谢,我有判断啊
--  作者:大红袍
--  发布时间:2016/6/6 14:21:00
--  

看2楼啊,不同的条件,写在不同的位置啊。


--  作者:大红袍
--  发布时间:2016/6/6 14:26:00
--  

参考代码

 

If e.Row.IsNull("零件名称") = False Then
    If e.Row("车型") = "售后"  Then
        If e.Row.IsNull("A点_供应商简称") Then
            If e.Col.Name = "A点_供应商简称" Then
                e.Style = "到期"
            End If
        Else
            If e.Row.Isnull("A点_售后含税单价") Then
                If e.Col.Name = "A点_售后含税单价" Then
                    e.Style = "到期"
                End If
            Else
                \'这里继续写下一层的判断
            End If
        End  If
    Else
       
        \'非售后
       
    End If
   
End If


--  作者:260964006
--  发布时间:2016/6/6 14:56:00
--  

If e.Row.IsNull("零件名称") = False Then
    If e.Row("车型") = "售后"  Then
        If e.Row.IsNull("A点_供应商简称") Then
            If e.Col.Name = "A点_供应商简称" Then
                e.Style = "到期"
            End If
        Else
            If e.Row.Isnull("A点_售后含税单价") Then
                If e.Col.Name = "A点_售后含税单价" Then
                    e.Style = "到期"
                End If
            Else If e.Row("A点_合同编号") = Nothing Then
                If e.Col.Name = "A点_合同编号" Then
                    e.Style = "到期"
                End If
            End If
        End  If
    Else
       
        If e.Row("A点占比") = "100"  Then
            If e.Row("A点_供应商简称") = Nothing Then
                If e.Col.Name = "A点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_含税单价") = Nothing Then
                If e.Col.Name = "A点_含税单价" Then
                    e.Style = "到期"
                End If
            Else  If e.Row("A点_合同编号") = Nothing Then
                If e.Col.Name = "A点_合同编号" Then
                    e.Style = "到期"
                End If
            End If
        End  If
    Else If e.Row("A点_供应商简称") = Nothing Then
        If e.Col.Name = "A点_供应商简称" Then
            e.Style = "到期"
        End If
    Else  If e.Row("A点_含税单价") = Nothing Then
        If e.Col.Name = "A点_含税单价" Then
            e.Style = "到期"
        End If
    Else  If e.Row("A点_合同编号") = Nothing Then
        If e.Col.Name = "A点_合同编号" Then
            e.Style = "到期"
        End If
        If e.Row("B点_供应商简称") = Nothing Then
            If e.Col.Name = "B点_供应商简称" Then
                e.Style = "到期"
            End If
        Else  If e.Row("B点_含税单价") = Nothing Then
            If e.Col.Name = "B点_含税单价" Then
                e.Style = "到期"
            End If
        Else  If e.Row("B点_合同编号") = Nothing Then
            If e.Col.Name = "B点_合同编号" Then
                e.Style = "到期"
            End If
        End If
    End If
End If

               错误。


--  作者:大红袍
--  发布时间:2016/6/6 15:05:00
--  

If e.Row.IsNull("零件名称") = False Then
    If e.Row("车型") = "售后"  Then
        If e.Row.IsNull("A点_供应商简称") Then
            If e.Col.Name = "A点_供应商简称" Then
                e.Style = "到期"
            End If
        Else
            If e.Row.Isnull("A点_售后含税单价") Then
                If e.Col.Name = "A点_售后含税单价" Then
                    e.Style = "到期"
                End If
            Else
                If e.Row("A点_合同编号") = Nothing Then
                    If e.Col.Name = "A点_合同编号" Then
                        e.Style = "到期"
                    End If
                End If
            End If
        End  If
    Else
       
        If e.Row("A点占比") = "100"  Then
            If e.Row("A点_供应商简称") = Nothing Then
                If e.Col.Name = "A点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else
                If e.Row("A点_含税单价") = Nothing Then
                    If e.Col.Name = "A点_含税单价" Then
                        e.Style = "到期"
                    End If
                   
                Else
                    If e.Row("A点_合同编号") = Nothing Then
                        If e.Col.Name = "A点_合同编号" Then
                            e.Style = "到期"
                        End If
                    End If
                End  If
            End If
        Else
            If e.Row("A点_供应商简称") = Nothing Then
                If e.Col.Name = "A点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else
                If e.Row("A点_含税单价") = Nothing Then
                    If e.Col.Name = "A点_含税单价" Then
                        e.Style = "到期"
                    End If
                Else
                    If e.Row("A点_合同编号") = Nothing Then
                        If e.Col.Name = "A点_合同编号" Then
                            e.Style = "到期"
                        End If
                    End If
                End If
            End If
           
            If e.Row("B点_供应商简称") = Nothing Then
                If e.Col.Name = "B点_供应商简称" Then
                    e.Style = "到期"
                End If
            Else
                If e.Row("B点_含税单价") = Nothing Then
                    If e.Col.Name = "B点_含税单价" Then
                        e.Style = "到期"
                    End If
                Else
                    If e.Row("B点_合同编号") = Nothing Then
                        If e.Col.Name = "B点_合同编号" Then
                            e.Style = "到期"
                        End If
                    End If
                End If
            End If
        End If
    End If
End If