If e.DataCol.Name = "序号" Then
If e.NewValue = "1" Then
e.DataRow("页号")=1
End If
Else
Select Case e.DataCol.Name
Case "页数"
For Each dr As DataRow In e.DataTable.Select("[_SortKey] >= " & e.DataRow("_SortKey"))
Dim Val1 As Double = e.DataTable.Compute("Sum(页数)","[_SortKey] <= " & dr("_SortKey"))
dr("页号") = Val1
Next
End Select
End If
Dim t As Table = Tables("按卷归整阶段")
For Each r As Row In t.Rows
r("序号") =r.Index + 1
Next
'-----------------------------------------------------------
'-----------------------------------------------------------
If e.DataCol.Name = "是否归档" Then
If e.DataRow("是否归档") = True Then
e.DataRow("操作员") = User.Name
e.DataRow("归档日期") = Date.Now
'Else
'e.DataRow("取消归整人") = User.Name
'e.DataRow("取消归整时间")= Date.Now
End If
End If
'-------------------------------------------------------
Select Case e.DataCol.name
Case "案卷号"
If e.newvalue > "" Then
e.DataRow("案卷号")=format(Val(e.newValue),"0000")
End If
End Select