Exemple #1
0
        protected override void AttachChildControls()
        {
            string a = this.Page.Request["action"].ToNullString();

            this.balanceWapPaymentTypeSelect = (this.FindControl("paymenttypeselect") as Common_WAPPaymentTypeSelect);
            this.spadvancetip     = (HtmlGenericControl)this.FindControl("spadvancetip");
            this.divReCharge      = (HtmlGenericControl)this.FindControl("divReCharge");
            this.divReChargeGift  = (HtmlGenericControl)this.FindControl("divReChargeGift");
            this.rptReChargeGift  = (WapTemplatedRepeater)this.FindControl("rptReChargeGift");
            this.hidRechargeMoney = (HtmlInputHidden)this.FindControl("hidRechargeMoney");
            if (HiContext.Current.SiteSettings.IsOpenRechargeGift)
            {
                List <RechargeGiftInfo> rechargeGiftItemList = PromoteHelper.GetRechargeGiftItemList();
                this.rptReChargeGift.DataSource = rechargeGiftItemList;
                this.rptReChargeGift.DataBind();
                this.divReCharge.Visible     = false;
                this.divReChargeGift.Visible = true;
                this.spadvancetip.Visible    = true;
            }
            else
            {
                this.divReCharge.Visible     = true;
                this.divReChargeGift.Visible = false;
                this.spadvancetip.Visible    = !HiContext.Current.SiteSettings.EnableBulkPaymentAdvance;
            }
            this.SaveClientTypeCookie(((int)base.ClientType).ToString());
            if (this.balanceWapPaymentTypeSelect != null)
            {
                this.balanceWapPaymentTypeSelect.ClientType     = base.ClientType;
                this.balanceWapPaymentTypeSelect.ShowBalancePay = false;
            }
            if (a == "toPay")
            {
                string text = this.Page.Request["InpourBlanceId"].ToNullString();
                if (text == "")
                {
                    this.ShowWapMessage("预付款充值ID为空", "RechargeRequest.aspx");
                }
                else
                {
                    InpourRequestInfo inpourBlance = MemberProcessor.GetInpourBlance(text);
                    if (inpourBlance == null)
                    {
                        this.ShowWapMessage("错误的预付款充值ID", "RechargeRequest.aspx");
                    }
                    else
                    {
                        this.Pay(inpourBlance);
                    }
                }
            }
        }
