Esempio n. 1
0
        /// <summary>
        /// 将数据导出到 MarketTable中。
        /// </summary>
        public void Export2MarketTable(DbDataReader reader, IExportCallback callback, IExport2MarketTable marketService)
        {
            if (reader == null)
                return;
            MarketTable marketTable = new MarketTable();
            if (!marketTable.Open())
                return;

            while (reader.Read())
            {
                if (this.TheProject.HasStop)
                {
                    marketService.ImportState = EImportStatus.Interrupt;
                    break;
                }

                MarketRow row = marketService.GetMarketRow(reader);
                marketTable.Add(row);
                callback.CurrentIndex++;
                callback.ValidIndex++;
            }

            marketTable.Close();
        }
        public void ClearMarketInfo()
        {
            MarketTable marketService = new MarketTable();
            int count = marketService.RemoveByDate(this.DbfManager.TargetDateName);
            this.Output.WriteLine(string.Format("Delete from {0} where trade_date = {1}", MarketTable.TableName, this.DbfManager.TargetDateName));
            this.Output.WriteLine("受影响行数:" + count);

            foreach (ImportItem item in this.ExportList)
            {
                if (item is IExport2MarketTable)
                {
                    item.InitImportState();
                }
            }
        }