Beispiel #1
0
 public PriceData(EventLog mylog)
 {
     EventLog1 = mylog;
     log = logType == LogType.TextLog ? new LogUtils(logType, logEnable, logPath) : new LogUtils(logType, logEnable, EventLog1);
     log.Enabled = logEnable;
     log.LogPath = logPath;
 }
 public UpdateService()
 {
     InitializeComponent();
     log = logType == LogType.TextLog ? new LogUtils(logType, logEnable, logPath) : new LogUtils(logType, logEnable, eventLog1);
     log.Enabled = logEnable;
     log.LogPath = logPath;
 }
Beispiel #3
0
 public StockData(int ind, EventLog mylog)
 {
     index = ind;
     EventLog1 = mylog;
     log = logType == LogType.TextLog ? new LogUtils(logType, logEnable, logPath) : new LogUtils(logType, logEnable, EventLog1);
     log.Enabled = logEnable;
     log.LogPath = logPath;
 }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            //var ls = GetTopBCTC("SSI", "BSheet", 2011, 1, 4);
            var log = new LogUtils(LogType.TextLog, true, AppDomain.CurrentDomain.SetupInformation.ApplicationBase + @"log\");
            var redis = new RedisClient(ConfigRedis.Host, ConfigRedis.Port);

            var symbols = SqlDb.GetBCTCSymbols();
            textBox1.Text = "Begin : " + DateTime.Now.ToString() + Environment.NewLine;
            var types = new List<string>() {"IncSta", "BSheet", "CashFlow", "CashFlowDirect"};
            foreach (DataRow dr in symbols.Rows)
            {
                var symbol = dr["Symbol"].ToString();
                //if(symbol!="SSI") continue;
                textBox1.Text += symbol + ",";
               log.WriteEntry(symbol + ",", EventLogEntryType.Warning);
                for(var year = 2005; year <= 2011; year++)
                {
                    for(var quarter = 0; quarter<=4; quarter++)
                    {
                        if(year==2011 && quarter!= 1) continue;
                        foreach (var type in types)
                        {
                            var o = GetBCTC(symbol, type, year, quarter);
                            if(o==null) continue;
                            var key = string.Format(RedisKey.BCTCKey, symbol.ToUpper(), type.ToUpper(), quarter == 0 ? 0 : 1, year, quarter);
                            if (redis.ContainsKey(key))
                                redis.Set(key, o);
                            else
                                redis.Add(key, o);
                            Thread.Sleep(1000);
                        }
                    }
                }
            }
            textBox1.Text += "End : " + DateTime.Now.ToString() + Environment.NewLine;
            
        }