Exemplo n.º 1
0
        //вставка записи
        void StreamDataInserted(CP2DataStream stream, String tableName, CP2Record rec)
        {
            try
            {
                LogWriteLine(DateTime.Now.ToString() + " Insert " + tableName + " StreamName: " + stream.StreamName + "; TableSet.Count = " + stream.TableSet.Count.ToString());

                // Пришел поток FORTS_FUTAGGR20_REPL
                if (stream.StreamName == streamAggregatesID)
                {
                    SaveRev(rec.GetValAsVariantByIndex(1));
                    curr_rev = rec.GetValAsLongByIndex(1);
                    uint count = rec.Count;
                    for (uint i = 0; i < count; ++i)
                    {
                        if (i != count - 1)
                        {
                            LogWrite(rec.GetValAsStringByIndex(i) + ";");
                        }
                        else
                        {
                            LogWriteLine(rec.GetValAsStringByIndex(i));
                        }
                    }
                }

                // Пришел поток FORTS_FUTTRADE_REPL
                if (stream.StreamName == streamTradesID)
                {
                    string Fields = m_streamTrades.TableSet.get_FieldList("deal");
                    curr_rev_deal = rec.GetValAsLongByIndex(1);
                    for (uint i = 0; i < Fields.Split(',').Length; i++)
                    {
                        string Field = Fields.Split(',')[i];
                        string Value = "";
                        try
                        {
                            Value = rec.GetValAsString(Field);
                            SaveDeal(DateTime.Now.ToString() + " " + Fields.Split(',')[i], Value);
                        }
                        catch (System.Exception e)
                        {
                        }
                    }
                    m_saveDealFile.WriteLine("");
                    m_saveDealFile.Flush();
                }
            }
            catch (System.Exception e)
            {
                LogWriteLine("!!!" + e.Message + "!!!" + e.Source);
            }
        }
Exemplo n.º 2
0
        //вставка записи
        void StreamDataInserted(CP2DataStream stream, String tableName, CP2Record rec)
        {
            try
            {
                LogWriteLine("Insert " + tableName);

                // Пришел поток FORTS_FUTAGGR20_REPL
                if (stream.StreamName == streamAggregatesID)
                {
                    SaveRev(rec.GetValAsVariantByIndex(1));
                    curr_rev = rec.GetValAsLongByIndex(1);
                    uint count = rec.Count;
                    for (uint i = 0; i < count; ++i)
                    {
                        if (i != count - 1)
                        {
                            LogWrite(rec.GetValAsStringByIndex(i) + ";");
                        }
                        else
                        {
                            LogWriteLine(rec.GetValAsStringByIndex(i));
                        }
                    }
                }

                // Пришел поток FORTS_FUTTRADE_REPL
                if (stream.StreamName == streamTradesID)
                {
                    string Fields = m_streamTrades.TableSet.get_FieldList("deal");
                    curr_rev_deal = rec.GetValAsLongByIndex(1);
                    for (uint i = 0; i < Fields.Split(',').Length; i++)
                    {
                        string Field = Fields.Split(',')[i];
                        string Value = "";
                        try
                        {
                            Value = rec.GetValAsString(Field);
                            SaveDeal(Fields.Split(',')[i], Value);
                        }
                        catch (System.Exception e)
                        {

                        }
                    }
                    m_saveDealFile.WriteLine("");
                    m_saveDealFile.Flush();
                }

            }
            catch (System.Exception e)
            {
                LogWriteLine("!!!" + e.Message + "!!!" + e.Source);
            }
        }
Exemplo n.º 3
0
 //удаление записи
 void StreamDataDeleted(CP2DataStream stream, String tableName, Int64 Id, CP2Record rec)
 {
     SaveRev(rec.GetValAsVariantByIndex(1));
     LogWriteLine("Delete " + tableName + " " + Id);
 }
Exemplo n.º 4
0
 void StreamDataDeleted(CP2DataStream stream, String tableName, Int64 Id, CP2Record rec)
 {
     SaveRev(rec.GetValAsVariantByIndex(1));
     LogWriteLine(DateTime.Now.ToString() + " Delete " + tableName + " " + Id);
 }