//All Lmt Order
        public void OnLMTExecute(ProcessLmtOrder processLmtOrder,bool isBuy)
        {
            foreach (OrderTask orderTask in processLmtOrder.OrderTasks)
            {
                if (isBuy != (orderTask.IsBuy == BuySell.Buy)) continue;
                if (!OrderTaskManager.CheckExecuteOrder(orderTask)) continue;

                string executedPrice = isBuy ? processLmtOrder.LmtOrderForInstrument.CustomerBidPrice.ToString() : processLmtOrder.LmtOrderForInstrument.CustomerAskPrice.ToString();
                string marketPrice = isBuy ? processLmtOrder.LmtOrderForInstrument.Ask : processLmtOrder.LmtOrderForInstrument.Bid;

                if (!string.IsNullOrEmpty(marketPrice))
                {
                    bool isValidPrice = OrderTaskManager.IsProblePrice(orderTask.Instrument, marketPrice, executedPrice);
                    if (!isValidPrice)
                    {
                        string executePrice = orderTask.IsBuy == BuySell.Buy ? processLmtOrder.LmtOrderForInstrument.Ask : processLmtOrder.LmtOrderForInstrument.Bid;
                        this.Commit(orderTask, executePrice, (decimal)orderTask.Lot);
                    }
                }
                else
                {
                    string msg = "Out of Range,Accept or Reject?";
                    this.ConfirmOrderDialogWin.ShowRejectOrderWin(msg, orderTask, HandleAction.OnLMTExecute);
                }
            }
        }
        public void OnLMTOrderWait(ProcessLmtOrder processLmtOrder, bool isBuy)
        {
            foreach (OrderTask orderTask in processLmtOrder.OrderTasks)
            {
                if (isBuy != (orderTask.IsBuy == BuySell.Buy)) continue;

                if (orderTask.OrderStatus == OrderStatus.WaitOutPriceLMT
                || orderTask.OrderStatus == OrderStatus.WaitOutLotLMT
                || orderTask.OrderStatus == OrderStatus.WaitOutLotLMTOrigin)
                {
                    orderTask.ChangeStatus(OrderStatus.WaitNextPrice);
                    orderTask.ResetHit();
                    Guid[] orderIds = new Guid[] { orderTask.OrderId };
                    ConsoleClient.Instance.ResetHit(orderTask.ExchangeCode, orderIds);

                    if (this.OnOrderWaitNofityEvent != null)
                    {
                        this.OnOrderWaitNofityEvent(orderTask);
                    }
                }
            }
        }
        private void InitializeData()
        {
            this._ProcessLmtOrder = this._App.ExchangeDataManager.ProcessLmtOrder;
            this._CommonDialogWin = this._App._CommonDialogWin;
            this._ConfirmDialogWin = this._App._ConfirmDialogWin;

            Color bgColor = Colors.Transparent;
            Style style = new Style(typeof(Infragistics.Controls.Grids.CellControl));
            style.Setters.Add(new Setter(BackgroundProperty, new SolidColorBrush(bgColor)));
            this._NormalStyle = this.Resources["CellStyle"] as Style;
            this._ExecuteStatusStyle = App.Current.Resources["ExecuteSatusCellStyle"] as Style;
            this._HiddenStoryboard = this.Resources["HidBorderStoryboard"] as Storyboard;
            this._ShowStoryboard = this.Resources["ShowBorderStoryboard"] as Storyboard;
        }