Esempio n. 1
0
 /// <summary> 获取上传协议 
 /// </summary>
 /// <param name="dr">数据行</param>
 /// <param name="dbName">帐套</param>
 /// <returns></returns>
 private static AnnounceProtocol GetProtocol(DataRow dr, string dbName)
 {
     AnnounceProtocol protocol = new AnnounceProtocol();
     protocol.StationId = GlobalStaticObj_Server.Instance.StationID;
     //根据表名得到子消息ID
     protocol.SubMessageId = SubMessageId;
     protocol.TimeSpan = TimeHelper.GetTimeInMillis();
     //Json对象
     string json = JsonHelper.DataTableToJson(dr, protocol.StationId, dbName, true);
     json = BaseCodeHelper.EnCode(json);
     protocol.Json = json;
     return protocol;
 }
Esempio n. 2
0
 /// <summary> 处理收到的公告信息 
 /// </summary>
 /// <param name="protocol"></param>
 public static void Deal(AnnounceProtocol protocol)
 {
     //保存至数据库,并返回成功/失败信息
     ThreadPool.QueueUserWorkItem(new WaitCallback(SaveData), protocol);
 }