-- 作者:fox-man
-- 发布时间:2019/2/25 20:12:00
-- 编号不自增了.
Select e.DataCol.Name Case "date","T_ID" If e.DataRow.IsNull("date") OrElse e.DataRow.IsNull("T_ID") Then e.DataRow("ID") = Nothing Else Dim d As Date = e.DataRow("date")
Dim s As String = format(d,"yyMM") &"-"& e.DataRow("T_ID") Dim i As String = DataTables("table1").SQLCompute("Max(ID)" , "T_ID= \'"& e.DataRow("T_ID") &"\' And [ID] Like \'" & s & "%\'" ) Dim n As Integer If i IsNot Nothing Then n=CInt(right(i,4))+1 \' 转换类型,自动ID靠右 e.DataRow("ID") = s & "-" & Format(n,"0000") e.DataRow.Save Else n =1 e.DataRow("ID") = s & "-" & Format(n,"0000") e.DataRow.Save End If End If End Select
此主题相关图片如下:2-25.png

|