Beispiel #1
0
        private async void OrdersGridSetTradeSubMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (OrdersGrid.SelectedItems == null)
            {
                return;
            }
            int tradeID = (int)((MenuItem)e.Source).Tag;
            var trade   = Context.Trades.FirstOrDefault(x => x.Open && x.ID == tradeID);

            if (trade == null)
            {
                return;
            }

            var selectedOrders = new List <Order>(OrdersGrid.SelectedItems.Cast <Order>());
            await Task.Run(async() =>
            {
                await TradesRepository.AddOrders(trade, selectedOrders).ConfigureAwait(false);
                await TradesRepository.Save().ConfigureAwait(false);
            }).ConfigureAwait(true);
        }
Beispiel #2
0
 public async Task AddOrders(Trade trade, List <Order> orders)
 {
     await TradesRepository.AddOrders(trade, orders);
 }