Ejemplo n.º 1
0
        /// <summary>
        /// 将数据导出到委托表(OrderTable)中。
        /// </summary>
        public void Export2OrderTable(DbDataReader reader, IExportCallback callback, IExport2OrderTable orderService)
        {
            if (reader == null)
                return;
            OrderTable orderTable = new OrderTable();
            if (!orderTable.Open())
                return;

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

                OrderRow data = orderService.GetOrderRow(reader);
                orderTable.Add(data);
                callback.CurrentIndex++;
                callback.ValidIndex++;
            }

            orderTable.Close();
        }
Ejemplo n.º 2
0
        protected void Export2OrderAndTradeTable(DbDataReader reader, IExportCallback callBack)
        {
            OrderTable orderTable = new OrderTable();
            TradeTable tradeTable = new TradeTable();
            if (!orderTable.Open() || !tradeTable.Open())
            {
                orderTable.Close();
                tradeTable.Close();

                return;
            }

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

                OrderRow_LH row = this.GetOrderRow_LH(reader as SqlDataReader);
                orderTable.Add(this.GetOrderRow(row));

                // 成交信息
                if (row.CjNum > 0)
                {
                    tradeTable.Add(GetTradeRow(row));
                    callBack.ValidIndex++;
                }

                callBack.CurrentIndex++;
            }

            orderTable.Close();
            tradeTable.Close();
        }