Dim s(100) As String
Dim n,m As Integer
Dim drs As List(Of DataRow)
drs = DataTables("扫描枪记录").Select("")
For Each dr As DataRow In drs
If dr("顺序")<>""
s(n) =dr("扫描表号")
n=n+1
End If
Next
Dim t1 As WinForm.TextBox = Forms("包装统计系统").Controls("TextBox1")
Dim t4 As WinForm.TextBox = Forms("包装统计系统").Controls("TextBox4")
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
Dim cmd1 As New SQLCommand
Dim dt1 As DataTable
cmd1.C
cmd1.CommandText = "SELECT * F rom " & "{" & t1.text & t4.text & "表号信息" & "}"
dt1=cmd1.ExecuteReader(True)
Dim drOrder1 As DataRow
Dim bjlxString As String '表计类型三相表或单相表
'If(t1.text.substring(0,1)="D")Then
bjlxString="单相表"
'Else If(t1.text.substring(0,1)="S")Then
'bjlxString="三相表"
'End If
Dim d1 As Date=Date.now()
Dim d2 As Date = New Date(d1.Year, d1.Month, d1.Day, 0, 0, 0)
Dim d3 As Date = New Date(d1.Year,d1.Month, d1.Day, 23, 59, 59)
Dim year As Integer = d1.Year
Dim month As Integer = d1.Month
Dim monthstring As String=cstr(month)
Dim yearstring As String=cstr(year)
If(monthstring.length=1)Then
m + monthstring
End If
For m=0 To n-1
cmd.CommandText = "SELECT * F rom " & "{" & "单相表出厂参数检查数据表" & yearstring & monthstring & "} W HERE " & "[操作时间]>='" & d2 & "' And [操作时间]<='" & d3 & "' and [铭牌条码]='"& s(m) & "'"
dt = cmd.ExecuteReader()
drOrder1 = dt1.Find("表号 = '" & s(m) & "'")
If dt.DataRows.count>0 Then
drOrder1("CCJ")="1"
Else
drOrder1("CCJ")="0"
End If
dt1.Save()
Next
'MyTimers("计划1").Enabled=False