Public Function GetNextCode(s_name As String,Optional s_prefix As String = Nothing) As String
SyncLock _codelock \'使用锁处理并发
Dim dr As DataRow = _bizcode.Find(CExp("BizName=\'{0}\' and Prefix=\'{1}\'", s_name, s_prefix))
……
3、服务端事件对客户端消息处理
Dim msg As String = e.Message
\'这里处理编号生成-------------------------------------------------\'
If msg.StartsWith(":f") AndAlso msg.EndsWith("f:") Then
Dim ss() As String = msg.SubString(2, msg.Length - 4).Split("|")
e.ReturnValue = _BizCodeBuilder.GetNextCode(ss(0), ss(1)) \'将编号返回给客户端
End If
4、客户端发送消息的时候加上前缀
窗口1
Dim rt As String = QQClient.SendWait(":f" & e.DataTable.Name & "|DD-f:")
窗口2
Dim rt As String = QQClient.SendWait(":f" & e.DataTable.Name & "|JD-f:")