以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  排除条件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=90983)

--  作者:lk15502
--  发布时间:2016/9/27 8:46:00
--  排除条件
订单表有交货日期,订单状态两列,希望交货日期到期和不到7天时显示两个表式样,但希望排除”订单状态"是:未审核,已入库,部分出库,全部出库的。其中的逻辑吧我搞乱了,请教老师,
If e.Col.Name = "交货日期" AndAlso e.Row.Isnull("交货日期") = False Then
    If  e.Row("交货日期") < Date.today.adddays(7) Then
        e.Style = "b"
    ElseIf e.Row("交货日期") < Date.Today Then
        e.style = "a"
    End If
End If

--  作者:有点蓝
--  发布时间:2016/9/27 8:57:00
--  
if  e.Row("订单状态")="未审核" orelse e.Row("订单状态")="已入库" orelse ...补上其它状态... then
return
end if

If e.Col.Name = "交货日期" AndAlso e.Row.Isnull("交货日期") = False Then
    If  e.Row("交货日期") < Date.today Then
        e.Style = "a"
    ElseIf e.Row("交货日期") < Date.today.adddays(7)  Then
        e.style = "b"
    End If
End If

--  作者:lk15502
--  发布时间:2016/9/27 9:24:00
--  
谢谢老师,可以了,但为什么下面的代码就不成:
if  e.Row("订单状态")="未审核" orelse e.Row("订单状态")="已入库" orelse ...补上其它状态... then
return
     If e.Col.Name = "交货日期" AndAlso e.Row.Isnull("交货日期") = False Then
             If  e.Row("交货日期") < Date.today Then
                    e.Style = "a"
             ElseIf e.Row("交货日期") < Date.today.adddays(7)  Then
                     e.style = "b"
             End If
      End If
end if


--  作者:有点蓝
--  发布时间:2016/9/27 9:33:00
--  
if  e.Row("订单状态")="未审核" orelse e.Row("订单状态")="已入库" orelse ...补上其它状态... then
return
else
     If e.Col.Name = "交货日期" AndAlso e.Row.Isnull("交货日期") = False Then
             If  e.Row("交货日期") < Date.today Then
                    e.Style = "a"
             ElseIf e.Row("交货日期") < Date.today.adddays(7)  Then
                     e.style = "b"
             End If
      End If
end if

--  作者:lk15502
--  发布时间:2016/9/27 10:00:00
--  
明白了