Пример #1
0
 /// <summary>
 /// Helper method for GetFirstUnprocessedKwsEvent() and GetLastKwsEvent().
 /// </summary>
 private AnpMsg GetKwsEventFromQuery(String s)
 {
     Object res = m_db.GetCmd(s).ExecuteScalar();
     if (res == null) return null;
     AnpMsg m = new AnpMsg();
     m.FromByteArray((byte[])res);
     return m;
 }
Пример #2
0
 public AnpMsg[] GetNewKwsEvent(UInt64 kwsID, UInt64 evtID)
 {
     String s = "SELECT evt_data FROM kws_events WHERE kws_id = " + kwsID +
                " AND evt_id > " + evtID + " ORDER BY evt_id;";
     List<AnpMsg> res = new List<AnpMsg>();
     DbDataReader reader = m_db.GetCmd(s).ExecuteReader();
     if (reader == null) return null;
     long buflength = 1024;
     byte[] buf = new byte[buflength];
     do
     {
         AnpMsg m = new AnpMsg();
         m.FromByteArray((byte[])reader.GetValue(0));
         res.Add(m);
     } while (reader.Read());
     return res.ToArray();
 }