DataRowAdding事件
Dim bh As String = "CI" & Format(Date.Today, "yyyyMM")
Dim max As String = e.DataTable.sqlCompute("max(监造流水号)", "监造流水号 like '" & bh & "%'")
Dim idx As Integer = 1
If max > "" Then
idx = Cint(max.SubString(bh.Length)) + 1
Else
idx = 1
End If
e.DataRow("监造流水号") = bh & format(idx, "000")
DataRowAdded 事件
e.DataRow.Save