Exemple #2
0
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            string       empty          = string.Empty;

            this.spandemo         = (HtmlGenericControl)this.FindControl("spandemo");
            this.spandemo.Visible = masterSettings.IsDemoSite;
            this.litShipTo        = (Literal)this.FindControl("litShipTo");
            this.litCellPhone     = (Literal)this.FindControl("litCellPhone");
            this.litAddress       = (Literal)this.FindControl("litAddress");
            this.rptCartProducts  = (Common_SubmmitCartProducts)this.FindControl("Common_SubmmitCartProducts");
            this.rptCartProducts.ItemDataBound += this.rptCartProducts_ItemDataBound;
            this.rptCartGifts                = (WapTemplatedRepeater)this.FindControl("rptCartGifts");
            this.rptCartPointGifts           = (WapTemplatedRepeater)this.FindControl("rptCartPointGifts");
            this.divGifts                    = (HtmlGenericControl)this.FindControl("divGifts");
            this.dropCoupon                  = (Common_CouponSelect)this.FindControl("dropCoupon");
            this.lblOrderTotal               = (Label)this.FindControl("lblOrderTotal");
            this.groupbuyHiddenBox           = (HtmlInputControl)this.FindControl("groupbuyHiddenBox");
            this.countdownHiddenBox          = (HtmlInputControl)this.FindControl("countdownHiddenBox");
            this.fightGroupHiddenBox         = (HtmlInputControl)this.FindControl("fightGroupHiddenBox");
            this.fightGroupActivityHiddenBox = (HtmlInputControl)this.FindControl("fightGroupActivityHiddenBox");
            this.lblTotalPrice               = (HtmlGenericControl)this.FindControl("lblTotalPrice");
            this.lblTotalPrice1              = (HtmlGenericControl)this.FindControl("lblTotalPrice1");
            this.lblTax                    = (HtmlGenericControl)this.FindControl("lblTax");
            this.rptPromotions             = (WapTemplatedRepeater)this.FindControl("rptPromotions");
            this.rptShippingType           = (WapTemplatedRepeater)this.FindControl("rptShippingType");
            this.paymenttypeselect         = (Common_WAPPaymentTypeSelect)this.FindControl("paymenttypeselect");
            this.hidIsMultiStore           = (HtmlInputHidden)this.FindControl("hidIsMultiStore");
            this.hdCurrentckIds            = (HtmlInputControl)this.FindControl("hdCurrentckIds");
            this.hidShoppingDeduction      = (HtmlInputHidden)this.FindControl("hidShoppingDeduction");
            this.hidCanPointUseWithCoupon  = (HtmlInputHidden)this.FindControl("hidCanPointUseWithCoupon");
            this.lblMaxPoints              = (Label)this.FindControl("lblMaxPoints");
            this.hidTotalPrice             = (HtmlInputHidden)this.FindControl("hidTotalPrice");
            this.txtUsePoints              = (HtmlInputText)this.FindControl("txtUsePoint");
            this.hidShoppingDeductionRatio = (HtmlInputHidden)this.FindControl("hidShoppingDeductionRatio");
            this.hidMyPoints               = (HtmlInputHidden)this.FindControl("hidMyPoints");
            this.hidOrderRate              = (HtmlInputHidden)this.FindControl("hidOrderRate");
            this.inputPaymentModeId        = (HtmlInputHidden)this.FindControl("inputPaymentModeId");
            this.hidStoreId                = (HtmlInputHidden)this.FindControl("hidStoreId");
            this.hidChooseStoreId          = (HtmlInputHidden)this.FindControl("hidChooseStoreId");
            this.hidStoreName              = (HtmlInputHidden)this.FindControl("hidStoreName");
            this.lblMaxPointsToPrice       = (Label)this.FindControl("lblMaxPointsToPrice");
            this.lblDeductibleMoney        = (HtmlGenericControl)this.FindControl("lblDeductibleMoney");
            this.litTaxRate                = (Label)this.FindControl("litTaxRate");
            this.hlkFeeFreight             = (HyperLink)this.FindControl("hlkFeeFreight");
            this.hlkReducedPromotion       = (HyperLink)this.FindControl("hlkReducedPromotion");
            this.rptOrderCoupon            = (WapTemplatedRepeater)this.FindControl("rptOrderCoupon");
            this.htmlCouponCode            = (HtmlInputHidden)this.FindControl("htmlCouponCode");
            this.couponName                = (HtmlGenericControl)this.FindControl("couponName");
            this.litCouponAmout            = (HtmlGenericControl)this.FindControl("litCouponAmout");
            this.hidCanUsePoint            = (HtmlInputHidden)this.FindControl("hidCanUsePoint");
            this.divTax                    = (HtmlGenericControl)this.FindControl("divTax");
            this.spanTaxRate               = (HtmlGenericControl)this.FindControl("spanTaxRate");
            this.lblGiftFeright            = (Label)this.FindControl("lblGiftFeright");
            this.hidHasSupplierProduct     = (HtmlInputHidden)this.FindControl("hidHasSupplierProduct");
            this.hidPointRate              = (HtmlInputHidden)this.FindControl("hidPointRate");
            this.divlinegifts              = (HtmlGenericControl)this.FindControl("divlinegifts");
            this.hidOnlinePayCount         = (HtmlInputHidden)this.FindControl("hidOnlinePayCount");
            this.hidHasStoresInCity        = (HtmlInputHidden)this.FindControl("hidHasStoresInCity");
            this.hidPaymentId_Offline      = (HtmlInputHidden)this.FindControl("hidPaymentId_Offline");
            this.storeName                 = (HtmlGenericControl)this.FindControl("storeName");
            this.storeTel                  = (HtmlGenericControl)this.FindControl("storeTel");
            this.storeAddress              = (HtmlGenericControl)this.FindControl("storeAddress");
            this.storeTime                 = (HtmlGenericControl)this.FindControl("storeTime");
            this.storeDistance             = (HtmlGenericControl)this.FindControl("storeDistance");
            this.hidIsSubmitInTime         = (HtmlInputHidden)this.FindControl("hidIsSubmitInTime");
            this.hidInputItemsJson         = (HtmlInputHidden)this.FindControl("hidInputItemsJson");
            this.hidInvoiceType            = (HtmlInputHidden)this.FindControl("hidInvoiceType");
            this.hidInvoiceTitle           = (HtmlInputHidden)this.FindControl("hidInvoiceTitle");
            this.hidInvoiceTaxpayerNumber  = (HtmlInputHidden)this.FindControl("hidInvoiceTaxpayerNumber");
            this.hidOpenBalancePay         = (HtmlInputHidden)this.FindControl("hidOpenBalancePay");
            this.hidBalanceAmount          = (HtmlInputHidden)this.FindControl("hidBalanceAmount");
            this.lblBalance                = (Label)this.FindControl("lblBalance");
            this.hidEnableTax              = (HtmlInputHidden)this.FindControl("hidEnableTax");
            this.hidEnableETax             = (HtmlInputHidden)this.FindControl("hidEnableETax");
            this.hidEnableVATTax           = (HtmlInputHidden)this.FindControl("hidEnableVATTax");
            this.hidVATTaxRate             = (HtmlInputHidden)this.FindControl("hidVATTaxRate");
            this.hidTaxRate                = (HtmlInputHidden)this.FindControl("hidTaxRate");
            this.hidVATInvoiceDays         = (HtmlInputHidden)this.FindControl("hidVATInvoiceDays");
            this.litAfterSaleDays          = (Literal)this.FindControl("litAfterSaleDays");
            this.litInvoiceSendDays        = (Literal)this.FindControl("litInvoiceSendDays");
            this.hidInvoiceId              = (HtmlInputHidden)this.FindControl("hidInvoiceId");
            this.hidIsPersonal             = (HtmlInputHidden)this.FindControl("hidIsPersonal");
            this.hidInvoiceType            = (HtmlInputHidden)this.FindControl("hidInvoiceType");
            this.hidInvoiceJson            = (HtmlInputHidden)this.FindControl("hidInvoiceJson");
            this.hidInvoiceTitle           = (HtmlInputHidden)this.FindControl("hidInvoiceTitle");
            this.hidInvoiceTaxpayerNumber  = (HtmlInputHidden)this.FindControl("hidInvoiceTaxpayerNumber");
            this.hidOpenBalancePay.Value   = masterSettings.OpenBalancePay.ToNullString().ToLower();
            HtmlInputHidden htmlInputHidden = this.hidEnableETax;
            bool            flag            = masterSettings.EnableTax;

            htmlInputHidden.Value = flag.ToString().ToLower();
            HtmlInputHidden htmlInputHidden2 = this.hidEnableTax;

            flag = masterSettings.EnableE_Invoice;
            htmlInputHidden2.Value = flag.ToString().ToLower();
            HtmlInputHidden htmlInputHidden3 = this.hidEnableVATTax;

            flag = masterSettings.EnableVATInvoice;
            htmlInputHidden3.Value       = flag.ToString().ToLower();
            this.hidVATTaxRate.Value     = masterSettings.VATTaxRate.ToNullString();
            this.hidTaxRate.Value        = masterSettings.TaxRate.ToNullString();
            this.hidVATInvoiceDays.Value = masterSettings.VATInvoiceDays.ToNullString();
            this.litAfterSaleDays.SetWhenIsNotNull(masterSettings.EndOrderDays.ToNullString());
            this.litInvoiceSendDays.SetWhenIsNotNull((masterSettings.EndOrderDays + masterSettings.VATInvoiceDays).ToNullString());
            this.hidOpenBalancePay.Value = masterSettings.OpenBalancePay.ToNullString().ToLower();
            this.hidIsPreSale            = (HtmlInputHidden)this.FindControl("hidIsPreSale");
            this.lblAmount           = (HtmlGenericControl)this.FindControl("lblAmount");
            this.lblDepositMoney     = (HtmlGenericControl)this.FindControl("lblDepositMoney");
            this.lblRetainage        = (HtmlGenericControl)this.FindControl("lblRetainage");
            this.hidHasTradePassword = (HtmlInputHidden)this.FindControl("hidHasTradePassword");
            this.hidIsGeneralMuti    = (HtmlInputHidden)this.FindControl("hidIsGeneralMuti");
            if (this.hidPointRate != null)
            {
                this.hidPointRate.Value = HiContext.Current.SiteSettings.PointsRate.F2ToString("f2");
            }
            this.buyAmount                = this.Page.Request.QueryString["buyAmount"].ToInt(0);
            this.productSku               = this.Page.Request.QueryString["productSku"].ToNullString();
            this.groupBuyId               = this.Page.Request.QueryString["groupBuyId"].ToInt(0);
            this.countDownId              = this.Page.Request.QueryString["countdownId"].ToInt(0);
            this.fightGroupActivityId     = this.Page.Request.QueryString["fightGroupActivityId"].ToInt(0);
            this.fightGroupId             = this.Page.Request.QueryString["fightGroupId"].ToInt(0);
            this.hidHasStoresInCity.Value = "false";
            if (this.buyAmount > 0 && !string.IsNullOrEmpty(this.productSku) && !string.IsNullOrEmpty(this.from) && (this.from == "signbuy" || this.from == "groupbuy" || this.from == "countdown" || this.from == "fightgroup" || this.from == "presale"))
            {
                if (this.isGroupBuy)
                {
                    this.groupbuyHiddenBox.SetWhenIsNotNull(this.groupBuyId.ToString());
                    this.cart = ShoppingCartProcessor.GetGroupBuyShoppingCart(this.productSku, this.buyAmount);
                }
                else if (this.isCountDown)
                {
                    this.countdownHiddenBox.SetWhenIsNotNull(this.countDownId.ToString());
                }
                else if (this.isFightGroup)
                {
                    this.fightGroupHiddenBox.SetWhenIsNotNull(this.fightGroupId.ToString());
                    this.fightGroupActivityHiddenBox.SetWhenIsNotNull(this.fightGroupActivityId.ToString());
                }
                else if (this.isPreSale)
                {
                    this.hidIsPreSale.Value = "1";
                    this.FindControl("ulpresale").Visible = true;
                }
                this.hdCurrentckIds.Value = this.productSku;
            }
            else
            {
                string value = string.Empty;
                if (string.IsNullOrEmpty(this.productSku))
                {
                    HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["ckids"];
                    if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                    {
                        value = Globals.UrlDecode(httpCookie.Value);
                    }
                }
                else
                {
                    value = this.productSku;
                }
                this.hdCurrentckIds.Value = value;
            }
            if (this.cart != null && ((this.cart.LineItems != null && this.cart.LineItems.Count > 0) || (this.cart.LineGifts != null && this.cart.LineGifts.Count > 0)))
            {
                if (!TradeHelper.CheckShoppingStock(this.cart, out empty, this.storeId))
                {
                    this.ShowWapMessage("订单中有商品(" + empty + ")库存不足", "ShoppingCart.aspx");
                }
                this.hidOnlinePayCount.Value = TradeHelper.WapPaymentTypeCount(base.ClientType, this.isFightGroup).ToNullString();
                this.bindShippingPaymentInfo();
                this.divTax.Visible = false;
                Label   label = this.litTaxRate;
                decimal num   = masterSettings.TaxRate;
                label.Text = num.ToString(CultureInfo.InvariantCulture);
                this.spanTaxRate.Visible = (masterSettings.TaxRate > decimal.Zero);
                this.hidOrderRate.Value  = ((masterSettings.TaxRate > decimal.Zero) ? (this.cart.GetTotal(this.storeId > 0) * masterSettings.TaxRate / 100m).F2ToString("f2") : "0.00");
                MemberInfo user = Users.GetUser(HiContext.Current.UserId);
                this.hidHasTradePassword.Value = (string.IsNullOrWhiteSpace(user.TradePassword) ? "0" : "1");
                this.hidBalanceAmount.Value    = (user.Balance - user.RequestBalance).F2ToString("f2");
                this.lblBalance.Text           = (user.Balance - user.RequestBalance).F2ToString("f2");
                this.bindCouponInfo();
                this.rptCartProducts.RegionId = this.userRegionId;
                var dataSource = (from i in (from i in this.cart.LineItems
                                             select new
                {
                    i.SupplierId,
                    i.SupplierName
                }).Distinct()
                                  orderby i.SupplierId
                                  select i).ToList();
                this.rptCartProducts.DataSource   = dataSource;
                this.rptCartProducts.ShoppingCart = this.cart;
                this.rptCartProducts.StoreId      = this.storeId;
                this.rptCartProducts.DataBind();
                if ((from i in this.cart.LineItems
                     where i.SupplierId == 0
                     select i).Count() <= 0)
                {
                    this.divTax.Visible = false;
                }
                if ((from i in this.cart.LineItems
                     where i.SupplierId > 0
                     select i).Count() > 0)
                {
                    this.hidHasSupplierProduct.Value = "1";
                }
                if (this.isPreSale)
                {
                    decimal            num2 = default(decimal);
                    ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.PresaleId);
                    if (this.cart != null)
                    {
                        num2 = ((productPreSaleInfo.Deposit == decimal.Zero) ? (this.cart.LineItems[0].MemberPrice * (decimal)productPreSaleInfo.DepositPercent / 100m) : productPreSaleInfo.Deposit) * (decimal)this.cart.LineItems[0].Quantity;
                    }
                    this.lblTotalPrice.InnerHtml = this.cart.GetAmount(false).F2ToString("f2");
                    HtmlGenericControl htmlGenericControl = this.lblTotalPrice1;
                    Label  label2 = this.lblOrderTotal;
                    string text3  = htmlGenericControl.InnerText = (label2.Text = num2.F2ToString("f2"));
                    this.lblDepositMoney.InnerText = num2.F2ToString("f2");
                    decimal num3 = this.cart.GetTotal(false) - num2;
                    if (num3 < decimal.Zero)
                    {
                        num3 = default(decimal);
                    }
                    this.lblRetainage.InnerText = num3.F2ToString("f2");
                    this.lblAmount.InnerText    = (num2 + num3).F2ToString("f2");
                    HtmlInputHidden htmlInputHidden4 = this.hidTotalPrice;
                    num = this.cart.GetTotal(false);
                    htmlInputHidden4.Value = num.ToString();
                }
                else
                {
                    HtmlInputHidden    htmlInputHidden5    = this.hidTotalPrice;
                    Label              label3              = this.lblOrderTotal;
                    string             text3               = htmlInputHidden5.Value = (label3.Text = this.cart.GetTotal(this.storeId > 0).F2ToString("f2"));
                    HtmlGenericControl htmlGenericControl2 = this.lblTotalPrice1;
                    HtmlGenericControl htmlGenericControl3 = this.lblTotalPrice;
                    text3 = (htmlGenericControl2.InnerText = (htmlGenericControl3.InnerHtml = this.cart.GetAmount(this.storeId > 0).F2ToString("f2")));
                }
                if (this.cart != null)
                {
                    this.BindSendGifts();
                    if (this.storeId <= 0)
                    {
                        this.BindPointGifts();
                    }
                }
                this.hidCanPointUseWithCoupon.Value = "false";
                this.hidCanUsePoint.Value           = "false";
                bool flag2 = true;
                if (this.isGroupBuy || this.isCountDown || this.cart.LineItems.Count == 0 || this.isFightGroup)
                {
                    flag2 = false;
                }
                if (flag2 && user != null && masterSettings.ShoppingDeduction > 0 && user.Points > 0)
                {
                    int     shoppingDeductionRatio = masterSettings.ShoppingDeductionRatio;
                    decimal num4 = (decimal)shoppingDeductionRatio * this.cart.GetTotal(this.storeId > 0) * (decimal)masterSettings.ShoppingDeduction / 100m;
                    int     num5 = ((decimal)user.Points > num4) ? ((int)num4) : user.Points;
                    decimal d2   = Math.Round((decimal)num5 / (decimal)masterSettings.ShoppingDeduction, 2);
                    if (d2 > decimal.Zero && num5 > 0)
                    {
                        HtmlInputHidden htmlInputHidden6 = this.hidShoppingDeduction;
                        int             num6             = masterSettings.ShoppingDeduction;
                        htmlInputHidden6.Value               = num6.ToString();
                        this.lblMaxPoints.Text               = num5.ToString();
                        this.lblMaxPointsToPrice.Text        = (num5 / masterSettings.ShoppingDeduction).F2ToString("f2");
                        this.hidCanPointUseWithCoupon.Value  = (masterSettings.CanPointUseWithCoupon ? "true" : "false");
                        this.hidShoppingDeductionRatio.Value = shoppingDeductionRatio.ToString();
                        HtmlInputHidden htmlInputHidden7 = this.hidMyPoints;
                        num6 = user.Points;
                        htmlInputHidden7.Value    = num6.ToString();
                        this.hidCanUsePoint.Value = "true";
                    }
                }
                this.bindPromtionsInfo();
                this.BindLastInvoiceInfo();
                ShoppingCartItemInfo shoppingCartItemInfo = this.cart.LineItems.FirstOrDefault();
                int         productId          = shoppingCartItemInfo.ProductId;
                ProductInfo productBaseDetails = ProductHelper.GetProductBaseDetails(productId);
                IList <ProductInputItemInfo> productInputItemList = ProductHelper.GetProductInputItemList(productId);
                this.hidIsGeneralMuti.Value = productBaseDetails.IsGenerateMore.ToNullString().ToLower();
                string value2 = JsonConvert.SerializeObject(new
                {
                    list = from d in productInputItemList
                           select new
                    {
                        d.Id,
                        d.InputFieldTitle,
                        d.InputFieldType,
                        d.IsRequired,
                        d.InputFileValues
                    }
                });
                this.hidInputItemsJson.Value = value2;
                PageTitle.AddSiteNameTitle("订单确认");
            }
            else if (!this.hasError)
            {
                this.ShowWapMessage("该订单没有任何商品,请重新选择", "default.aspx");
            }
        }
