Exemplo n.º 1
0
        void ReBindPayment()
        {
            IList <PaymentModeInfo> paymentModes = ShoppingProcessor.GetPaymentModes();
            IList <PaymentModeInfo> list2        = new List <PaymentModeInfo>();
            HttpCookie cookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];

            if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
            {
                foreach (PaymentModeInfo info in paymentModes)
                {
                    if ((((string.Compare(info.Gateway, "hishop.plugins.payment.alipay_shortcut.shortcutrequest", true) == 0) || (string.Compare(info.Gateway, "hishop.plugins.payment.alipaydirect.directrequest", true) == 0)) || ((string.Compare(info.Gateway, "hishop.plugins.payment.alipayassure.assurerequest", true) == 0) || (string.Compare(info.Gateway, "hishop.plugins.payment.alipay.standardrequest", true) == 0))) || ((string.Compare(info.Gateway, "hishop.plugins.payment.advancerequest", true) != 0) || !HiContext.Current.User.IsAnonymous))
                    {
                        list2.Add(info);
                    }
                }
            }
            else
            {
                foreach (PaymentModeInfo info2 in paymentModes)
                {
                    if (string.Compare(info2.Gateway, "hishop.plugins.payment.alipay_shortcut.shortcutrequest", true) != 0)
                    {
                        list2.Add(info2);
                    }
                    if ((string.Compare(info2.Gateway, "hishop.plugins.payment.advancerequest", true) == 0) && HiContext.Current.User.IsAnonymous)
                    {
                        list2.Remove(info2);
                    }
                }
            }
            paymentModeList.DataSource = list2;
            paymentModeList.DataBind();
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("余额充值");
            this.litPaymentType = (Literal)this.FindControl("litPaymentType");
            IList <PaymentModeInfo> paymentModes   = ShoppingProcessor.GetPaymentModes();
            SiteSettings            masterSettings = SettingsManager.GetMasterSettings(true);
            StringBuilder           builder        = new StringBuilder();
            string userAgent = this.Page.Request.UserAgent;

            if ((masterSettings.EnableWeiXinRequest && userAgent.ToLower().Contains("micromessenger")) && masterSettings.IsValidationService)
            {
                builder.AppendLine("<div class=\"payway\" name=\"88\">微信支付</div>");
            }
            if ((paymentModes != null) && (paymentModes.Count > 0))
            {
                foreach (PaymentModeInfo info in paymentModes)
                {
                    string      xml      = HiCryptographer.Decrypt(info.Settings);
                    XmlDocument document = new XmlDocument();
                    document.LoadXml(xml);
                    if (document.GetElementsByTagName("Partner").Count != 0)
                    {
                        if ((masterSettings.EnableAlipayRequest && !string.IsNullOrEmpty(document.GetElementsByTagName("Partner")[0].InnerText)) && (!string.IsNullOrEmpty(document.GetElementsByTagName("Key")[0].InnerText) && !string.IsNullOrEmpty(document.GetElementsByTagName("Seller_account_name")[0].InnerText)))
                        {
                            builder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", info.ModeId, info.Name).AppendLine();
                        }
                    }
                    else if ((masterSettings.EnableWapShengPay && !string.IsNullOrEmpty(document.GetElementsByTagName("SenderId")[0].InnerText)) && !string.IsNullOrEmpty(document.GetElementsByTagName("SellerKey")[0].InnerText))
                    {
                        builder.AppendFormat("<div class=\"payway\" name=\"{0}\">{1}</div>", info.ModeId, info.Name).AppendLine();
                    }
                }
            }
            this.litPaymentType.Text = builder.ToString();
        }
        protected override void Render(HtmlTextWriter writer)
        {
            IList <PaymentModeInfo> paymentModes = ShoppingProcessor.GetPaymentModes();
            StringBuilder           builder      = new StringBuilder();

            if (Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.IsProLa)
            {
                builder.Append("<button  class=\"choose\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            }
            else
            {
                builder.Append("<button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            }

            builder.AppendLine("<ul id=\"selectPaymentType\" class=\"dropdown-menu\" role=\"menu\">");
            if (MemberProcessor.GetCurrentMember().RegSource == 0)
            {
                if (SettingsManager.GetMasterSettings(false).EnableWeiXinRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"88\">微信支付</a></li>");
                }

                if (SettingsManager.GetMasterSettings(false).EnableOffLineRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"99\">线下付款</a></li>");
                }
                if (SettingsManager.GetMasterSettings(false).EnablePodRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"0\">货到付款</a></li>");
                }
                if ((paymentModes != null) && (paymentModes.Count > 0))
                {
                    foreach (PaymentModeInfo info in paymentModes)
                    {
                        string      xml      = HiCryptographer.Decrypt(info.Settings);
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(xml);
                        if (document.GetElementsByTagName("Partner").Count != 0)
                        {
                            if ((!string.IsNullOrEmpty(document.GetElementsByTagName("Partner")[0].InnerText) && !string.IsNullOrEmpty(document.GetElementsByTagName("Key")[0].InnerText)))// && !string.IsNullOrEmpty(document.GetElementsByTagName("Seller_account_name")[0].InnerText)
                            {
                                builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                            }
                        }
                        else if ((SettingsManager.GetMasterSettings(false).EnableWapShengPay&& !string.IsNullOrEmpty(document.GetElementsByTagName("SenderId")[0].InnerText)) && !string.IsNullOrEmpty(document.GetElementsByTagName("SellerKey")[0].InnerText))
                        {
                            builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                        }
                    }
                }
                builder.AppendLine("</ul>");
                writer.Write(builder.ToString());
            }
            else
            {
                builder.AppendLine("</ul>");
                writer.Write(builder.ToString());
            }
        }
        protected override void Render(HtmlTextWriter writer)
        {
            IList <PaymentModeInfo> paymentModes   = ShoppingProcessor.GetPaymentModes();
            SiteSettings            masterSettings = SettingsManager.GetMasterSettings(true);
            StringBuilder           builder        = new StringBuilder();

            builder.Append("<button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\">请选择一种支付方式<span class=\"caret\"></span></button>");
            builder.AppendLine("<ul id=\"selectPaymentType\" class=\"dropdown-menu\" role=\"menu\">");
            string userAgent = this.Page.Request.UserAgent;

            if ((masterSettings.EnableWeiXinRequest && userAgent.ToLower().Contains("micromessenger")) && masterSettings.IsValidationService)
            {
                builder.AppendLine("<li><a href=\"#\" name=\"88\">微信支付</a></li>");
            }
            if (Globals.RequestQueryNum("bargainDetialId") <= 0)
            {
                if (masterSettings.EnableOffLineRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"99\">线下付款</a></li>");
                }
                if (masterSettings.EnablePodRequest)
                {
                    builder.AppendLine("<li><a href=\"#\" name=\"0\">货到付款</a></li>");
                }
            }
            if ((paymentModes != null) && (paymentModes.Count > 0))
            {
                foreach (PaymentModeInfo info in paymentModes)
                {
                    try
                    {
                        string      xml      = HiCryptographer.Decrypt(info.Settings);
                        XmlDocument document = new XmlDocument();
                        document.LoadXml(xml);
                        if (document.GetElementsByTagName("Partner").Count != 0)
                        {
                            if ((!userAgent.ToLower().Contains("micromessenger") || !masterSettings.IsValidationService) && ((masterSettings.EnableAlipayRequest && !string.IsNullOrEmpty(document.GetElementsByTagName("Partner")[0].InnerText)) && (!string.IsNullOrEmpty(document.GetElementsByTagName("Key")[0].InnerText) && !string.IsNullOrEmpty(document.GetElementsByTagName("Seller_account_name")[0].InnerText))))
                            {
                                builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                            }
                        }
                        else if ((masterSettings.EnableWapShengPay && !string.IsNullOrEmpty(document.GetElementsByTagName("SenderId")[0].InnerText)) && !string.IsNullOrEmpty(document.GetElementsByTagName("SellerKey")[0].InnerText))
                        {
                            builder.AppendFormat("<li><a href=\"#\" name=\"{0}\">{1}</a></li>", info.ModeId, info.Name).AppendLine();
                        }
                    }
                    catch
                    {
                    }
                }
            }
            builder.AppendLine("</ul>");
            writer.Write(builder.ToString());
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.LocalUrl = base.Server.UrlEncode(base.Request.Url.ToString());
            //this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
            this.btnBuy.Click             += new System.EventHandler(this.btnBuy_Click);
            this.btnDelete.Click          += new System.EventHandler(this.btnDelete_Click);
            this.grdProducts.RowDataBound += new System.Web.UI.WebControls.GridViewRowEventHandler(this.grdProducts_RowDataBound);
            if (!this.Page.IsPostBack)
            {
                DataTable dtSkuItems = ProductBrowser.GetSkuItems();
                ViewState["dtSkuItem"] = dtSkuItems;//存储到全局值

                DataTable dtProductRegion = ManagerHelper.GetProductRegion(string.Empty);
                ViewState["dtProductRegion"] = dtProductRegion;//存储到全局值

                DataTable dtRegion = ManagerHelper.GetRegion(string.Empty);

                //得到当前登录用户所在区域
                ListItem itemDefault = new ListItem("请选择送货地址", "", true);
                userAddress.Items.Add(itemDefault);
                ManagerInfo currentManager = ManagerHelper.GetCurrentManager();                                                                                  //当前登录用户信息
                IList <ShippingAddressInfo> shippingAddress = MemberProcessor.GetShippingAddresses(Convert.ToInt32("99999" + currentManager.UserId.ToString())); //(currentManager.ClientUserId);
                if (shippingAddress != null && shippingAddress.Count > 0)
                {
                    foreach (ShippingAddressInfo info in shippingAddress)
                    {
                        string   strText = info.ShipTo + info.CellPhone + GetRegionName(dtRegion, info.RegionId) + info.Address;
                        ListItem item    = new ListItem(strText, info.ShippingId.ToString(), true);
                        userAddress.Items.Add(item);
                    }
                }

                //添加配送方式下拉框
                ListItem itemGiveDefault = new ListItem("请选择支付方式", "", true);
                userGiveMode.Items.Add(itemGiveDefault);
                IList <ShippingModeInfo> shippingModes = ShoppingProcessor.GetShippingModes();
                if (shippingModes != null && shippingModes.Count > 0)
                {
                    foreach (ShippingModeInfo info in shippingModes)
                    {
                        ListItem itemGive = new ListItem(info.Name, info.ModeId.ToString(), true);
                        userGiveMode.Items.Add(itemGive);
                    }
                }

                //添加支付方式下拉框
                ListItem itemPayDefault = new ListItem("请选择支付方式", "", true);
                userPayMode.Items.Add(itemPayDefault);
                ListItem itemPayNotLine = new ListItem("线下支付", "99", true);
                userPayMode.Items.Add(itemPayNotLine);
                //得到数据库中的支付方式列表
                IList <PaymentModeInfo> paymentMode = ShoppingProcessor.GetPaymentModes();
                if (paymentMode != null && paymentMode.Count > 0)
                {
                    foreach (PaymentModeInfo info in paymentMode)
                    {
                        ListItem itemPay = new ListItem(info.Name, info.ModeId.ToString(), true);
                        userPayMode.Items.Add(itemPay);
                    }
                }

                //设置订单说明默认值
                this.txtOrderRemark.Text = "代理商采购订单";

                //绑定订货列表
                this.BindProducts();
            }
            CheckBoxColumn.RegisterClientCheckEvents(this.Page, this.Page.Form.ClientID);
        }
