public OrderList Load() { lock (this) { OrderList orders = new OrderList(); IDbCommand command = this.connection.CreateCommand(); // TODO: command.CommandText = "select order from"; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { int orderId = reader.GetInt32(0); Type orderType = this.jW5iqEmeD[reader.GetInt32(1)]; int instrumentId = reader.IsDBNull(2) ? -1 : reader.GetInt32(2); int providerId = reader.IsDBNull(3) ? -1 : reader.GetInt32(3); int portfolioId = reader.IsDBNull(4) ? -1 : reader.GetInt32(4); IOrder order = (IOrder)Activator.CreateInstance(orderType, true); order.Id = orderId; order.Instrument = InstrumentManager.Instruments.GetById(instrumentId); order.Provider = ProviderManager.ExecutionProviders[(byte)providerId]; order.Portfolio = PortfolioManager.Portfolios.GetById(portfolioId); order.Persistent = true; orders.Add(order); } reader.Close(); command.Dispose(); FIXDbServer.LoadFIXGroups(this.connection, orders, "order.table"); ExecutionReportList reports = new ExecutionReportList(); IDbCommand cmd = this.connection.CreateCommand(); cmd.CommandText = "commadn"; IDataReader reader2 = cmd.ExecuteReader(); while (reader2.Read()) { int reportId = reader2.GetInt32(0); int orderId = reader2.GetInt32(1); ExecutionReport report = new ExecutionReport(); report.Id = reportId; orders.GetById(orderId).Reports.Add(report); reports.Add(report); } reader2.Close(); cmd.Dispose(); FIXDbServer.LoadFIXGroups(this.connection, reports, "report.table"); return orders; } }
public virtual void Clear() { this.allOrders.Clear(); this.newOrders = null; this.pendingOrders = null; this.cancelledOrders = null; this.rejectedOrders = null; this.filledOrders = null; }
public virtual void Add(SingleOrder order) { this.allOrders.Add(order); this.newOrders = null; this.pendingOrders = null; this.cancelledOrders = null; this.rejectedOrders = null; this.filledOrders = null; }
public InstrumentOrderListTable() { this.allOrders = new OrderList(); }
public OrderList GetOrderList(OrdStatus ordStatus) { OrderList orderList = new OrderList(); foreach (SingleOrder singleOrder in this.allOrders) { if (singleOrder.OrdStatus == ordStatus) orderList.Add(singleOrder); } return orderList; }
public virtual void Update(SingleOrder order) { this.newOrders = null; this.pendingOrders = null; this.cancelledOrders = null; this.rejectedOrders = null; this.filledOrders = null; }
public static OrderList GetOCAGroup(string name) { OrderList orderList = new OrderList(); if (name != "") { foreach (SingleOrder singleOrder in (FIXGroupList) OrderManager.Orders.All) { if (!singleOrder.IsDone && singleOrder.OCAGroup == name) orderList.Add((IOrder)singleOrder); } } return orderList; }