Exemple #3
0
 private void LoadAllControls()
 {
     this.liFullReduction          = (HtmlGenericControl)this.FindControl("liFullReduction");
     this.litFightGroupStatusLabel = (FightGroupStatusLabel)this.FindControl("litFightGroupStatusLabel");
     this.ensureRecieved           = (HtmlAnchor)this.FindControl("ensureRecieved");
     this.btnOrderRefund           = (HtmlAnchor)this.FindControl("btnOrderRefund");
     this.btnOrderClose            = (HtmlAnchor)this.FindControl("btnOrderClose");
     this.lookupQRCode             = (HtmlAnchor)this.FindControl("lookupQRCode");
     this.litOrderId               = (Literal)this.FindControl("litOrderId");
     this.litOrderDate             = (Literal)this.FindControl("litOrderDate");
     this.litOrderStatus           = (Literal)this.FindControl("litOrderStatus");
     this.rptOrderProducts         = (Common_MemberOrderProducts)this.FindControl("rptOrderProducts");
     this.litTotalPrice            = (Literal)this.FindControl("litTotalPrice");
     this.litPayTime               = (Literal)this.FindControl("litPayTime");
     this.divstoreinfo             = (HtmlGenericControl)this.FindControl("divstoreinfo");
     this.orderStatus              = (HtmlInputHidden)this.FindControl("orderStatus");
     this.hidOrderId               = (HtmlInputHidden)this.FindControl("hidOrderId");
     this.dvClose                  = (HtmlControl)this.FindControl("dvClose");
     this.litRemark                = (Literal)this.FindControl("litRemark");
     this.litShipToDate            = (Literal)this.FindControl("litShipToDate");
     this.litTakeCode              = (Literal)this.FindControl("litTakeCode");
     this.litCloseReason           = (Literal)this.FindControl("litCloseReason");
     this.litCounponPrice          = (Literal)this.FindControl("litCounponPrice");
     this.litPointsPrice           = (Literal)this.FindControl("litPointsPrice");
     this.liPointPrice             = (HtmlGenericControl)this.FindControl("liPointPrice");
     this.litBuildPrice            = (Literal)this.FindControl("litBuildPrice");
     this.litDisCountPrice         = (Literal)this.FindControl("litDisCountPrice");
     this.litFreight               = (Literal)this.FindControl("litFreight");
     this.litFreight2              = (Literal)this.FindControl("litFreight2");
     this.litInvoiceTitle          = (Literal)this.FindControl("litInvoiceTitle");
     this.litInvoiceTaxpayerNumber = (Literal)this.FindControl("litInvoiceTaxpayerNumber");
     this.liInvoiceTitle           = (HtmlGenericControl)this.FindControl("liInvoiceTitle");
     this.liInvoiceTaxpayerNumber  = (HtmlGenericControl)this.FindControl("liInvoiceTaxpayerNumber");
     this.liCounponPrice           = (HtmlGenericControl)this.FindControl("liCounponPrice");
     this.liDiscountPrice          = (HtmlGenericControl)this.FindControl("liDiscountPrice");
     this.litFullCapacityReduction = (Literal)this.FindControl("litFullCapacityReduction");
     this.litPaymentMode           = (Literal)this.FindControl("litPaymentMode");
     this.btnOrderCancel           = (HtmlAnchor)this.FindControl("btnOrderCancel");
     this.litTax                = (Literal)this.FindControl("litTax");
     this.rptCartGifts          = (WapTemplatedRepeater)this.FindControl("rptCartGifts");
     this.rptPromotionGifts     = (WapTemplatedRepeater)this.FindControl("rptPromotionGifts");
     this.divRefund             = (HtmlGenericControl)this.FindControl("divRefund");
     this.litRefundMoney        = (Literal)this.FindControl("litRefundMoney");
     this.divRefundPoint        = (HtmlGenericControl)this.FindControl("divRefundPoint");
     this.divGifts              = (HtmlGenericControl)this.FindControl("divGifts");
     this.divProducts           = (HtmlGenericControl)this.FindControl("divProducts");
     this.litRefundPoint        = (Literal)this.FindControl("litRefundPoint");
     this.liTax                 = (HtmlGenericControl)this.FindControl("liTax");
     this.btnToPay              = (HtmlAnchor)this.FindControl("btnToPay");
     this.paymenttypeselect     = (Common_WAPPaymentTypeSelect)this.FindControl("paymenttypeselect");
     this.hidpresaleStaut       = (HtmlInputHidden)this.FindControl("hidpresaleStaut");
     this.litDepositDate        = (Literal)this.FindControl("litDepositDate");
     this.litFinalDate          = (Literal)this.FindControl("litFinalDate");
     this.litDeposit            = (Literal)this.FindControl("litDeposit");
     this.litFinal              = (Literal)this.FindControl("litFinal");
     this.lit_ValidDate         = (Literal)this.FindControl("lit_ValidDate");
     this.rptVerCode            = (Repeater)this.FindControl("rptVerCode");
     this.divOrderBtn           = (HtmlGenericControl)this.FindControl("divOrderBtn");
     this.rptOrderInputItemInfo = (Repeater)this.FindControl("rptOrderInputItemInfo");
     this.divOrderInputItemInfo = (HtmlGenericControl)this.FindControl("divOrderInputItemInfo");
     this.litOrderInputItemInfo = (Literal)this.FindControl("litOrderInputItemInfo");
 }
 private void rptOrders_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         HtmlAnchor         htmlAnchor           = (HtmlAnchor)e.Item.FindControl("lkbtnCouponCode");
         HtmlAnchor         htmlAnchor2          = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForRefund");
         HtmlAnchor         htmlAnchor3          = (HtmlAnchor)e.Item.FindControl("lnkClose");
         HtmlAnchor         htmlAnchor4          = (HtmlAnchor)e.Item.FindControl("lkbtnViewMessage");
         HtmlAnchor         htmlAnchor5          = (HtmlAnchor)e.Item.FindControl("lkbtnProductReview");
         Literal            literal              = (Literal)e.Item.FindControl("ltlOrderItems");
         Literal            literal2             = (Literal)e.Item.FindControl("ltlOrderGifts");
         HtmlGenericControl htmlGenericControl   = e.Item.FindControl("panelOperaters") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl2  = e.Item.FindControl("divToDetail") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl3  = e.Item.FindControl("divOrderStatus") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl4  = e.Item.FindControl("divOrderError") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl5  = e.Item.FindControl("divOrderGifts") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl6  = e.Item.FindControl("divOrderItems") as HtmlGenericControl;
         HtmlGenericControl htmlGenericControl7  = (HtmlGenericControl)e.Item.FindControl("OrderIdSpan");
         HtmlGenericControl htmlGenericControl8  = (HtmlGenericControl)e.Item.FindControl("PayMoneySpan");
         HtmlGenericControl htmlGenericControl9  = (HtmlGenericControl)e.Item.FindControl("TakeCodeDIV");
         HtmlAnchor         htmlAnchor6          = (HtmlAnchor)e.Item.FindControl("lnkViewLogistics");
         HtmlAnchor         htmlAnchor7          = (HtmlAnchor)e.Item.FindControl("lnkToPay");
         HtmlAnchor         htmlAnchor8          = (HtmlAnchor)e.Item.FindControl("lnkHelpLink");
         HtmlAnchor         htmlAnchor9          = (HtmlAnchor)e.Item.FindControl("lnkFinishOrder");
         HtmlAnchor         htmlAnchor10         = (HtmlAnchor)e.Item.FindControl("lnkViewTakeCodeQRCode");
         HtmlAnchor         htmlAnchor11         = (HtmlAnchor)e.Item.FindControl("lnkCertification");
         HtmlGenericControl htmlGenericControl10 = (HtmlGenericControl)e.Item.FindControl("divSendRedEnvelope");
         OrderStatus        orderStatus          = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "OrderStatus");
         Repeater           repeater             = (Repeater)e.Item.FindControl("Repeater1");
         Repeater           repeater2            = (Repeater)e.Item.FindControl("rptPointGifts");
         this.paymenttypeselect = (Common_WAPPaymentTypeSelect)this.FindControl("paymenttypeselect");
         Literal   literal3  = (Literal)e.Item.FindControl("litGiftTitle");
         string    text      = DataBinder.Eval(e.Item.DataItem, "OrderId").ToString();
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(text);
         if (orderInfo != null)
         {
             if (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.Finished || orderInfo.OrderStatus == OrderStatus.WaitReview || orderInfo.OrderStatus == OrderStatus.History)
             {
                 WeiXinRedEnvelopeInfo openedWeiXinRedEnvelope = WeiXinRedEnvelopeProcessor.GetOpenedWeiXinRedEnvelope();
                 bool visible = false;
                 if (openedWeiXinRedEnvelope != null && openedWeiXinRedEnvelope.EnableIssueMinAmount <= orderInfo.GetPayTotal() && orderInfo.OrderDate >= openedWeiXinRedEnvelope.ActiveStartTime && orderInfo.OrderDate <= openedWeiXinRedEnvelope.ActiveEndTime)
                 {
                     visible = true;
                 }
                 if (htmlGenericControl10 != null)
                 {
                     htmlGenericControl10.Visible = visible;
                     if (this.isVShop)
                     {
                         htmlGenericControl10.InnerHtml = "<a href=\"/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId + "\"></a>";
                     }
                     else
                     {
                         htmlGenericControl10.InnerHtml = "";
                         string text2 = Globals.HttpsFullPath("/vshop/SendRedEnvelope.aspx?OrderId=" + orderInfo.OrderId);
                         htmlGenericControl10.Attributes.Add("onclick", string.Format("ShowMsg('{0}','{1}')", "代金红包请前往微信端领取!", "false"));
                     }
                 }
             }
             this.paymenttypeselect.ClientType = base.ClientType;
             htmlGenericControl4.Visible       = (orderInfo.IsError && orderInfo.CloseReason != "订单已退款完成");
             htmlGenericControl3.Visible       = !orderInfo.IsError;
             htmlGenericControl5.Visible       = (orderInfo.LineItems.Count() == 0);
             htmlGenericControl6.Visible       = (orderInfo.LineItems.Count() > 0);
             htmlAnchor2.HRef   = "ApplyRefund.aspx?OrderId=" + text;
             htmlAnchor.Visible = false;
             htmlAnchor.HRef    = "MemberOrdersVCode?OrderId=" + text;
             HtmlGenericControl htmlGenericControl11 = (HtmlGenericControl)e.Item.FindControl("OrderSupplierH3");
             string             text3 = string.Empty;
             if (htmlGenericControl11 != null)
             {
                 text3 = htmlGenericControl11.Attributes["class"];
                 text3 = ((!string.IsNullOrEmpty(text3)) ? text3.Replace(" ztitle", "").Replace("stitle", "") : "");
             }
             if (orderInfo.OrderStatus != OrderStatus.WaitBuyerPay || !(orderInfo.ParentOrderId == "-1") || !orderInfo.OrderId.Contains("P"))
             {
                 if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !string.IsNullOrWhiteSpace(orderInfo.StoreName))
                 {
                     htmlGenericControl7.InnerText = orderInfo.StoreName;
                     text3 += " mtitle";
                 }
                 else if (orderInfo.StoreId == 0 && HiContext.Current.SiteSettings.OpenSupplier && orderInfo.SupplierId > 0)
                 {
                     htmlGenericControl7.InnerText = orderInfo.ShipperName;
                     text3 += " stitle";
                 }
                 else
                 {
                     htmlGenericControl7.InnerText = "平台";
                     text3 += " ztitle";
                 }
                 htmlGenericControl11.Attributes["class"] = text3;
                 if (orderInfo.LineItems.Count <= 0)
                 {
                     literal3.Text = "(礼)";
                 }
             }
             else
             {
                 htmlGenericControl7.InnerText            = orderInfo.OrderId;
                 htmlGenericControl11.Attributes["class"] = text3;
             }
             if (orderInfo.PreSaleId > 0)
             {
                 htmlGenericControl8.InnerText = (orderInfo.Deposit + orderInfo.FinalPayment).F2ToString("f2");
             }
             else
             {
                 htmlGenericControl8.InnerText = Convert.ToDecimal(DataBinder.Eval(e.Item.DataItem, "OrderTotal")).F2ToString("f2");
             }
             if (htmlGenericControl2 != null)
             {
                 if (orderInfo.OrderType == OrderType.ServiceOrder)
                 {
                     htmlGenericControl2.Attributes.Add("onclick", "window.location.href='ServiceMemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'");
                 }
                 else
                 {
                     htmlGenericControl2.Attributes.Add("onclick", "window.location.href='MemberOrderDetails.aspx?orderId=" + orderInfo.OrderId + "'");
                 }
             }
             if (htmlAnchor6 != null)
             {
                 if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent || orderInfo.OrderStatus == OrderStatus.Finished)
                 {
                     if (!string.IsNullOrEmpty(orderInfo.ExpressCompanyAbb) && !string.IsNullOrEmpty(orderInfo.ShipOrderNumber))
                     {
                         htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text;
                     }
                     else if (orderInfo.ExpressCompanyName == "同城物流配送")
                     {
                         htmlAnchor6.HRef = "MyLogistics.aspx?OrderId=" + text;
                     }
                     else
                     {
                         htmlAnchor6.Visible = false;
                     }
                 }
                 else
                 {
                     htmlAnchor6.Visible = false;
                 }
             }
             if (htmlAnchor10 != null)
             {
                 htmlAnchor10.HRef = "ViewQRCode.aspx?orderId=" + orderInfo.OrderId;
             }
             int num4;
             if (htmlAnchor5 != null && ((orderStatus == OrderStatus.Finished && orderInfo.LineItems.Count > 0) || (orderStatus == OrderStatus.Closed && orderInfo.OnlyReturnedCount == orderInfo.LineItems.Count && orderInfo.LineItems.Count > 0)))
             {
                 htmlAnchor5.Visible = true;
                 htmlAnchor5.HRef    = "MemberSubmitProductReview.aspx?orderId=" + text;
                 DataTable    productReviewAll = ProductBrowser.GetProductReviewAll(text);
                 LineItemInfo lineItemInfo     = new LineItemInfo();
                 int          num  = 0;
                 int          num2 = 0;
                 int          num3 = 0;
                 bool         flag = false;
                 foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems)
                 {
                     flag         = false;
                     lineItemInfo = lineItem.Value;
                     for (int i = 0; i < productReviewAll.Rows.Count; i++)
                     {
                         num4 = lineItemInfo.ProductId;
                         if (num4.ToString() == productReviewAll.Rows[i][0].ToString() && lineItemInfo.SkuId.ToString().Trim() == productReviewAll.Rows[i][1].ToString().Trim())
                         {
                             flag = true;
                         }
                     }
                     if (!flag)
                     {
                         num2++;
                     }
                     else
                     {
                         num3++;
                     }
                 }
                 if (num + num2 == orderInfo.LineItems.Count)
                 {
                     htmlAnchor5.InnerText = "查看评论";
                 }
                 else
                 {
                     SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                     if (masterSettings != null)
                     {
                         if (masterSettings.ProductCommentPoint <= 0)
                         {
                             htmlAnchor5.InnerText = "评价";
                         }
                         else
                         {
                             htmlAnchor5.InnerText = $"评价得{num3 * masterSettings.ProductCommentPoint}积分";
                         }
                     }
                 }
             }
             if (htmlAnchor3 != null && orderStatus == OrderStatus.WaitBuyerPay)
             {
                 if (orderInfo.PreSaleId == 0 || (orderInfo.PreSaleId > 0 && !orderInfo.DepositDate.HasValue))
                 {
                     htmlAnchor3.Visible = true;
                 }
                 htmlAnchor3.Attributes.Add("onclick", $"closeOrder('{text}')");
             }
             DateTime dateTime;
             if (htmlAnchor7 != null)
             {
                 if (orderStatus == OrderStatus.WaitBuyerPay && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.PaymentTypeId != -3 && orderInfo.Gateway != "hishop.plugins.payment.bankrequest" && orderInfo.Gateway != "hishop.plugins.payment.podrequest")
                 {
                     htmlAnchor7.Attributes.Add("IsServiceOrder", (orderInfo.OrderType == OrderType.ServiceOrder).ToString().ToLower());
                     if (orderInfo.PreSaleId > 0)
                     {
                         ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId);
                         if (!orderInfo.DepositDate.HasValue)
                         {
                             htmlGenericControl8.InnerText = orderInfo.Deposit.F2ToString("f2");
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥";
                             if (productPreSaleInfo.PreSaleEndDate > DateTime.Now)
                             {
                                 AttributeCollection attributes = htmlAnchor7.Attributes;
                                 num4 = orderInfo.PaymentTypeId;
                                 attributes.Add("PaymentTypeId", num4.ToString());
                                 htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                                 htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.Deposit.F2ToString("f2"));
                                 AttributeCollection attributes2 = htmlAnchor7.Attributes;
                                 num4 = orderInfo.FightGroupId;
                                 attributes2.Add("FightGroupId", num4.ToString());
                             }
                             else
                             {
                                 htmlAnchor7.Visible = false;
                                 (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "定金:¥";
                             }
                         }
                         else if (productPreSaleInfo.PaymentStartDate > DateTime.Now || productPreSaleInfo.PaymentEndDate < DateTime.Now)
                         {
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥";
                             htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2");
                             htmlAnchor7.Visible           = false;
                             htmlAnchor3.Visible           = false;
                             if (productPreSaleInfo.PaymentEndDate < DateTime.Now)
                             {
                                 (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款支付结束";
                                 htmlGenericControl8.Visible = false;
                             }
                         }
                         else
                         {
                             AttributeCollection attributes3 = htmlAnchor7.Attributes;
                             num4 = orderInfo.PaymentTypeId;
                             attributes3.Add("PaymentTypeId", num4.ToString());
                             htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                             htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.FinalPayment.F2ToString("f2"));
                             AttributeCollection attributes4 = htmlAnchor7.Attributes;
                             num4 = orderInfo.FightGroupId;
                             attributes4.Add("FightGroupId", num4.ToString());
                             htmlGenericControl8.InnerText = orderInfo.FinalPayment.F2ToString("f2");
                             (e.Item.FindControl("sptotal") as HtmlGenericControl).InnerText = "尾款:¥";
                             htmlAnchor3.Visible = false;
                         }
                     }
                     else
                     {
                         AttributeCollection attributes5 = htmlAnchor7.Attributes;
                         num4 = orderInfo.PaymentTypeId;
                         attributes5.Add("PaymentTypeId", num4.ToString());
                         htmlAnchor7.Attributes.Add("OrderId", orderInfo.OrderId);
                         htmlAnchor7.Attributes.Add("OrderTotal", orderInfo.GetTotal(false).F2ToString("f2"));
                         AttributeCollection attributes6 = htmlAnchor7.Attributes;
                         num4 = orderInfo.FightGroupId;
                         attributes6.Add("FightGroupId", num4.ToString());
                         if (HiContext.Current.SiteSettings.OpenMultStore && orderInfo.StoreId > 0 && !SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime)
                         {
                             StoresInfo storeById = StoresHelper.GetStoreById(orderInfo.StoreId);
                             dateTime = DateTime.Now;
                             string str = dateTime.ToString("yyyy-MM-dd");
                             dateTime = storeById.OpenStartDate;
                             DateTime value = (str + " " + dateTime.ToString("HH:mm")).ToDateTime().Value;
                             dateTime = DateTime.Now;
                             string str2 = dateTime.ToString("yyyy-MM-dd");
                             dateTime = storeById.OpenEndDate;
                             DateTime dateTime2 = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime().Value;
                             if (dateTime2 <= value)
                             {
                                 dateTime2 = dateTime2.AddDays(1.0);
                             }
                             if (DateTime.Now < value || DateTime.Now > dateTime2)
                             {
                                 htmlAnchor7.Attributes.Add("NeedNotInTimeTip", "1");
                             }
                         }
                     }
                 }
                 else
                 {
                     htmlAnchor7.Visible = false;
                 }
             }
             if (htmlAnchor8 != null)
             {
                 if (orderInfo.Gateway == "hishop.plugins.payment.bankrequest" && orderInfo.OrderStatus == OrderStatus.WaitBuyerPay)
                 {
                     htmlAnchor8.HRef = "FinishOrder.aspx?OrderId=" + text + "&onlyHelp=true";
                 }
                 else
                 {
                     htmlAnchor8.Visible = false;
                 }
             }
             if (htmlAnchor9 != null)
             {
                 if (orderInfo.OrderStatus == OrderStatus.SellerAlreadySent && orderInfo.ItemStatus == OrderItemStatus.Nomarl)
                 {
                     htmlAnchor9.Attributes.Add("onclick", $"FinishOrder('{text}','{orderInfo.PaymentType}',{orderInfo.LineItems.Count})");
                 }
                 else
                 {
                     htmlAnchor9.Visible = false;
                 }
             }
             if (htmlAnchor11 != null)
             {
                 if (HiContext.Current.SiteSettings.IsOpenCertification && orderInfo.IDStatus == 0 && orderInfo.IsincludeCrossBorderGoods)
                 {
                     htmlAnchor11.Attributes.Add("orderId", orderInfo.OrderId);
                     htmlAnchor11.Attributes.Add("onclick", "Certification(this)");
                     htmlAnchor11.Visible = true;
                 }
                 else
                 {
                     htmlAnchor11.Visible = false;
                 }
             }
             if (literal != null)
             {
                 Literal literal4 = literal;
                 num4          = this.GetGoodsNum(orderInfo);
                 literal4.Text = num4.ToString();
             }
             if (literal2 != null)
             {
                 Literal literal5 = literal2;
                 num4          = this.GetGiftsNum(orderInfo);
                 literal5.Text = num4.ToString();
             }
             if (orderInfo.OrderType == OrderType.ServiceOrder)
             {
                 Label label = (Label)e.Item.FindControl("OrderStatusLabel2");
                 IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(orderInfo.OrderId);
                 ServiceOrderStatus orderStatus2 = this.GetOrderStatus(orderInfo, orderVerificationItems);
                 label.Text    = ((Enum)(object)orderStatus2).ToDescription();
                 label.Visible = true;
             }
             else
             {
                 OrderStatusLabel orderStatusLabel = (OrderStatusLabel)e.Item.FindControl("OrderStatusLabel1");
                 orderStatusLabel.OrderItemStatus    = ((orderInfo.ItemStatus != 0) ? OrderItemStatus.HasReturnOrReplace : OrderItemStatus.Nomarl);
                 orderStatusLabel.Gateway            = orderInfo.Gateway;
                 orderStatusLabel.OrderStatusCode    = orderInfo.OrderStatus;
                 orderStatusLabel.ShipmentModelId    = orderInfo.ShippingModeId;
                 orderStatusLabel.IsConfirm          = orderInfo.IsConfirm;
                 orderStatusLabel.ShipmentModelId    = orderInfo.ShippingModeId;
                 orderStatusLabel.PaymentTypeId      = orderInfo.PaymentTypeId;
                 orderStatusLabel.PreSaleId          = orderInfo.PreSaleId;
                 orderStatusLabel.DepositDate        = orderInfo.DepositDate;
                 orderStatusLabel.OrderType          = orderInfo.OrderType;
                 orderStatusLabel.ExpressCompanyName = orderInfo.ExpressCompanyName;
                 orderStatusLabel.DadaStatus         = orderInfo.DadaStatus;
                 orderStatusLabel.Visible            = true;
             }
             Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems;
             foreach (string key in lineItems.Keys)
             {
                 lineItems[key].IsValid = (orderInfo.OrderType == OrderType.ServiceOrder);
             }
             repeater.DataSource     = lineItems.Values;
             repeater.ItemDataBound += this.Repeater1_ItemDataBound;
             repeater.DataBind();
             if (orderInfo.LineItems.Count == 0)
             {
                 IEnumerable <OrderGiftInfo> enumerable = from a in orderInfo.Gifts
                                                          where a.PromoteType == 0 || a.PromoteType == 15
                                                          select a;
                 foreach (OrderGiftInfo item in enumerable)
                 {
                     item.NeedPoint = ((orderInfo.OrderType == OrderType.ServiceOrder) ? 1 : 0);
                 }
                 repeater2.DataSource     = enumerable;
                 repeater2.ItemDataBound += this.rptPointGifts_ItemDataBound;
                 repeater2.DataBind();
             }
             OrderItemStatus itemStatus = orderInfo.ItemStatus;
             DateTime        obj;
             if (DataBinder.Eval(e.Item.DataItem, "FinishDate") != DBNull.Value)
             {
                 obj = (DateTime)DataBinder.Eval(e.Item.DataItem, "FinishDate");
             }
             else
             {
                 dateTime = DateTime.Now;
                 obj      = dateTime.AddYears(-1);
             }
             DateTime dateTime3 = obj;
             string   text4     = "";
             if (DataBinder.Eval(e.Item.DataItem, "Gateway") != null && !(DataBinder.Eval(e.Item.DataItem, "Gateway") is DBNull))
             {
                 text4 = (string)DataBinder.Eval(e.Item.DataItem, "Gateway");
             }
             RefundInfo refundInfo = TradeHelper.GetRefundInfo(text);
             if (htmlAnchor2 != null)
             {
                 if (orderInfo.OrderType == OrderType.ServiceOrder)
                 {
                     htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0);
                     if (htmlAnchor2.Visible)
                     {
                         LineItemInfo value2 = orderInfo.LineItems.FirstOrDefault().Value;
                         if (value2.IsRefund)
                         {
                             if (value2.IsOverRefund)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else if (value2.IsValid)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else if (DateTime.Now >= value2.ValidStartDate.Value && DateTime.Now <= value2.ValidEndDate.Value)
                             {
                                 htmlAnchor2.Visible = true;
                             }
                             else
                             {
                                 htmlAnchor2.Visible = false;
                             }
                         }
                         else
                         {
                             htmlAnchor2.Visible = false;
                         }
                     }
                 }
                 else
                 {
                     htmlAnchor2.Visible = (orderStatus == OrderStatus.BuyerAlreadyPaid && orderInfo.ItemStatus == OrderItemStatus.Nomarl && orderInfo.LineItems.Count != 0 && orderInfo.GetPayTotal() > decimal.Zero);
                 }
             }
             if (htmlAnchor != null)
             {
                 htmlAnchor.Visible = (orderInfo.OrderType == OrderType.ServiceOrder && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid);
             }
             SiteSettings masterSettings2 = SettingsManager.GetMasterSettings();
             if (!string.IsNullOrEmpty(orderInfo.TakeCode) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid || orderInfo.OrderStatus == OrderStatus.WaitBuyerPay))
             {
                 htmlAnchor10.Visible = true;
             }
             if (!htmlAnchor2.Visible && !htmlAnchor4.Visible && !htmlAnchor10.Visible && !htmlAnchor6.Visible && !htmlAnchor3.Visible && !htmlAnchor7.Visible && !htmlAnchor8.Visible && !htmlAnchor9.Visible && !htmlAnchor5.Visible && !htmlAnchor.Visible)
             {
                 htmlGenericControl.Visible = false;
             }
             if (orderInfo.FightGroupId > 0)
             {
                 FightGroupInfo fightGroup = VShopHelper.GetFightGroup(orderInfo.FightGroupId);
                 if (fightGroup != null)
                 {
                     htmlAnchor2.Visible = (fightGroup.Status != 0 && orderInfo.GetPayTotal() > decimal.Zero && (refundInfo == null || refundInfo.HandleStatus == RefundStatus.Refused) && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid);
                 }
             }
         }
     }
 }