Select Case e.DataCol.name
Case "证件号码"
If e.DataRow.IsNull("证件号码") Then
e.DataRow("原籍地址") = Nothing
e.DataRow("性别") = Nothing
Else
If e.DataRow("证件号码") = 15 OrElse e.DataRow("证件号码") = 18 Then
If e.DataRow("证件号码") = 15
e.DataRow("性别") = iif(e.DataRow("证件号码").Substring(14) Mod 2 = 1, "男", "女")
Else
e.DataRow("性别") = ReadSex(e.DataRow("证件号码"))
End If
Dim bm As String = e.DataRow("证件号码").SubString(0,6)
Dim dr As DataRow = DataTables("身份证号码归属").Find("编码 = '" & bm & "'")
If dr IsNot Nothing Then
e.DataRow("原籍地址") = dr("地址")
End If
End If
End If
End Select