Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim dict As new Dictionary(of String,Integer)
For iii As Integer = 0 To sheet.Cols.Count -1
dict.Add(sheet(0,iii).Text,iii)
Next
Dim bh As Date
Dim bj As String
Dim ba As String
Dim bi As String
Dim bl As String
Dim bx As String
For n As Integer = 1 To Sheet.Rows.Count -1
bh = sheet(n,dict("下单时间")).Value
bj = sheet(n,dict("长款号")).Text
ba = sheet(n,dict("淘宝")).Text
bi = sheet(n,dict("唯品会")).Text
bl = sheet(n,dict("第三方")).Text
bx = sheet(n,dict("汇总")).Text
'Dim bk As String = sheet(n,146).Text
' If bk > "" Then
Dim Filter As String = "下单时间 = '" & bh & "' and 长款号 = '" & bj & "'"
If ba > "" Then
filter = Filter & " And " & "淘宝 = '" & ba & "'"
End If
If bi > "" Then
filter = Filter & " And " & "唯品会 = '" & bi & "'"
End If
If bl > "" Then
filter = Filter & " And " & "第三方 = '" & bl & "'"
End If
If bx > "" Then
filter = Filter & " And " & "汇总 = '" & bx & "'"
End If
DataTables("下单表").AppendLoad(Filter,False)
r = DataTables("下单表").Find(Filter)
If r IsNot Nothing Then
For i As Integer = 0 To sheet.Cols.Count -1
For Each m As String In nms
Dim cname As String = sheet(0, i).Value
If cname >"" AndAlso cname = m Then
If Sheet(n,i).text > "" Then
r(m) = Sheet(n,i).Value
End If
End If
If cname = "图片" Then
Dim fl As String = "\\10.100.100.129\产品中心\foxtable资料\图片\" & r("长款号") & ".jpg"
If Sheet(n,i).SaveImage(fl) Then '如果照片保存成功
r("图片") = fileSys.GetName(fl)
End If
End If
Next
Next
Else
r = DataTables("下单表").AddNew()
……