示例#1
0
 public TradePanelViewModel(MainViewModel mainVM)
 {
     _mainVM = mainVM;
     TransactionViewModel = TransactionViewModel.Instance();
     TransactionPannel    = new TransactionPannelViewModel();
     ConditionBill        = UCConditionBillViewModel.Instance();
     PositionAll          = PositionAllViewModel.Instance();
     OrderCancel          = OrderCancelViewModel.Instance();
     TodayTrader          = TodayTraderViewModels.Instance();
     FundsViewModel       = FundsViewModel.GetInstance();
 }
示例#2
0
        public void ClearTradeList()
        {
            PositionAllViewModel.Instance().DetPMList.Clear();
            PositionAllViewModel.Instance().PMList.Clear();
            PositionViewModel.Instance().PMList.Clear();

            OrderCancelViewModel.Instance().KCDelegations.Clear();
            OrderCancelViewModel.Instance().Delegations.Clear();

            UCConditionBillViewModel.Instance().ConditionBillList.Clear();

            TodayTraderViewModels.Instance().TodayTraderList.Clear();
        }
示例#3
0
        private void SendOrderCancel(bool isClear = true)
        {
            ReqPotion rpd = new ReqPotion();

            rpd.cmdcode = RequestCmdCode.SelectOrderCancel;
            rpd.content = new ReqLoginName()
            {
                user_id = UserInfoHelper.UserId
            };
            ScoketManager.GetInstance().SendTradeWSInfo(JsonConvert.SerializeObject(rpd));
            if (isClear)
            {
                OrderCancelViewModel.Instance().KCDelegations.Clear();
                OrderCancelViewModel.Instance().Delegations.Clear();
            }
        }
示例#4
0
 private void Border_MouseLeftButtonDown_9(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("ShadowOrderID", isShadowOrderID);
     isShadowOrderID = !isShadowOrderID;
 }
示例#5
0
 private void Window_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (ContractVariety.IsLoginSuccess)
     {
         if ((int)e.Key == CommParameterSetting.ShortcutKey.IntBuyOpen && CommParameterSetting.ShortcutKey.IntBuyOpen != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             TransactionViewModel.Instance().SJBuyExecuteChanged();
         }
         else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClearance && CommParameterSetting.ShortcutKey.IntClearance != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             PositionViewModel.Instance().TradeAllExecuteChanged();
         }
         else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClosingBuy && CommParameterSetting.ShortcutKey.IntClosingBuy != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             TransactionViewModel.Instance().IsByClose   = false;
             TransactionViewModel.Instance().IsSellClose = true;
             TransactionViewModel.Instance().BuyExecuteChanged();
         }
         else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClosingSell && CommParameterSetting.ShortcutKey.IntClosingSell != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             TransactionViewModel.Instance().IsSellClose = true;
             TransactionViewModel.Instance().IsByClose   = false;
             TransactionViewModel.Instance().SellExecuteChanged();
         }
         else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntRevoke && CommParameterSetting.ShortcutKey.IntRevoke != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             OrderCancelViewModel.Instance().SelectedItem = OrderCancelViewModel.Instance().Delegations.FirstOrDefault(x => x.ContractID == viewModel.SelectItemViewModel.ContractCode);
             if (OrderCancelViewModel.Instance().SelectedItem == null)
             {
                 return;
             }
             OrderCancelViewModel.Instance().OrderCancelExecuteChanged();
         }
         else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntSellOpen && CommParameterSetting.ShortcutKey.IntSellOpen != 0)
         {
             if (viewModel.SelectItemViewModel == null)
             {
                 MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
                 return;
             }
             TransactionViewModel.Instance().SJSellExecuteChanged();
         }
         //  Window_KeyUp(sender, e);
     }
     if (UserInfoHelper.IsHaveLogin)
     {
         Window_KeyUp(sender, e);
     }
 }
示例#6
0
 private void Border_MouseLeftButtonDown_8(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("OrderTime", isOrderTime);
     isOrderTime = !isOrderTime;
 }
示例#7
0
 private void Border_MouseLeftButtonDown_3(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("OrderStatus", isOrderStatus);
     isOrderStatus = !isOrderStatus;
 }
示例#8
0
 private void Border_MouseLeftButtonDown_2(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("OpenOffset", isOpenOffset);
     isOpenOffset = !isOpenOffset;
 }
示例#9
0
 private void Border_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("Direction", isDirection);
     isDirection = !isDirection;
 }
示例#10
0
 private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     OrderCancelViewModel.Instance().Sorting("ContractCode", isContractCode);
     isContractCode = !isContractCode;
 }