Exemple #1
0
        private void OrderGrid_OnOrderReRegistering(Order order)
        {
            var pfDataSource = new PortfolioDataSource();

            pfDataSource.Add(order.Portfolio);

            var window = new OrderWindow
            {
                Title              = LocalizedStrings.Str2976Params.Put(order.TransactionId),
                SecurityProvider   = _emuConnector,
                MarketDataProvider = _emuConnector,
                Portfolios         = pfDataSource,
                Order              = order.ReRegisterClone(newVolume: order.Balance)
            };

            if (window.ShowModal(this))
            {
                if (order.Portfolio == _emuPf)
                {
                    _emuConnector.ReRegisterOrder(order, window.Order);
                }
                else
                {
                    _realConnector.ReRegisterOrder(order, window.Order);
                }
            }
        }
Exemple #2
0
        private void OrderGrid_OrderRegistering()
        {
            var pfDataSource = new PortfolioDataSource();

            pfDataSource.Add(_emuPf);
            pfDataSource.AddRange(_realConnector.Portfolios);

            var newOrder = new OrderWindow
            {
                Order = new Order {
                    Security = _security
                },
                SecurityProvider   = _emuConnector,
                MarketDataProvider = _emuConnector,
                Portfolios         = pfDataSource,
            };

            if (newOrder.ShowModal(this))
            {
                var order = newOrder.Order;

                if (order.Portfolio == _emuPf)
                {
                    _emuConnector.RegisterOrder(order);
                }
                else
                {
                    _realConnector.RegisterOrder(order);
                }
            }
        }