Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT [_Identify],请购编号,名称规格,单位,编号,报销 FRO M {物资入库} Where [报销] = False "
dt = cmd.ExecuteReader(True)
If MsgBox("确认提交保存?",65,"提示") = 1 Then
Dim a As Table = Tables("费用管理_Table3")
Dim b As Table = Tables("入账报销")
Dim dr1 As DataRow
For r As Integer = 0 To a.Rows.Count - 1
b.AddNew
b.Current("经办") = _username
b.Current("物料编码") = a.Rows(r)("物料编码")
b.Current("名称规格") = a.Rows(r)("名称规格")
......
b.Current("备注") = a.Rows(r)("备注")
b.Current("入库ID") = a.Rows(r)("入库ID")
If a.Rows(r)("入库ID") IsNot Nothing Then
dr1 = dt.Find("[编号] = '" & a.Rows(r)("入库ID") & "' ")
dr1("报销") = True
End If
Next
dt.Save()
For r As Integer = a.rows.Count - 1 To 0 Step -1
a.Current.Delete
Next
DataTables("入账报销").Save()
End If