Exemplo n.º 6
0
        public void LoadOrderInfo()
        {
            PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(ShoppingProcessor.GetPaymentGateway(EnumPaymentType.OfflinePay));

            if (paymentMode != null)
            {
                this.litOfflinePayContent.SetWhenIsNotNull(paymentMode.Description);
            }
            this.hidOrderid.Value = this.orderId;
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            if (orderInfo == null || (orderInfo.UserId != 0 && orderInfo.UserId != HiContext.Current.UserId))
            {
                base.GotoResourceNotFound();
                return;
            }
            MemberInfo user = Users.GetUser(HiContext.Current.UserId);

            this.hidHasTradePassword.Value = (string.IsNullOrWhiteSpace(user.TradePassword) ? "0" : "1");
            if (orderInfo.ParentOrderId == "-1")
            {
                this.orderLink.HRef = base.GetRouteUrl("user_OrderList", new
                {
                    ParentOrderId = this.orderId
                });
                this.litOrderId.Text = OrderHelper.GetOrderIdsByParent(orderInfo.OrderId).Replace(",", "&nbsp;&nbsp;&nbsp;&nbsp;");
            }
            else
            {
                this.orderLink.HRef = base.GetRouteUrl("user_OrderDetails", new
                {
                    OrderId = this.orderId
                });
                this.litOrderId.Text = orderInfo.OrderId;
            }
            IList <string> paymentTypes = new List <string>();

            paymentTypes.Add("hishop.plugins.payment.podrequest");
            paymentTypes.Add("hishop.plugins.payment.bankrequest");
            paymentTypes.Add("hishop.plugins.payment.advancerequest");
            if (orderInfo.PreSaleId > 0)
            {
                this.litOrderPrice.Money = orderInfo.Deposit + orderInfo.FinalPayment;
            }
            else
            {
                this.litOrderPrice.Money = orderInfo.GetTotal(false);
            }
            if (orderInfo.PreSaleId > 0)
            {
                this.hidIsPreSale.Value = "1";
                if (!orderInfo.DepositDate.HasValue)
                {
                    this.litDeposittxt.Text = "定金:";
                    this.litDeposit.Money   = orderInfo.Deposit;
                }
                else
                {
                    this.litDeposittxt.Text = "尾款:";
                    this.litDeposit.Money   = orderInfo.FinalPayment;
                }
            }
            this.onlinePayPanel.Visible  = false;
            this.offlinePayPanel.Visible = false;
            int num;

            if ((orderInfo.PaymentTypeId != -3 || orderInfo.PaymentTypeId != -2) && orderInfo.Gateway != "hishop.plugins.payment.bankrequest" && orderInfo.PaymentType != "到店支付" && orderInfo.Gateway != "hishop.plugins.payment.podrequest")
            {
                num = ((orderInfo.OrderStatus == OrderStatus.WaitBuyerPay) ? 1 : 0);
                goto IL_02ea;
            }
            num = 0;
            goto IL_02ea;
IL_02ea:
            if (num != 0)
            {
                this.onlinePayPanel.Visible = true;
            }
            else if (orderInfo.Gateway == "hishop.plugins.payment.bankrequest")
            {
                this.offlinePayPanel.Visible = true;
            }
            string text = "";

            text = ((orderInfo.CountDownBuyId <= 0) ? (HiContext.Current.SiteSettings.CloseOrderDays + "天") : (HiContext.Current.SiteSettings.CountDownTime + "分钟"));
            PaymentModeInfo paymentMode2 = TradeHelper.GetPaymentMode("hishop.plugins.payment.podrequest");
            bool            flag         = false;

            if ((orderInfo.Gateway == "hishop.plugins.payment.podrequest" || (paymentMode2 != null && paymentMode2.ModeId == orderInfo.PaymentTypeId)) && orderInfo.PreSaleId <= 0)
            {
                flag = true;
            }
            switch (orderInfo.OrderStatus)
            {
            case OrderStatus.WaitBuyerPay:
                if (base.GetParameter("t", false).ToNullString() == "1")
                {
                    this.promptMsg.InnerHtml     = "银行系统可能会出现延时,如您已经支付,请耐心等待或者联系商家客服!";
                    this.msgTitle.InnerHtml      = "付款不成功,请重新支付!";
                    this.divfinish.Visible       = true;
                    this.onlinePayPanel.Visible  = false;
                    this.divOrderPayInfo.Visible = false;
                    this.imgPayResult.Src        = "/templates/pccommon/images/cart/ordererror.png";
                }
                if (orderInfo.PreSaleId > 0)
                {
                    if (orderInfo.DepositDate.HasValue)
                    {
                        this.promptMsg.InnerHtml = "定金支付成功,请按时支付尾款。";
                        this.msgTitle.InnerHtml  = "恭喜您,您的定金已支付成功!";
                    }
                    else
                    {
                        this.promptMsg.InnerHtml = "请支付定金。";
                        this.msgTitle.InnerHtml  = "订单提交成功,请您尽快支付定金!";
                    }
                    this.divfinish.Visible = true;
                }
                if (flag)
                {
                    this.msgTitle.InnerHtml = "货到付款订单提交成功,平台将及时给您发货";
                }
                break;

            case OrderStatus.BuyerAlreadyPaid:
                if (orderInfo.PaymentType == "上门自提")
                {
                    this.promptMsg.InnerHtml = "您的订单已支付成功,平台将及时给您备货。";
                    this.msgTitle.InnerHtml  = "恭喜您,您的订单已支付成功!";
                }
                else
                {
                    this.promptMsg.InnerHtml = "您的订单已支付成功,平台将及时给您发货。";
                    this.msgTitle.InnerHtml  = "恭喜您,您的订单已支付成功!";
                }
                this.divfinish.Visible = true;
                break;

            case OrderStatus.Closed:
                this.promptMsg.InnerHtml = "您的订单已关闭,关闭原因:" + orderInfo.CloseReason + "。";
                this.msgTitle.InnerHtml  = "您的订单已关闭!";
                this.divfinish.Visible   = true;
                break;

            case OrderStatus.Finished:
                this.promptMsg.InnerHtml = "您的订单已完成.";
                this.msgTitle.InnerHtml  = "恭喜您,您的订单已完成!";
                this.divfinish.Visible   = true;
                break;

            case OrderStatus.SellerAlreadySent:
                this.promptMsg.InnerHtml = "您的订单已发货,请注意收货。";
                this.msgTitle.InnerHtml  = "恭喜您,您的订单已发货!";
                this.divfinish.Visible   = true;
                break;

            default:
                this.promptMsg.InnerHtml = "您的订单已提交成功。";
                this.divfinish.Visible   = true;
                break;
            }
            if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid)
            {
                this.promptMsg.InnerHtml = "您的订单已支付成功,平台将及时给您发货。";
            }
            else if (orderInfo.PaymentTypeId != -3 && !flag && orderInfo.OrderStatus == OrderStatus.WaitBuyerPay)
            {
                DateTime dateTime;
                if (base.GetParameter("t", false).ToNullString() == "1")
                {
                    if (orderInfo.PreSaleId > 0 && orderInfo.DepositDate.HasValue)
                    {
                        this.promptMsg.InnerHtml = "定金支付成功,请按时支付尾款。";
                        ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId);
                        if (productPreSaleInfo.PaymentStartDate > DateTime.Now)
                        {
                            HtmlGenericControl htmlGenericControl = this.promptMsg;
                            string[]           obj = new string[5]
                            {
                                "定金支付成功,请您在",
                                null,
                                null,
                                null,
                                null
                            };
                            dateTime = productPreSaleInfo.PaymentStartDate;
                            obj[1]   = dateTime.ToString("yyyy-MM-dd");
                            obj[2]   = "至";
                            dateTime = productPreSaleInfo.PreSaleEndDate;
                            obj[3]   = dateTime.ToString("yyyy-MM-dd");
                            obj[4]   = "之间支付尾款,过期定金将不予以退还,请您谅解!";
                            htmlGenericControl.InnerHtml = string.Concat(obj);
                            this.onlinePayPanel.Visible  = false;
                        }
                    }
                    else
                    {
                        this.promptMsg.InnerHtml = "银行系统可能会出现延时,如您已经支付,请耐心等待或者联系商家客服!";
                    }
                }
                else if (orderInfo.PreSaleId > 0)
                {
                    if (orderInfo.DepositDate.HasValue)
                    {
                        this.promptMsg.InnerHtml = "定金支付成功,请按时支付尾款。";
                        ProductPreSaleInfo productPreSaleInfo2 = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId);
                        if (productPreSaleInfo2.PaymentStartDate > DateTime.Now)
                        {
                            HtmlGenericControl htmlGenericControl2 = this.promptMsg;
                            string[]           obj2 = new string[5]
                            {
                                "定金支付成功,请您在",
                                null,
                                null,
                                null,
                                null
                            };
                            dateTime = productPreSaleInfo2.PaymentStartDate;
                            obj2[1]  = dateTime.ToString("yyyy-MM-dd");
                            obj2[2]  = "至";
                            dateTime = productPreSaleInfo2.PaymentStartDate;
                            obj2[3]  = dateTime.ToString("yyyy-MM-dd");
                            obj2[4]  = "之间支付尾款,过期定金将不予以退还,请您谅解!";
                            htmlGenericControl2.InnerHtml = string.Concat(obj2);
                            this.onlinePayPanel.Visible   = false;
                        }
                    }
                    else
                    {
                        this.promptMsg.InnerHtml = "请您在订单提交后 <em>" + text + "</em>内完成定金支付,否则订单自动取消。";
                    }
                }
                else
                {
                    this.promptMsg.InnerHtml = "请您在订单提交后 <em>" + text + "</em>内完成支付,否则订单自动取消。";
                }
            }
            else if (flag)
            {
                this.promptMsg.InnerHtml = "您的订单选择了货到付款,平台将及时给您发货。";
            }
            else if (orderInfo.PaymentTypeId == -3)
            {
                this.promptMsg.InnerHtml = "您的订单选择了上门自提,门店正在备货中。";
            }
            if (this.onlinePayPanel.Visible)
            {
                DataTable dataTable = new DataTable();
                dataTable.Columns.Add(new DataColumn("ModeId"));
                dataTable.Columns.Add(new DataColumn("Name"));
                dataTable.Columns.Add(new DataColumn("GateWay"));
                dataTable.Columns.Add(new DataColumn("Description"));
                dataTable.Columns.Add(new DataColumn("OutHtml"));
                IList <PaymentModeInfo> paymentModes = ShoppingProcessor.GetPaymentModes(PayApplicationType.payOnPC);
                paymentModes = (from item in paymentModes
                                where !paymentTypes.Contains(item.Gateway)
                                select item).ToList();
                if (HiContext.Current.UserId != 0 && HiContext.Current.User.IsOpenBalance)
                {
                    PaymentModeInfo paymentMode3 = ShoppingProcessor.GetPaymentMode("hishop.plugins.payment.advancerequest");
                    if (paymentMode3 != null)
                    {
                        this.AdvanceId.Value = paymentMode3.ModeId.ToString();
                        paymentModes.Add(paymentMode3);
                    }
                }
                if (paymentModes.Count == 0)
                {
                    this.ShowMessage("商城暂未配置支付方式,请稍后支付。", false, "", 1);
                    this.onlinePayPanel.Visible = false;
                }
                else
                {
                    decimal num2 = default(decimal);
                    if (HiContext.Current.User != null && HiContext.Current.User.UserId > 0)
                    {
                        num2 = HiContext.Current.User.Balance - HiContext.Current.User.RequestBalance;
                    }
                    string format  = "<a class=\"pic\"><b><img src=\"/pay/images/{0}.png\" alt=\"{1}\"></b> <span>{1}</span></a>";
                    string text2   = "<a class=\"name\"><em>{0}</em> <b>可用余额 ¥{1}</b> <span><a href=\"/user/RechargeRequest.aspx\" target=\"_blank\" style=\"line-height:4.5\">去充值</a></span></a>";
                    string format2 = "<a class=\"name\"><em>{0}</em></a>";
                    int    num3    = 0;
                    foreach (PaymentModeInfo item in paymentModes)
                    {
                        if (!(item.Gateway.ToLower() == "hishop.plugins.payment.advancerequest") && (orderInfo.FightGroupActivityId <= 0 || TradeHelper.GatewayIsCanBackReturn(item.Gateway) || !(item.Gateway.ToLower() != "hishop.plugins.payment.advancerequest")))
                        {
                            DataRow dataRow = dataTable.NewRow();
                            dataRow["ModeId"]      = item.ModeId;
                            dataRow["Name"]        = item.Name;
                            dataRow["Gateway"]     = item.Gateway;
                            dataRow["Description"] = item.Description;
                            if (!(item.Gateway.ToLower() == "hishop.plugins.payment.advancerequest"))
                            {
                                if (File.Exists(this.Page.Server.MapPath("/pay/images/" + item.Gateway + ".png")))
                                {
                                    dataRow["OutHtml"] = string.Format(format, item.Gateway, item.Name);
                                }
                                else
                                {
                                    dataRow["OutHtml"] = string.Format(format2, item.Name);
                                }
                                dataTable.Rows.Add(dataRow);
                                num3++;
                            }
                        }
                    }
                    this.paymentModeList.DataSource = dataTable;
                    this.paymentModeList.DataBind();
                }
            }
        }