/// <summary>
        /// 卖持仓检查
        /// </summary>
        /// <param name="strMessage"></param>
        /// <param name="hkEntrustInfo"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        private bool PO_HoldValidate_Sell(ref string strMessage, HK_TodayEntrustInfo hkEntrustInfo,
                                          HKOrderRequest request)
        {
            bool result = false;

            strMessage = "GT-2420:[港股改单委托检验]卖持仓检查,无持仓--港股改单委托失败";

            //var ahtMemory = MemoryDataManager.HKHoldMemoryList.GetByHoldAccountAndCurrencyType(HoldingAccount, Code,
            //                                                                                   CurrencyType);

            //if (ahtMemory == null)
            //{
            var ahtMemory = HKCommonLogic.GetHoldMemoryTable(hkEntrustInfo.HoldAccount, hkEntrustInfo.Code,
                                                             hkEntrustInfo.CurrencyTypeID);

            //}

            if (ahtMemory == null || ahtMemory.Data == null)
            {
                return(false);
            }

            var aht = ahtMemory.Data;

            int position = Convert.ToInt32(aht.AvailableAmount);
            //真正的可用量是要减去真正的改单量增加或者减少量
            //而真正的改单量增加量为=现在改单委托量-原委托量;
            int nowAddAmount = Convert.ToInt32(request.OrderAmount) - hkEntrustInfo.EntrustAmount;

            //不能直接把冻结量加上,因为冻结量可能不为本单的冻结量,可能还有别的单下的冻结量
            position = position + hkEntrustInfo.EntrustAmount - hkEntrustInfo.TradeAmount;
            //则当前的真正的可用持仓量为
            position = position - nowAddAmount;

            //持仓帐户是否存在判断
            //result = ValidateCenter.ValidateHKMinVolumeOfBusiness(request, position, ref strMessage);
            HKStockMinVolumeOfBusinessCommand command = new HKStockMinVolumeOfBusinessCommand(BreedClassID, position);

            result = command.Validate(request, ref strMessage);
            if (!result)
            {
                strMessage += "--港股改单委托失败";
            }

            if (result)
            {
                strMessage = "";
            }

            return(result);
        }
        /// <summary>
        /// 买持仓检查
        /// </summary>
        /// <param name="strMessage"></param>
        /// <param name="hkEntrustInfo"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        private bool PO_HoldValidate_Buy(ref string strMessage, HK_TodayEntrustInfo hkEntrustInfo,
                                         HKOrderRequest request)
        {
            bool result = false;

            strMessage = "";

            int     position     = 0;
            decimal freezeAmount = 0;

            //var ahtMemory = MemoryDataManager.HKHoldMemoryList.GetByAccountHoldLogoId(HoldingAccountId);
            //if (ahtMemory == null)
            //{
            var ahtMemory = HKCommonLogic.GetHoldMemoryTable(hkEntrustInfo.HoldAccount, hkEntrustInfo.Code,
                                                             hkEntrustInfo.CurrencyTypeID);

            //}

            if (ahtMemory != null && ahtMemory.Data != null)
            {
                var aht = ahtMemory.Data;

                position     = Convert.ToInt32(aht.AvailableAmount);
                freezeAmount = aht.FreezeAmount;
            }
            else
            {
                position     = 0;
                freezeAmount = 0;
            }


            HKStockMinVolumeOfBusinessCommand command = new HKStockMinVolumeOfBusinessCommand(BreedClassID, position);

            result = command.Validate(request, ref strMessage);
            // if (ValidateCenter.ValidateHKMinVolumeOfBusiness(request, position, ref strMessage))
            if (result)
            {
                //获取持仓限制
                Decimal pLimit = MCService.GetPositionLimit(request.Code, CommonObject.Types.BreedClassTypeEnum.HKStock).PositionValue;
                //可用持仓+冻结量+委托量<持仓限制            //这里是改单,所以要把之前的委托减去
                result = pLimit >=
                         position + freezeAmount + Convert.ToDecimal(request.OrderAmount - hkEntrustInfo.EntrustAmount);
                if (!result)
                {
                    strMessage = "GT-2419:[港股改单委托验证]可用持仓+冻结量+委托量<持仓限制--港股改单委托失败";
                }
            }
            else
            {
                strMessage += "--港股改单委托失败";
            }


            //成功时需要清空错误信息。
            if (result)
            {
                strMessage = "";
            }

            return(result);
        }