private void OnRspCancelOrder(IntPtr pTraderApi, ref DFITCOrderRspDataRtnField pOrderRtn, ref DFITCErrorRtnField pErrorInfo)
        {
            SingleOrder order;
            if (pErrorInfo.nErrorID != 0)
            {
                tdlog.Error("OnRspCancelOrder:请求{0},会话{1},本地{2},柜台{3},错误{4},{5}",
                    pErrorInfo.requestID, pErrorInfo.sessionID, pErrorInfo.localOrderID, pErrorInfo.spdOrderID, pErrorInfo.nErrorID, pErrorInfo.errorMsg);

                string strKey = string.Format("{0}:{1}", pErrorInfo.sessionID, pErrorInfo.localOrderID);
                if (_OrderRef2Order.TryGetValue(strKey, out order))
                {
                    EmitCancelReject(order, order.OrdStatus, order.Text);
                }
            }
            else
            {
                tdlog.Info("OnRspCancelOrder:本地{0},柜台{1},状态{2}",
                    pOrderRtn.localOrderID, pOrderRtn.spdOrderID, pOrderRtn.orderStatus);
                string strKey = string.Format("{0}:{1}", _RspUserLogin.sessionID, pOrderRtn.localOrderID);
                if (_OrderRef2Order.TryGetValue(strKey, out order))
                {
                    EmitCancelled(order);
                }
            }
        }
 private void OnRspInsertOrder(IntPtr pTraderApi, ref DFITCOrderRspDataRtnField pOrderRtn, ref DFITCErrorRtnField pErrorInfo)
 {
     SingleOrder order;
     if (pErrorInfo.nErrorID != 0)
     {
         tdlog.Error("OnRspInsertOrder:请求{0},会话{1},本地{2},柜台{3},错误{4},{5}",
             pErrorInfo.requestID, pErrorInfo.sessionID, pErrorInfo.localOrderID, pErrorInfo.spdOrderID, pErrorInfo.nErrorID, pErrorInfo.errorMsg);
         string strKey = string.Format("{0}:{1}", pErrorInfo.sessionID, pErrorInfo.localOrderID);
         if (_OrderRef2Order.TryGetValue(strKey, out order))
         {
             order.Text = string.Format("{0}|{1}#{2}", order.Text.Substring(0, Math.Min(order.Text.Length, 64)), pErrorInfo.nErrorID, pErrorInfo.errorMsg);
             EmitCancelled(order);
         }
     }
     else
     {
         tdlog.Info("OnRspInsertOrder:本地{0},柜台{1},状态{2}",
             pOrderRtn.localOrderID, pOrderRtn.spdOrderID, pOrderRtn.orderStatus);
         string strKey = string.Format("{0}:{1}", _RspUserLogin.sessionID, pOrderRtn.localOrderID);
         if (_OrderRef2Order.TryGetValue(strKey, out order))
         {
             _Orders4Cancel[order] = pOrderRtn;
             EmitAccepted(order);
         }
         //else
         //{
         //    _OrderRef2Order[strKey] = order;
         //    _Orders4Cancel[order] = pOrderRtn;
         //    EmitAccepted(order);
         //}
     }
 }