Dim dr As DataRow = DataTables("用户信息").find("用户名 = '" & 用户名 & "'") '找到当前登录者所在的行
If dr IsNot Nothing Then
Dim filter As String = "1=2"
If dr("职位") = "管理者" Then
Dim drs = DataTables("部门信息").Select("层级 like '" & dr("层级") & "%'")
For Each cdr As DataRow In drs
Filter &= " or 当前所在部门 = '" & cdr("所属部门") & "' And 是否可用 = 1 "
Next
Else If dr("职位") = "职员" Then
Filter = "当前所在部门 = '" & dr("所属部门") & "' And 是否可用 = 1 "
End If
Dim Str1 As Integer = DataTables("溯源码").SQLCompute("Count(*)", filter)
e.Form.Controls("Button26").Text ="当前库存: " & Str1
Dim filter2 As String = filter & " And 过保日期 <= #" & Date.Today & "#" 这句代码是否有问题?我想在filter上增加筛选条件
Dim Str2 As Integer = DataTables("溯源码").SQLCompute("Count(*)", filter2)
e.Form.Controls("Button25").Text ="超保质期: " & Str2
End If