Select Case e.DataCol.name Case "身份证号码" If e.DataRow.IsNull("身份证号码") Then e.DataRow("出生日期") = Nothing e.DataRow("性别") = Nothing e.DataRow("籍贯") = Nothing Else e.DataRow("出生日期") = ReadBirthday(e.DataRow("身份证号码")) e.DataRow("性别")=ReadSex(e.DataRow("身份证号码")) Dim bm As String = e.DataRow("身份证号码").SubString(0,6) Dim jg As DataRow = DataTables("身份证籍贯编码").Find("籍贯编码 = '" & bm & "'") If jg IsNot Nothing Then e.DataRow("籍贯") = jg("籍贯") End If End If Case "出生日期" If e.DataRow.IsNull("出生日期") Then e.DataRow("年龄") = Nothing Else e.DataRow("年龄") = Date.Today.Year - e.DataRow("出生日期").Year End If End Select
|