……Dim flag As Boolean = True
For n As Integer = 2 To Rg.Rows.count
If ary(n,nms("复核人")) = _UserName
Dim bgh As String = ary(n,nms("报告号"))
If bgh = "" Then Continue For
Dim dr As DataRow = dt.Find("报告号 = '" & bgh & "'")
If dr IsNot Nothing Then
Result = MessageBox.Show("有重复报告号,是否覆盖导入?"& vbcrlf &"是---覆盖导入(将更新原有报告号数据)"& vbcrlf &"否---新增导入(仅增加新报告号数据)", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
flag = True
Else
flag = False
End If
Exit For
End If
End If
Next
For n As Integer = 2 To Rg.Rows.count
If ary(n,nms("复核人")) = _UserName
Dim bgh As String = ary(n,nms("报告号"))
If bgh = "" Then Continue For
Dim dr As DataRow = dt.Find("报告号 = '" & bgh & "'")
If dr Is Nothing Then
dic.Add(n,Nothing)
ElseIf flag = True
dic.Add(n,dr)
End If
End If
Next
……