Select Case e.DataCol.Name
Dim dr1 As DataRow = e.DataRow
Dim dr2 As DataRow = DataTables("客户登记").Find("客户名称 = '" & dr1("客户名称") & "'")
Case "客户名称"
If dr2 IsNot Nothing Then
dr1("联系人") = dr2("采购联系人")
dr1("联系电话") = dr2("采购电话")
dr1("交货地址") = dr2("交货地址")
End If
Case "是否新客户"
If e.DataRow("是否新客户") = True
If dr2 Is Nothing Then
dr2 = DataTables("客户登记").AddNew()
dr2("采购联系人") = dr1("联系人")
dr2("采购电话") = dr1("联系电话")
dr2("交货地址") = dr1("交货地址")
End If
End If
End Select