Example #1
0
        Array IRtdServer.RefreshData(ref int topicCount)
        {
            try {
                var updatedOrders = nmsClient.ConsumeUpdatedOrders();

                lock (orderToTopicMapping) {
                    var updatedTopics = new object[2, updatedOrders.Count];
                    var i             = 0;
                    foreach (var s in updatedOrders)
                    {
                        var order = nmsClient.GetOrderByClientOrderID(s);
                        updatedTopics[0, i] = orderToTopicMapping[s];
                        if (order != null && string.IsNullOrEmpty(order.ErrorMessage))
                        {
                            updatedTopics[1, i] = order.Status;
                        }
                        else
                        {
                            updatedTopics[1, i] = order != null ? order.ErrorMessage : "Failed to find order";
                        }
                        i++;
                    }
                    topicCount = i;
                    return(updatedTopics);
                }
            } catch (Exception e) {
                Console.WriteLine(e);
                return(new object[2, 0]);
            }
        }
Example #2
0
        Array IRtdServer.RefreshData(ref int topicCount)
        {
            try {
                lock (nmsClient) {
                    var updatedOrders = nmsClient.ConsumeUpdatedOrders();

                    var updatedTopics = new object[2, updatedOrders.Count];
                    var i             = 0;
                    foreach (var s in updatedOrders)
                    {
                        var order = nmsClient.GetOrderByKey(s);
                        updatedTopics[0, i] = orderToTopicMapping[s];
                        updatedTopics[1, i] = GetErrorOrStatus(order);
                        i++;
                    }
                    topicCount = i;
                    return(updatedTopics);
                }
            } catch (Exception e) {
                log.Error(e);
                return(new object[2, 0]);
            }
        }