Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim flt As String
If e.PostValues.ContainsKey("barcode") Then
flt = "条码 = '" & e.PostValues("barcode") & "'"
End If
If e.PostValues.ContainsKey("fsname") Then
If flt > "" Then
flt = flt & " or "
End If
flt = flt & "商品名称 Like '%" & e.PostValues("fsname") & "%'"
End If
Dim cmd As new SQLCommand
cmd.ConnectionName = DataSource
cmd.CommandText= "s elect * From 实时库存2017年"
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt
End If
Dim dt As DataTable = cmd.ExecuteReader
With wb.AddTable("","Table1")
.Primarykey = "商品序号" '设置主键
.CreateFromDataTable(dt)
End With
With wb.AddButtonGroup("","btg1",False)
.Add("btn1", "重新统计", "button").Attribute= """
.Add("btn2", "返回首页","button","default.htm")
End With
wb.AddForm("","form1","getimg.htm")
With wb.AddButtonGroup("form1","btg2",True) '垂直排列
.Add("btn3", "查看图片")
End With
e.WriteString(wb.Build)