Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
2、在服务端的AfterOpenProjet事件中编写代码:
Dim dt As DataTable
Dim cmd As New SQLCommand
cmd.ConnectionName = "数据源名称"
cmd.CommandText = "SelecGt 工程代码,Year(制单日期) As 年, Month(制单日期) As 月, Max(单据编号) as 单据编号 From {工程} Group By 工程代码,Year(制单日期), Month(制单日期)"
dt = cmd.ExecuteReader
flbhs.Clear()
For Each dr As DataRow In dt.DataRows
Dim qz As String = dr("工程代码") & "-" & dr("年") & Format(dr("月"),"00") '编号前缀,4位工程代码,4位年,2位月
Dim bh As String = dr("单据编号")
Dim id As Integer
If bh.Length = 16 Then
bh = bh.SubString(12)
If Integer.TryParse(bh,id) Then
flbhs.Add(qz, id)
End If
End If
Next