private static void OnEnableStopProfitChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            MarketOrderWindow win = d as MarketOrderWindow;

            if ((bool)e.NewValue)
            {
                ProductInformation p = win.CbProductName.SelectedItem as ProductInformation;
                if (p != null)
                {
                    win.StopProfit = p.OrderPrice;
                }
            }
            else
            {
                win.StopProfit = 0.00;
            }
        }
        /// <summary>
        /// 为指定的客户持仓新单
        /// </summary>
        /// <param name="clientAccount">指定的某个客户账户</param>
        public void MarketOrder(ClientAccount clientAccount)
        {
            MarketOrderWindow wnd = new MarketOrderWindow
            {
                Owner = Application.Current.MainWindow,
                DataContext = clientAccount,
                ProductList = ProductInfoes,
            };
            wnd.MarketOrder += (sender, args) =>
            {
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork += (s, e) =>
                {
                    ValidationResult result = MarketOrderInfoValidation(args.NewOrderInfo, args.SelectedProduct, clientAccount);
                    if (!result.IsValid)
                    {
                        e.Result = new ErrType(ERR.VALIDATE_FAIL, result.ErrorContent.ToString());
                        return;
                    }

                    int userType = ToUserType(_accType);
                    e.Result = _tradeService.MarketOrder(_loginID, clientAccount.AccInfo.AccountName, userType, args.NewOrderInfo);
                };
                worker.RunWorkerCompleted += (s, e) =>
                {
                    ErrType err = e.Result as ErrType;
                    if (err != GeneralErr.Success)
                    {
                        MessageBox.Show(err.ErrMsg, err.ErrTitle, MessageBoxButton.OK, MessageBoxImage.Warning);
                        wnd.RevertWindowState();
                    }
                    else
                    {
                        wnd.Close();
                        MessageBox.Show("市价订单操作成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                };
                worker.RunWorkerAsync();
            };
            wnd.ShowDialog();
        }