以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  这个表达式错在哪里啊?身份证  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=85287)

--  作者:hongyefor
--  发布时间:2016/5/22 13:00:00
--  这个表达式错在哪里啊?身份证

Select Case e.DataCol.name
    Case "证件号码"
        If e.DataRow.IsNull("证件号码") Then
            e.DataRow("原籍地址") = Nothing
            e.DataRow("性别") = Nothing
        Else
            e.DataRow("性别") = ReadSex(e.DataRow("证件号码"))
            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 Select


--  作者:大红袍
--  发布时间:2016/5/22 13:03:00
--  

 报什么错?

 

Select Case e.DataCol.name
    Case "证件号码"
        If e.DataRow.IsNull("证件号码") Then
            e.DataRow("原籍地址") = Nothing
            e.DataRow("性别") = Nothing
        Else
            If ValidPIN(e.DataRow("证件号码")) Then
                e.DataRow("性别") = ReadSex(e.DataRow("证件号码"))
                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

 

 


--  作者:hongyefor
--  发布时间:2016/5/22 13:10:00
--  
为什么15位身份证不能识别
--  作者:大红袍
--  发布时间:2016/5/22 15:31:00
--  

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