各位老师上午好!!以下是我在项目中的自动编号代码,总觉得太复杂,且“年月日”未能按“4位年2位月2位日”和格式,请老师帮忙修改,谢谢!!
If e.DataCol.Name = "Begin" Then
If e.DataRow.Isnull("Begin") Then
e.DataRow("SYBH") = Nothing
Else
Dim d As Date = e.DataRow("Begin")
Dim y As Integer = d.Year
Dim m As Integer = d.Month
Dim Days As Integer = d.day
Dim bh0 As Integer = e.DataRow("_Identify")
Dim bh1 As String = y & m & days
Dim bh2 As String = Format(bh0,"000")
e.DataRow("SYBH")=bh1 & "-" & bh2
End If
End If