private void CommandBinding_Executed_Cancel(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            ManagementViewModel vm            = DataContext as ManagementViewModel;
            PendingOrderData    selectedOrder = (e.OriginalSource as DataGridRow).DataContext as PendingOrderData;

            vm.RevocationPendingOrder(selectedOrder);
        }
        /// <summary>
        /// 历史订单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CommandBinding_Executed_HistoryOrder(object sender, ExecutedRoutedEventArgs e)
        {
            PendingOrderData data      = (e.OriginalSource as DataGridRow).DataContext as PendingOrderData;
            OrderInfoWindow  orderInfo = new OrderInfoWindow(data.TradeAccount);

            orderInfo.DataContext = this.DataContext;
            orderInfo.ShowDialog();
        }
 internal static DelHoldInfo ToDelHoldInfo(string loginID, int userType, PendingOrderData orderData)
 {
     return(new DelHoldInfo {
         CurrentTime = orderData.OwnedProduct.RealTimeTime,
         HoldOrderID = orderData.OrderID,
         LoginID = loginID,
         ReasonType = "1",//0为自动撤销,1为用户撤销   { 考虑是否增加  2 金商撤销,3,管理员撤销 }
         RtimePrices = orderData.RealTimePrice,
         TradeAccount = orderData.TradeAccount,
         //Todo:用户类型待处理
         //UserType = userType,
     });
 }
        /// <summary>
        /// 撤销限价挂单
        /// </summary>
        /// <param name="loginID">登陆标识</param>
        /// <param name="userType">用户类型,0:交易用户,1:管理员,2:金商</param>
        /// <param name="orderData">要撤销的限价挂单</param>
        /// <returns>ErrType</returns>
        public ErrType RevocationPendingOrder(string loginID, int userType, PendingOrderData orderData)
        {
            try
            {
                DelHoldInfo delHoldInfo = TradeConverter.ToDelHoldInfo(loginID, userType, orderData);
                MarDelivery marDel      = TradeService.DelHoldOrder(delHoldInfo);
                if (!marDel.Result)
                {
                    return(new ErrType(ERR.SERVICE, marDel.Desc));
                }

                return(GeneralErr.Success);
            }
            catch (TimeoutException te)
            {
                FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, te.Message);
                return(new ErrType(ERR.EXEPTION, ErrorText.TimeoutException));
            }
            catch (Exception ex)
            {
                FileLog.WriteLog("", Assembly.GetExecutingAssembly().GetName().Name, this.GetType().Name, new StackTrace().GetFrame(0).GetMethod().Name, ex.Message);
                return(new ErrType(ERR.EXEPTION, ErrorText.OperationError));
            }
        }