If e.DataCol.Name = "材料代号" Then
Dim nms() As String = {"外形尺寸_本体直径","外形尺寸_本体高","电容量测试值","损耗角正切测试值","漏电流测试值","材料代号"}
Dim drs As List(of DataRow) = DataTables("电解电容检验记录数据库").Select("材料代号 = '" & e.NewValue & "'")
systemready = False
If drs.count <= 10 Then
For Each dr As DataRow In drs
Dim dr2 As DataRow = e.DataTable.Addnew
For Each nm As String In nms
dr2(nm) =dr(nm)
Next
Next
Else
Dim i As Integer = 1
Do
Dim Id As Integer = rand.Next(0,drs.count)
Dim dr5 As DataRow = drs(id)
Dim dr3 As DataRow = e.DataTable.Addnew
For Each nm As String In nms
dr3(nm) =dr5(nm)
Next
i += 1
Loop While i <= 10
End If
e.DataRow.Delete
systemready = True
End If