If e.DataCol.Name = "身份证号" Then '如果更改的是身份证号码列
If e.DataRow.IsNull("身份证号") Then '身份证号码是否为空
e.DataRow("出生日期") = Nothing '如果为空,则清除出生日期
Else
'否则从身份证号码列中提取出生日期
e.DataRow("出生日期") = ReadBirthday(e.DataRow("身份证号"))
End If
End If
If e.DataCol.Name = "入职确认"
If e.DataRow("入职确认") = True Then
Dim dr As DataRow = DataTables("在职员工表").Find("身份证号 = '" & e.DataRow("身份证号") & "'")
If dr Is Nothing Then
dr = DataTables("在职员工表").AddNew
End If
For Each dc As DataCol In DataTables("在职员工表").DataCols
If e.DataTable.DataCols.contains(dc.name) Then
If e.DataRow(dc.name) = Nothing Then
dr(dc.Name) = Nothing
Else
dr(dc.Name) = e.DataRow(dc.Name)
End If
End If
Next
Else
DataTables("在职员工表").deletefor("身份证号 = '" & e.DataRow("身份证号") & "'")
End If
End If
[此贴子已经被作者于2018/11/27 16:50:11编辑过]