这样的代码怎么改自定义函数。。。。。。。
Dim dt As DataTable = DataTables("订单明细")
Dim dd As WinForm.ComboBox = e.Form.Controls("订单编号")
Dim bp As WinForm.ComboBox = e.Form.Controls("客户品牌")
Dim cb As WinForm.ComboBox = e.Form.Controls("产品型号")
Dim gg As WinForm.ComboBox = e.Form.Controls("产品规格")
Dim gb As WinForm.CheckBox = e.Form.Controls("ChK关闭")
Dim cs As WinForm.CheckBox = e.Form.Controls("ChK取消")
Dim wc As WinForm.CheckBox = e.Form.Controls("ChK完成")
Dim fi As String = "完成 = " & wc.Checked & " and 关闭 = " & gb.Checked & " and 取消 = " & cs.Checked
Dim tb As Table = Tables("排产汇总_Tab订单明细")
'If dd.Text > "" Then fi = fi & " and " & "订单编号 like '%" & dd.Text & "%'"
If bp.Text > "" Then fi = fi & " and " & "客户品牌 like '%" & bp.Text & "%'"
If cb.text > "" Then fi = fi & " and " & "产品名称 like '%" & cb.text & "%'"
If gg.Text > "" Then fi = fi & " and " & "产品规格 like '%" & gg.text & "%'"
dd.ComboList = dt.GetComboListString("订单编号",fi)