internal static FundInternalAcct OnRetrieveInternalAcct(String tellerno, String orgno, DateTime tradedate, InternalAcctCondtion condition, out String outmsg)
        {
            outmsg = "";
            FundInternalAcct resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.RetrieveInternalAcct(tellerno, orgno, tradedate, condition, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, tellerno, orgno, (int)MessageBizType.CoreInnerAcctRetrieve, codemsg);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Core, codemsg));
#endif
                InterAcctRetrieveData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as InterAcctRetrieveData;
                if (retdata != null)
                {
                    if (!String.IsNullOrEmpty(retdata.SyserrHandler.Message))
                    {
                        outmsg = retdata.SyserrHandler.Message;
                    }
                    else if (retdata.OmsgHandler.NUM_ENT > 0)
                    {
                        outmsg = MsgHandlerEntry.ExtractOMsg(retdata);
                    }
                    else
                    {
                        if (retdata.OData != null)
                        {
                            resultdetail = new FundInternalAcct();
                            resultdetail.AccountNO = CommonDataHelper.StrTrimer(retdata.OData.AccountNO, null);
                            resultdetail.OrgnaztionNO = CommonDataHelper.StrTrimer(retdata.OData.OrgnaztionNO, null);
                            resultdetail.Currcency = CommonDataHelper.StrTrimer(retdata.OData.Currcency, null);
                            resultdetail.SubjectNO = CommonDataHelper.StrTrimer(retdata.OData.SubjectNO, null);
                            resultdetail.SequenceNO = CommonDataHelper.StrTrimer(retdata.OData.SequenceNO, null);
                            resultdetail.AccountName = CommonDataHelper.StrTrimer(retdata.OData.AccountName, null);
                            resultdetail.PreviousTradeDate = CommonDataHelper.StrTrimer(retdata.OData.PreviousTradeDate, null);
                            resultdetail.PreviousBalanceDirection = CommonDataHelper.StrTrimer(retdata.OData.PreviousBalanceDirection, null);
                            resultdetail.PreviousBalance = CommonDataHelper.StrTrimer(retdata.OData.PreviousBalance, null);
                            resultdetail.BalanceDirection = CommonDataHelper.StrTrimer(retdata.OData.BalanceDirection, null);
                            resultdetail.CurrentBalance = CommonDataHelper.StrTrimer(retdata.OData.CurrentBalance, null);
                            resultdetail.OverdraftLimitation = CommonDataHelper.StrTrimer(retdata.OData.OverdraftLimitation, null);
                            resultdetail.Rate = CommonDataHelper.StrTrimer(retdata.OData.Rate, null);
                            resultdetail.OverdraftRate = CommonDataHelper.StrTrimer(retdata.OData.OverdraftRate, null);
                            resultdetail.InterestCumulation = CommonDataHelper.StrTrimer(retdata.OData.InterestCumulation, null);
                            resultdetail.OverdraftCumulation = CommonDataHelper.StrTrimer(retdata.OData.OverdraftCumulation, null);
                            resultdetail.UsageRange = CommonDataHelper.StrTrimer(retdata.OData.UsageRange, null);
                            resultdetail.IsEliminate = CommonDataHelper.StrTrimer(retdata.OData.IsEliminate, null);
                            resultdetail.IsExchangePay = CommonDataHelper.StrTrimer(retdata.OData.IsExchangePay, null);
                            resultdetail.SettlementType = CommonDataHelper.StrTrimer(retdata.OData.SettlementType, null);
                            resultdetail.IsSettlementWithAccount = CommonDataHelper.StrTrimer(retdata.OData.IsSettlementWithAccount, null);
                            resultdetail.IncomeAccount = CommonDataHelper.StrTrimer(retdata.OData.IncomeAccount, null);
                            resultdetail.PaymentAccount = CommonDataHelper.StrTrimer(retdata.OData.PaymentAccount, null);
                            resultdetail.AccountStatus = CommonDataHelper.StrTrimer(retdata.OData.AccountStatus, null);
                            resultdetail.AccountOrgan = CommonDataHelper.StrTrimer(retdata.OData.AccountOrgan, null);
                            resultdetail.HeadOrgan = CommonDataHelper.StrTrimer(retdata.OData.HeadOrgan, null);
                            resultdetail.CirculateExchangeLevel = CommonDataHelper.StrTrimer(retdata.OData.CirculateExchangeLevel, null);
                            resultdetail.AccountDate = CommonDataHelper.StrTrimer(retdata.OData.AccountDate, null);
                            resultdetail.AccountTeller = CommonDataHelper.StrTrimer(retdata.OData.AccountTeller, null);
                        }
                        //MQMsgCommonHelper.UpdateMQLog(recdata, null, outmsg, MsgLogState.RecvSucceed, out dbexception);
                        return resultdetail;
                    }                    
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                OnUpdateDBLog(recdata.MessageID, outmsg, MsgLogState.RecvFailed, out dbexception);
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                throw ex;
                //return resultdetail;
            }
        }
 /// <summary>
 /// 内部账查询
 /// </summary>
 /// <param name="tellerno">机构号</param>
 /// <param name="orgno">柜员号</param>
 /// <param name="tradedate">发生日期</param>
 /// <param name="condition">查询数据条件</param>
 /// <param name="result">结果数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>查询成功与否</returns>
 public static bool RetrieveInternalAcct(String tellerno, String orgno, DateTime tradedate, InternalAcctCondtion condition, out FundInternalAcct result, out String outmsg)
 {
     result = ClientSyncHelper.OnRetrieveInternalAcct(tellerno, orgno, tradedate, condition, out outmsg);
     if (result != null)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Core, outmsg);
     return false;
 }