Select Case e.DataCol.name Case "入职日期" If e.DataRow.IsNull("入职日期") Then e.DataRow("工龄_年") = Nothing e.DataRow("工龄_月") = Nothing e.DataRow("工龄_日") = Nothing Else Dim y,m,d As Integer If e.DataRow("状态") = "离职" Then DateYMD(e.DataRow("入职日期"),e.DataRow("离职时间"),y,m,d) Else DateYMD(e.DataRow("入职日期"),Date.Today,y,m,d) End If e.DataRow("工龄_年") = y e.DataRow("工龄_月") = m e.DataRow("工龄_日") = d End If End Select
|