Select Case e.DataCol.name Case "连续工龄计算时间" If e.DataRow.IsNull("参加工作时间") And e.DataRow.IsNull("连续工龄计算时间") Then e.DataRow("教龄") = Nothing Else e.DataRow("教龄") = e.DataRow("退休时间").year - e.DataRow("连续工龄计算时间").year + 1 End If End Select Select Case e.DataCol.name Case "参加工作时间" If e.DataRow.IsNull("参加工作时间") And e.DataRow.IsNull("连续工龄计算时间") Then e.DataRow("教龄") = Nothing Else '输入参加工作时间后 如果连续工龄计算时间有数值 就不执行计算工龄 If e.DataRow.Isnull("连续工龄计算时间") = True Then e.DataRow("教龄") = e.DataRow("退休时间").year - e.DataRow("参加工作时间").year + 1 End If End If End Select
|