public void ClearOrderInfo() { OrderTable orderService = new OrderTable(); int count = orderService.RemoveByDate(this.DbfManager.TargetDateName); this.Output.WriteLine(string.Format("Delete from {0} where trade_date = {1}", OrderTable.T_TableName, this.DbfManager.TargetDateName)); this.Output.WriteLine("受影响行数:" + count); foreach (ImportItem item in this.ExportList) { if (item is IExport2OrderTable) { item.InitImportState(); } } }
/// <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(); }
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(); }