コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: PredictFX/Plaza
        //вставка записи
        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);
            }
        }
コード例 #2
0
ファイル: Class1.cs プロジェクト: arvicco/p2ruby
        //вставка записи
        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);
            }
        }
コード例 #3
0
ファイル: Class1.cs プロジェクト: arvicco/p2ruby
 //удаление записи
 void StreamDataDeleted(CP2DataStream stream, String tableName, Int64 Id, CP2Record rec)
 {
     SaveRev(rec.GetValAsVariantByIndex(1));
     LogWriteLine("Delete " + tableName + " " + Id);
 }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: PredictFX/Plaza
 void StreamDataDeleted(CP2DataStream stream, String tableName, Int64 Id, CP2Record rec)
 {
     SaveRev(rec.GetValAsVariantByIndex(1));
     LogWriteLine(DateTime.Now.ToString() + " Delete " + tableName + " " + Id);
 }