Dim db = HySq-l.DataBaseFactory.CreateDatabase("myjx") \'
Dim Sq-l2 = "Selec-t a.采购单号,a.产品编号, a.品名, a.交货日期,b.供方, b.采购日期, b.供方,b.制单人,b.UserID From cgm_tb as a Inner Join cgz_tb as b On (a.采购单号 = b.采购单号) " & _
"where (b.制单人= \'" & _Username & "\' or b.UserID in (\'" & s.Replace(",", "\',\'") & "\')) " & _
"And b.采购日期 >= \'" & StartDate & "\' And b.采购日期 <= \'" & EndDate & "\' "
Dim dt2 As system.data.DataTable = db.ExecuteDataSet(Sq-l2).Tables(0)
Dim t2 As Table = e.Form.Controls("Table1").Table
t2.datasource = dt2.Copy
t2.AllowEdit = False \'
\'目录树-按日期
Dim Sq-l3 = "SELEC-T DISTINCT Year(采购日期) As 年, Month(采购日期) As 月,采购单号,采购日期, 供方 From cgz_tb"
Dim dt3 As system.data.DataTable = db.ExecuteDataSet(Sq-l3).Tables(0)
Dim t3 As Table = e.Form.Controls("Table2").Table
t3.datasource = dt3.Copy
Dim trv3 As WinForm.TreeView = e.Form.Controls("TreeView4")
trv3.BuildTree("查询窗口_Table2", "年|月|供方")