internal static PaymentResult OnPayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, out String outmsg)
        {
            outmsg = "";
            PaymentResult resultdetail = null;
            byte[] codemsg = null;
            bool sent = false;
            string dbexception = "";
            MessageData recdata = null;
            MessageData reqdata = null;
            Guid msgid = Guid.Empty;
            try
            {
                msgid = MsgTransferUtility.PayInterBankBiz(tellerNO, orgNO, tradeDate, inputData, ref codemsg);
                reqdata = MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, tellerNO, orgNO, (int)MessageBizType.PayInterBank, codemsg, inputData.TransferFlowNo);
#if MQSYNC
                recdata = MQMsgHandlerEntry.DeliverMessage(reqdata, codemsg, out sent);
#else
                recdata = MsgHandlerEntry.DeliverMessage(MsgHandlerEntry.CreateMessageData(msgid, PlatformType.Payment, codemsg));
#endif
                PayInterBankData retdata = MsgTransfer.DecodeMsg(recdata.MessageID, recdata.CurrentRespPackage.PackageMessage) as PayInterBankData;
                MsgLogState statecode = MsgLogState.RecvFailed;
                if (retdata != null && retdata.RPData != null)
                {
                    resultdetail = new PaymentResult();
                    resultdetail.Succeed = (retdata.RPData.RetCode == "00");
                    resultdetail.HostReturnMessage = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    resultdetail.HostReturnCode = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnCode, null);
                    resultdetail.HostTranFlowNo = CommonDataHelper.StrTrimer(retdata.RPData.HostTranFlowNo, null);
                    resultdetail.TransSeq = CommonDataHelper.StrTrimer(retdata.RPData.TransSeq, null);
                    outmsg = CommonDataHelper.StrTrimer(retdata.RPData.HostReturnMessage, null);
                    
                    if (retdata.RPData.RetCode == "00")
                    {
                        statecode = MsgLogState.RecvSucceed;
                    }
                    else if (retdata.RPData.RetCode == "02")
                    {
                        statecode = MsgLogState.PayTimeOut;
                    }
                }
                else
                {
                    outmsg = MsgHandlerEntry.Type_Convert_Error;
                }
                //MQMsgCommonHelper.UpdateMQLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                OnUpdateDBLog(recdata, resultdetail.HostTranFlowNo, outmsg, statecode, out dbexception);
                return resultdetail;
            }
            catch (Exception ex)
            {
                outmsg = ex.Message;
                OnException(sent, reqdata, recdata, msgid, ex, outmsg);
                return resultdetail;
            }
        }
        private void buttonInterBank_Click(object sender, EventArgs e)
        {
            PayInterBank paydata = new PayInterBank();
            paydata.TransferFlowNo = textBoxIBFlowNO.Text.Trim();
            paydata.PayBank = textBoxOrgNO.Text.Trim();
            paydata.TranDate = DateTime.Now.ToString("yyyyMMdd");
            paydata.PayAccount = textBoxIBPayAccount.Text.Trim();
            paydata.PayAccountName = textBoxIBPayAccountName.Text.Trim();
            paydata.OnAccountSN = textBoxIBOnAccountSN.Text.Trim();
            paydata.RecAccount = textBoxIBRecAccount.Text.Trim();
            paydata.RecAccountName = textBoxIBRecAccountName.Text.Trim();
            paydata.RecAccountBanks = textBoxIBRecAccountBanks.Text.Trim();
            paydata.PackageChannelType = textBoxIBChannelType.Text.Trim();
            paydata.CurrencyType = textBoxIBCurrency.Text.Trim();
            paydata.PayAmount = textBoxIBPayAmount.Text.Trim();
            paydata.Rate = textBoxIBRate.Text.Trim();
            paydata.TimeLimit = textBoxIBTimeLimit.Text.Trim();
            paydata.BizType = textBoxIBBizType.Text.Trim();
            paydata.Fee = textBoxIBFee.Text.Trim();
            paydata.Remark = textBoxIBRemark.Text.Trim();
            paydata.Teller = textBoxTellerNO.Text.Trim();
            paydata.AuthTeller = textBoxIBAuthTeller.Text.Trim();
            //paydata.ChannelId = textBoxIBChannelID.Text.Trim();

            Guid messageID = MsgTransferUtility.PayInterBankBiz(paydata.Teller, paydata.PayBank, DateTime.Now, paydata, ref uLongText);
            MessageData msgdata = new MessageData { MessageID = messageID, FirstTime = DateTime.Now, TragetPlatform = PlatformType.Payment };
            msgdata.ReqPackageList.Enqueue(new PackageData(1, uLongText));
            msgdata.IsMultiPackage = false;
            DispatchMsg(msgdata);
        }
 /// <summary>
 /// 同业拆借
 /// </summary>
 /// <param name="tellerNO">柜员号</param>
 /// <param name="orgNO">机构号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">同业拆借的输入数据对象</param>
 /// <param name="codemsg"></param>
 /// <returns></returns>
 public static Guid PayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, ref byte[] codemsg)
 {
     PayInterBankData data = new PayInterBankData();
     data.RQData.PayBank = orgNO;
     data.RQData.Teller = tellerNO;
     data.RQData.TransferFlowNo = inputData.TransferFlowNo;//CommonDataHelper.PadLeft4BizFlowNO(inputData.TransferFlowNo, '0', 18);
     data.RQData.TranDate = tradeDate.ToString("yyyyMMdd");
     data.RQData.PayAccount = inputData.PayAccount;
     data.RQData.PayAccountName = inputData.PayAccountName;
     data.RQData.OnAccountSN = inputData.OnAccountSN;
     data.RQData.RecAccount = inputData.RecAccount;
     data.RQData.RecAccountName = inputData.RecAccountName;
     data.RQData.RecAccountBanks = inputData.RecAccountBanks;
     data.RQData.PackageChannelType = inputData.PackageChannelType;
     data.RQData.CurrencyType = inputData.CurrencyType;
     data.RQData.PayAmount = inputData.PayAmount;
     data.RQData.Rate = inputData.Rate;
     data.RQData.TimeLimit = inputData.TimeLimit;
     data.RQData.BizType = inputData.BizType;
     data.RQData.Fee = inputData.Fee;
     data.RQData.Remark = inputData.Remark;
     data.RQData.AuthTeller = inputData.AuthTeller;
     data.RQData.ChannelId = inputData.ChannelId;
     return MsgTransfer.CodeMsgToBinary(data, ref codemsg);
 }
 /// <summary>
 /// 同业拆借业务
 /// </summary>
 /// <param name="tellerNO">机构号</param>
 /// <param name="orgNO">柜员号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">输入数据</param>
 /// <param name="result">返回结果的数据</param>
 /// <param name="outmsg">失败时的信息</param>
 /// <returns>成功与否</returns>
 public static bool PayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, out PaymentResult result, out String outmsg)
 {
     result = ClientSyncHelper.OnPayInterBankBiz(tellerNO, orgNO, tradeDate, inputData, out outmsg);
     if (result != null && result.Succeed)
     {
         return true;
     }
     outmsg = string.Format("{0}{1}", MsgHandlerEntry.Info_Return_Pay, outmsg);
     return false;
 }
 /// <summary>
 /// 同业拆借
 /// </summary>
 /// <param name="tellerNO">柜员号</param>
 /// <param name="orgNO">机构号</param>
 /// <param name="tradeDate">交易日期</param>
 /// <param name="inputData">同业拆借的输入数据对象</param>
 /// <param name="codemsg"></param>
 /// <returns></returns>
 public static Guid PayInterBankBiz(String tellerNO, String orgNO, DateTime tradeDate, PayInterBank inputData, ref byte[] codemsg)
 {
     PayInterBankData data = new PayInterBankData();
     data.RQData.PayBank = orgNO;
     data.RQData.Teller = tellerNO;
     data.RQData.TransferFlowNo = inputData.TransferFlowNo;//CommonDataHelper.PadLeft4BizFlowNO(inputData.TransferFlowNo, '0', 18);
     data.RQData.TranDate = tradeDate.ToString("yyyyMMdd");
     data.RQData.PayAccount = inputData.PayAccount;
     data.RQData.PayAccountName = inputData.PayAccountName;
     data.RQData.OnAccountSN = inputData.OnAccountSN;
     data.RQData.RecAccount = inputData.RecAccount;
     data.RQData.RecAccountName = inputData.RecAccountName;
     data.RQData.RecAccountBanks = inputData.RecAccountBanks;
     data.RQData.PackageChannelType = inputData.PackageChannelType;
     data.RQData.CurrencyType = inputData.CurrencyType;
     data.RQData.PayAmount = inputData.PayAmount;
     data.RQData.Rate = inputData.Rate;
     data.RQData.TimeLimit = inputData.TimeLimit;
     data.RQData.BizType = inputData.BizType;
     data.RQData.Fee = inputData.Fee;
     data.RQData.Remark = inputData.Remark;
     data.RQData.AuthTeller = inputData.AuthTeller;
     data.RQData.ChannelId = inputData.ChannelId;
     try
     {
         return PreProcessPaymentMsg(data, ref codemsg);
     }
     catch (Exception ex)
     {
         throw new Exception(MESSAGE_ENCODE_EXCEPTION, ex);
     }
 }