/// <summary>
        /// 联合购买
        /// 代理商向恒朋系统发其一个联合购买请求只能包含一个联合购买方案。
        /// </summary>
        /// <param name="accountNo">代理商账户</param>
        /// <param name="transType">交易类型</param>
        /// <param name="anteInfo">联合购买方案信息</param>
        /// <param name="issue">奖期信息</param>
        /// <param name="anteTickets">联合购买方案投注票信息集合</param>
        /// <param name="anteBuies">联合购买方案认购主体信息集合</param>
        /// <param name="anteCommisions">联合购买方案佣金规则信息集合</param>
        /// <returns></returns>
        public string UniteAnteRequest(AccountNumber accountNo, TransactionType transType, UniteAnteInfo anteInfo, Issue issue, List<UniteAnteTicket> anteTickets, List<UniteAnteBuy> anteBuies, List<UniteAnteCommision> anteCommisions)
        {
            //if (transType.TypeCode.Trim() != "114")
            //    throw new Exception("交易类型和赠送彩金的交易类型不匹配。");

            try
            {
                DateTime now = DateTime.Now;
                    string body = "<body><uniteAnteRequest>";
                    //联合购买方案信息
                    body += "<uniteAnteInfo counterAnteId=\"" + anteInfo.CounterAnteId + "\" ";
                    body += "anteName=\"" + anteInfo.AnteName + "\" ";
                    body += "totalAnteMoney=\"" + anteInfo.TotalAnteMoney + "\" ";
                    body += "totalDeal=\"" + anteInfo.TotalDeal + "\" ";
                    body += "perDeal=\"" + anteInfo.PerDeal + "\" ";
                    body += "userName=\"" + anteInfo.UserName + "\" ";
                    body += "userName=\"" + anteInfo.UserName + "\" >";
                    body += "<issue gameName=\"" + issue.PlayMethodInfo.PlayName + "\" number=" + issue.Number + "\" /></uniteAnteInfo>";
                    //联合购买方案投注票明细信息
                    foreach(UniteAnteTicket anteTicket in anteTickets)
                    {
                        body += "<uniteAnteTicket ticketId=\"" + anteTicket.TicketId + "\" amount=\"" + anteTicket.Amount + "\" money=\"" + anteTicket.Money + "\" playType=\"" + anteTicket.PlayTypeInfo.ID + "\" >";
                        foreach (string anteCode in anteTicket.AnteCodes.Split(new char[] { '\n' }))//投注号
                        {
                            if (!(anteCode.Trim() == ""))
                            {
                                //<anteCode>01,02,03,04,05,06#01</anteCode>
                                body = body + "<anteCode>" + anteCode + "</anteCode>";
                            }
                        }
                        body += "</uniteAnteTicket>";
                    }
                    //联合购买方案认购主体的明细信息
                    foreach (UniteAnteBuy anteBuy in anteBuies)
                    {
                        //<uniteAnteBuy userName="******" cardType="1" mail="*****@*****.**"
                        //cardNumber="430923198009071234" bonusPhone="(0551)76526753" mobile="13098191231" realName="李侠" buyDeal="10" buyMoney="10"/>
                        body += "<uniteAnteBuy userName=\"" + anteBuy.UserName + "\" cardType=\"" + (int)anteBuy.CardType + "\" mail=\"" + anteBuy.Mail + "\" cardNumber=\"" + anteBuy.CardNumber + "\" bonusPhone=\"" + anteBuy.BonusPhone + "\" mobile=\"" + anteBuy.Mobile + "\" realName=\"" + anteBuy.RealName + "\" buyDeal=\"" + anteBuy.BuyDeal + "\" buyMoney=\"" +anteBuy.BuyMoney + "\" />";
                    }
                    //联合购买方案佣金规则信息
                    foreach (UniteAnteCommision anteCommision in anteCommisions)
                    {
                        //<uniteAnteCommision minMoney="100" maxMoney="1000" rate="4"/>
                        body += "<uniteAnteCommision minMoney=\"" + anteCommision.MinMoney +"\" maxMoney=\"" + anteCommision.MaxMoney + "\" rate=\"" + anteCommision.Rate + "\"/>";
                    }

                    body = body + "</uniteAnteRequest></body>";
                    string messageId = accountNo.UserName + now.ToString("yyyyMMdd") + PostManager.EightSerialNumber;
                    string timestamp = now.ToString("yyyyMMdd") + now.ToString("HHmmss");
                    string requestMessage = "transType=" + transType.TypeCode + "&transMessage=" + (((((((("<?xml version=\"1.0\" encoding=\"GBK\"?>" + "<message version=\"1.0\" id=\"" + messageId + "\">") + "<header>") + "<messengerID>" + accountNo.UserName + "</messengerID>") + "<timestamp>" + timestamp + "</timestamp>") + "<transactionType>" + transType.TypeCode + "</transactionType>") + "<digest>" + PostManager.MD5(messageId + timestamp + accountNo.UserPassword + body, "gb2312") + "</digest>") + "</header>") + body + "</message>");
                    string responseMessage = PostManager.Post(GatewayUrl, requestMessage, 120);
                    return responseMessage;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
        }
        /// <summary>
        /// 联合购买查询
        /// </summary>
        /// <param name="accountNo">代理商账户</param>
        /// <param name="transType">交易类型</param>
        /// <param name="anteInfo">联合购买方案信息</param>
        /// <returns></returns>
        public string UniteAnteQuery(AccountNumber accountNo, TransactionType transType, UniteAnteInfo anteInfo)
        {
            //if (transType.TypeCode.Trim() != "114")
            //    throw new Exception("交易类型和赠送彩金的交易类型不匹配。");

            try
            {
                DateTime now = DateTime.Now;
                string body = "<body><uniteAnteQuery counterAnteId=\"" + anteInfo.CounterAnteId  + "\" /></body>";
                string messageId = accountNo.UserName + now.ToString("yyyyMMdd") + now.ToString("HHmmss");
                string timestamp = now.ToString("yyyyMMdd") + now.ToString("HHmmss");
                string message = PostManager.Post(GatewayUrl, "transType=" + transType.TypeCode + "&transMessage=" + (((((((("<?xml version=\"1.0\" encoding=\"GBK\"?>" + "<message version=\"1.0\" id=\"" + messageId + "\">") + "<header>") + "<messengerID>" + accountNo.UserName + "</messengerID>") + "<timestamp>" + timestamp + "</timestamp>") + "<transactionType>106</transactionType>") + "<digest>" + PostManager.MD5(messageId + timestamp + accountNo.UserPassword + body, "gb2312") + "</digest>") + "</header>") + body + "</message>"), 120);
                string responseMessage = PostManager.Post(GatewayUrl, message, 120);
                return responseMessage;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }