internal static MappedOrderRelation From(DataRow row) { MappedOrderRelation relation = new MappedOrderRelation(); relation.CloseOrderID = (Guid)row["MappedOrderID"]; relation.OpenOrderID = (Guid)row["OpenOrderID"]; relation.ClosedLot = (decimal)row["ClosedLot"]; return(relation); }
private void ProcessMappedOrders(DataSet dataSet) { if (dataSet.Tables[0].Rows.Count > 0) { Dictionary <Guid, MappedOrder> orders = new Dictionary <Guid, MappedOrder>(); foreach (DataRow dataRow in dataSet.Tables[0].Rows) { MappedOrder order = MappedOrder.From(dataRow); this.waitingForBookOrders.Add(order); orders.Add(order.ID, order); } foreach (DataRow dataRow in dataSet.Tables[1].Rows) { MappedOrderRelation relation = MappedOrderRelation.From(dataRow); orders[relation.CloseOrderID].AddRelation(relation); } this.waitingForBookOrders.Sort(MappedOrderComparer.Default); } }
internal void AddRelation(MappedOrderRelation relation) { this.relations.Add(relation); }