此主题相关图片如下:111.png
此主题相关图片如下:222.png
这个条件加载的思路是怎么样做的 Dim kh As String =
e.Form.Controls("ComboBox1").Value |
Dim hp As String =
e.Form.Controls("ComboBox2").Value |
Dim ywy As String =
e.Form.Controls("ComboBox3").Value |
Dim b As New
SQLJoinTableBuilder("查询表1","O_Sale1Detail") |
b.C |
b.AddTable("O_Sale1Detail","GoodsId","B_Goods","GoodsId")
\'添加统计表 |
b.AddTable("O_Sale1Detail","BillNo","O_Sale1","BillNo")
\'添加统计表 |
b.AddTable("B_Goods","TypeCode","B_GoodsType","Code")
\'添加统计表 |
b.AddTable("O_Sale1","ClientID","B_Client","ClientId") |
b.AddTable("O_Sale1","ExeManID","B_Employ","EmployID") |
b.AddExp("单据编号","{O_Sale1Detail}.BillNo") |
b.AddExp("客户代码","{B_Client}.Code") |
b.AddExp("客户名称","{B_Client}.Name") |
b.AddExp("货品代码","{B_Goods}.Code") |
If kh IsNot Nothing And hp IsNot Nothing
And ywy IsNot Nothing Then |
b.filter = "{B_Employ}.Name = \'" & ywy & "\' and
{B_Client}.Name = \'" & kh & "\' and {O_Sale1}.BillDate >=
\'" & A & "\' And {O_Sale1}.BillDate <= \'" & C
& " \' and {B_Goods}.Name = \'" & hp & "\' " |
Else |
If kh IsNot Nothing And ywy IsNot Nothing Then |
b.filter = "{B_Employ}.Name = \'" & ywy & "\' and
{B_Client}.Name = \'" & kh & "\' and {O_Sale1}.BillDate >=
\'" & A & "\' And {O_Sale1}.BillDate <= \'" & C
& " \' " |
Else |
If ywy IsNot Nothing And hp IsNot Nothing Then |
b.filter = "{B_Employ}.Name
= \'" & ywy & "\' and {O_Sale1}.BillDate >= \'" &
A & "\' And {O_Sale1}.BillDate <= \'" & C & " \'
and {B_Goods}.Name = \'" & hp & "\' " |
Else |
If kh IsNot Nothing And hp IsNot
Nothing Then |
b.filter =
"{B_Client}.Name = \'" & kh & "\' and {O_Sale1}.BillDate
>= \'" & A & "\' And {O_Sale1}.BillDate <= \'"
& C & " \' and {B_Goods}.Name = \'" & hp & "\'
" |
Else |
If ywy IsNot Nothing Then |
b.filter =
"{B_Employ}.Name = \'" & ywy & "\' and
{O_Sale1}.BillDate >= \'" & A & "\' And {O_Sale1}.BillDate
<= \'" & C & " \'" |
Else |
If hp IsNot Nothing Then |
b.filter =
"{B_Goods}.Name = \'" & hp & "\' and {O_Sale1}.BillDate
>= \'" & A & "\' And {O_Sale1}.BillDate <= \'"
& C & " \'" |
Else |
If kh IsNot Nothing
Then |
b.filter =
"{B_Client}.Name = \'" & kh & "\' and {O_Sale1}.BillDate
>= \'" & A & "\' And {O_Sale1}.BillDate <= \'"
& C & " \'" |
Else |
b.Filter =
"{O_Sale1}.BillDate >= \'" & A & "\' And
{O_Sale1}.BillDate <= \'" & C & " \' " |
End If |
End If |
End If |
End If |
End If |
End If |
End If 这个代码怎么优化 |