コード例 #1
0
        protected override void AttachChildControls()
        {
            this.spanvcodecount = (HtmlGenericControl)this.FindControl("spanvcodecount");
            this.spanvcodetime  = (HtmlGenericControl)this.FindControl("spanvcodetime");
            this.rptVCodes      = (Repeater)this.FindControl("rptVCodes");
            this.orderId        = this.Page.Request.QueryString["orderId"];
            this.order          = ShoppingProcessor.GetOrderInfo(this.orderId);
            if (this.order == null || this.order.UserId != HiContext.Current.UserId || this.order.OrderType != OrderType.ServiceOrder)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(this.orderId);

            this.CreateVerificationCodeQRCode(orderVerificationItems);
            LineItemInfo value = this.order.LineItems.FirstOrDefault().Value;

            this.spanvcodecount.InnerHtml = orderVerificationItems.Count().ToString();
            string innerHtml = "长期有效";

            if (!value.IsValid && value.ValidStartDate.HasValue && value.ValidEndDate.HasValue)
            {
                DateTime value2 = value.ValidStartDate.Value;
                string   str    = value2.ToString("yyyy-MM-dd");
                value2    = value.ValidEndDate.Value;
                innerHtml = str + " 至 " + value2.ToString("yyyy-MM-dd");
            }
            this.spanvcodetime.InnerHtml  = innerHtml;
            this.rptVCodes.ItemDataBound += this.rptVCodes_ItemDataBound;
            this.rptVCodes.DataSource     = orderVerificationItems;
            this.rptVCodes.DataBind();
        }
コード例 #2
0
        private ServiceOrderStatus GetOrderStatus(OrderInfo order, IList <OrderVerificationItemInfo> orderVerificationItems = null)
        {
            ServiceOrderStatus result = ServiceOrderStatus.Finished;

            if (order.OrderStatus == OrderStatus.WaitBuyerPay)
            {
                result = ServiceOrderStatus.WaitBuyerPay;
            }
            else if (order.OrderStatus == OrderStatus.Closed)
            {
                result = ServiceOrderStatus.Closed;
            }
            else if (order.OrderStatus == OrderStatus.Finished)
            {
                result = ServiceOrderStatus.Finished;
            }
            else
            {
                IList <OrderVerificationItemInfo> source = orderVerificationItems;
                if (orderVerificationItems == null)
                {
                    source = TradeHelper.GetOrderVerificationItems(order.OrderId);
                }
                if (source.Any((OrderVerificationItemInfo d) => d.VerificationStatus == 0.GetHashCode()))
                {
                    result = ServiceOrderStatus.WaitConsumption;
                }
                else if (source.Any((OrderVerificationItemInfo d) => d.VerificationStatus == 3.GetHashCode()))
                {
                    result = ServiceOrderStatus.Expired;
                }
                else if (source.Count() > 0 && source.Count(delegate(OrderVerificationItemInfo d)
                {
                    int verificationStatus = d.VerificationStatus;
                    VerificationStatus verificationStatus2 = VerificationStatus.Refunded;
                    int result2;
                    if (verificationStatus != verificationStatus2.GetHashCode())
                    {
                        int verificationStatus3 = d.VerificationStatus;
                        verificationStatus2 = VerificationStatus.ApplyRefund;
                        result2 = ((verificationStatus3 != verificationStatus2.GetHashCode()) ? 1 : 0);
                    }
                    else
                    {
                        result2 = 0;
                    }
                    return((byte)result2 != 0);
                }) == 0)
                {
                    result = ServiceOrderStatus.Refunding;
                }
            }
            return(result);
        }
コード例 #3
0
        protected override void AttachChildControls()
        {
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.txtOrderId         = (HtmlInputHidden)this.FindControl("txtOrderId");
            this.litOrderIds        = (Literal)this.FindControl("litOrderIds");
            this.txtSkuId           = (HtmlInputHidden)this.FindControl("txtSkuId");
            this.txtRemark          = (TextBox)this.FindControl("txtRemark");
            this.litRefundMoney     = (Literal)this.FindControl("litRefundMoney");
            this.dropRefundType     = (WapRefundTypeDropDownList)this.FindControl("dropRefundType");
            this.DropRefundReason   = (WapAfterSalesReasonDropDownList)this.FindControl("RefundReasonDropDownList");
            this.btnRefund          = ButtonManager.Create(this.FindControl("btnRefund"));
            this.groupbuyPanel      = (HtmlGenericControl)this.FindControl("groupbuyPanel");
            this.hidOneRefundAmount = (HtmlInputHidden)this.FindControl("hidOneRefundAmount");
            this.hidIsServiceOrder  = (HtmlInputHidden)this.FindControl("hidIsServiceOrder");
            this.hidValidCodes      = (HtmlInputHidden)this.FindControl("hidValidCodes");
            this.rptOrderPassword   = (WapTemplatedRepeater)this.FindControl("rptOrderPassword");
            decimal num = default(decimal);
            decimal d   = default(decimal);

            this.txtOrderId.Value = this.OrderId;
            this.litOrderIds.Text = this.OrderId;
            this.txtSkuId.Value   = this.SkuId;
            this.order            = TradeHelper.GetOrderInfo(this.OrderId);
            if (this.order == null)
            {
                this.ShowError("错误的订单信息!");
            }
            else
            {
                this.IsServiceOrder           = (this.order.OrderType == OrderType.ServiceOrder);
                this.hidIsServiceOrder.Value  = (this.IsServiceOrder ? "1" : "0");
                this.hidOneRefundAmount.Value = "0";
                if (this.order.FightGroupId > 0)
                {
                    FightGroupInfo fightGroup = VShopHelper.GetFightGroup(this.order.FightGroupId);
                    if (fightGroup.Status != FightGroupStatus.FightGroupSuccess)
                    {
                        this.ShowError("火拼团订单成团之前不能进行退款操作!");
                        return;
                    }
                }
                GroupBuyInfo groupBuyInfo = null;
                if (this.order.GroupBuyId > 0)
                {
                    groupBuyInfo = ProductBrowser.GetGroupBuy(this.order.GroupBuyId);
                    if (groupBuyInfo != null)
                    {
                        if (this.groupbuyPanel != null && groupBuyInfo.Status != GroupBuyStatus.Failed)
                        {
                            this.groupbuyPanel.Visible = true;
                        }
                        if (groupBuyInfo.NeedPrice >= this.order.GetTotal(false) && groupBuyInfo.Status != GroupBuyStatus.Failed)
                        {
                            this.ShowError("团购违约金大于等于订单总金额,不能进行退款申请!");
                            return;
                        }
                    }
                    num = this.order.GetCanRefundAmount(this.SkuId, groupBuyInfo, 0);
                }
                else
                {
                    num = this.order.GetCanRefundAmount(this.SkuId, null, 0);
                }
                if (!this.IsServiceOrder)
                {
                    if (TradeHelper.IsOnlyOneSku(this.order))
                    {
                        this.SkuId = "";
                    }
                    if (!string.IsNullOrEmpty(this.SkuId) && !this.order.LineItems.ContainsKey(this.SkuId))
                    {
                        this.ShowError("错误的商品信息!");
                        return;
                    }
                    if (!TradeHelper.CanRefund(this.order, this.SkuId))
                    {
                        this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!");
                        return;
                    }
                    if (this.order.LineItems.ContainsKey(this.SkuId))
                    {
                        this.RefundItem = this.order.LineItems[this.SkuId];
                    }
                }
                else
                {
                    if (this.order.OrderStatus == OrderStatus.WaitBuyerPay || this.order.OrderStatus == OrderStatus.Closed || this.order.OrderStatus == OrderStatus.ApplyForRefund || this.order.OrderStatus == OrderStatus.Refunded)
                    {
                        this.ShowError("订单状态不正确,不能申请退款!");
                    }
                    bool         flag         = TradeHelper.GatewayIsCanBackReturn(this.order.Gateway);
                    bool         flag2        = this.order.Gateway.ToLower() == "hishop.plugins.payment.cashreceipts" && this.order.StoreId > 0 && this.order.ShippingModeId == -2;
                    MemberInfo   user         = Users.GetUser(this.order.UserId);
                    LineItemInfo lineItemInfo = this.order.LineItems.Values.FirstOrDefault();
                    if (!lineItemInfo.IsRefund)
                    {
                        this.ShowError("商品不支持退款!");
                    }
                    if (!lineItemInfo.IsValid && lineItemInfo.ValidEndDate.HasValue && lineItemInfo.ValidEndDate.Value < DateTime.Now && !lineItemInfo.IsOverRefund)
                    {
                        this.ShowError("已过有效期,不能申请退款!");
                    }
                    IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(this.order.OrderId);
                    if (orderVerificationItems == null || orderVerificationItems.Count == 0)
                    {
                        this.ShowError("核销码为空!");
                    }
                    IList <OrderVerificationItemInfo> list = null;
                    list = ((!lineItemInfo.ValidEndDate.HasValue || !(lineItemInfo.ValidEndDate.Value < DateTime.Now) || !lineItemInfo.IsOverRefund) ? (from vi in orderVerificationItems
                                                                                                                                                        where vi.VerificationStatus == 0
                                                                                                                                                        select vi).ToList() : (from vi in orderVerificationItems
                                                                                                                                                                               where vi.VerificationStatus == 0 || vi.VerificationStatus == 3
                                                                                                                                                                               select vi).ToList());
                    if (list == null || list.Count == 0)
                    {
                        this.ShowError("没有可以退款的核销码!");
                    }
                    DataTable dataTable = new DataTable();
                    dataTable.Columns.Add(new DataColumn("Index"));
                    dataTable.Columns.Add(new DataColumn("Password"));
                    for (int j = 0; j < list.Count; j++)
                    {
                        DataRow dataRow = dataTable.NewRow();
                        dataRow["Index"]    = j + 1;
                        dataRow["Password"] = list[j].VerificationPassword;
                        dataTable.Rows.Add(dataRow);
                    }
                    this.rptOrderPassword.DataSource = dataTable;
                    this.rptOrderPassword.DataBind();
                    d = (this.order.GetTotal(false) / (decimal)lineItemInfo.Quantity).F2ToString("f2").ToDecimal(0);
                    this.hidValidCodes.Value = string.Join(",", (from i in list
                                                                 select i.VerificationPassword).ToList());
                    this.hidOneRefundAmount.Value = d.ToString();
                    num = d * (decimal)list.Count;
                }
                if (num < decimal.Zero)
                {
                    this.ShowError("订单中已申请的退款金额超过了订单总额!");
                }
                else
                {
                    this.litRefundMoney.Text = num.F2ToString("f2");
                    PageTitle.AddSiteNameTitle("我的订单");
                    if (!this.Page.IsPostBack)
                    {
                        this.dropRefundType.IsServiceOrder = (this.order.OrderType == OrderType.ServiceOrder);
                        this.DropRefundReason.IsRefund     = true;
                        this.dropRefundType.preSaleId      = this.order.PreSaleId;
                        string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1);
                        this.dropRefundType.OrderGateWay  = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway);
                        this.dropRefundType.BalanceAmount = this.order.BalanceAmount;
                    }
                }
            }
        }
コード例 #4
0
        private void BindOrderInfo()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (this.order.BalanceAmount > decimal.Zero)
            {
                this.litBalanceAmount.Text = this.order.BalanceAmount.F2ToString("f2");
            }
            else
            {
                this.liBalanceAmount.Visible = false;
            }
            DateTime?nullable;
            DateTime dateTime;

            if (this.order.PreSaleId > 0)
            {
                this.litDeposit.Text = this.order.Deposit.F2ToString("f2");
                this.litFinal.Text   = this.order.FinalPayment.F2ToString("f2");
                nullable             = this.order.DepositDate;
                if (nullable.HasValue)
                {
                    Literal literal = this.litDepositDate;
                    nullable     = this.order.DepositDate;
                    literal.Text = nullable.ToString();
                }
                DateTime payDate = this.order.PayDate;
                if (this.order.PayDate != DateTime.MinValue)
                {
                    Literal literal2 = this.litFinalDate;
                    dateTime      = this.order.PayDate;
                    literal2.Text = dateTime.ToString();
                }
            }
            if (this.order.OrderStatus == OrderStatus.SellerAlreadySent && this.order.ItemStatus == OrderItemStatus.Nomarl)
            {
                this.ensureRecieved.Visible = true;
            }
            else
            {
                this.ensureRecieved.Visible = false;
            }
            if (this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished)
            {
                this.divOrderBtn.Visible = false;
            }
            if (string.IsNullOrEmpty(this.order.TakeCode) || string.IsNullOrEmpty(masterSettings.HiPOSAppId) || this.order.OrderStatus == OrderStatus.Finished || this.order.OrderStatus == OrderStatus.Closed)
            {
                this.lookupQRCode.Visible = false;
            }
            ProductPreSaleInfo productPreSaleInfo = null;
            int paymentTypeId;

            if (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway != EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.CashOnDelivery, 1) && this.order.PaymentTypeId != -3)
            {
                if (this.order.PreSaleId > 0)
                {
                    productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.order.PreSaleId);
                    nullable           = this.order.DepositDate;
                    if (!nullable.HasValue)
                    {
                        if (productPreSaleInfo.PreSaleEndDate > DateTime.Now)
                        {
                            this.btnToPay.Visible = true;
                            AttributeCollection attributes = this.btnToPay.Attributes;
                            paymentTypeId = this.order.PaymentTypeId;
                            attributes.Add("PaymentTypeId", paymentTypeId.ToString());
                            this.btnToPay.Attributes.Add("OrderId", this.orderId);
                            this.btnToPay.Attributes.Add("orderTotal", (this.order.Deposit - this.order.BalanceAmount).F2ToString("f2"));
                        }
                    }
                    else if (!(productPreSaleInfo.PaymentStartDate > DateTime.Now) && !(productPreSaleInfo.PaymentEndDate < DateTime.Now))
                    {
                        this.btnToPay.Visible = true;
                        AttributeCollection attributes2 = this.btnToPay.Attributes;
                        paymentTypeId = this.order.PaymentTypeId;
                        attributes2.Add("PaymentTypeId", paymentTypeId.ToString());
                        this.btnToPay.Attributes.Add("OrderId", this.orderId);
                        this.btnToPay.Attributes.Add("orderTotal", this.order.FinalPayment.F2ToString("f2"));
                    }
                }
                else
                {
                    AttributeCollection attributes3 = this.btnToPay.Attributes;
                    paymentTypeId = this.order.PaymentTypeId;
                    attributes3.Add("PaymentTypeId", paymentTypeId.ToString());
                    this.btnToPay.Visible = true;
                    this.btnToPay.Attributes.Add("OrderId", this.orderId);
                    this.btnToPay.Attributes.Add("orderTotal", this.order.GetTotal(true).F2ToString("f2"));
                    if (HiContext.Current.SiteSettings.OpenMultStore && this.order.StoreId > 0 && !SettingsManager.GetMasterSettings().Store_IsOrderInClosingTime)
                    {
                        StoresInfo storeById = StoresHelper.GetStoreById(this.order.StoreId);
                        dateTime = DateTime.Now;
                        string str = dateTime.ToString("yyyy-MM-dd");
                        dateTime = storeById.OpenStartDate;
                        nullable = (str + " " + dateTime.ToString("HH:mm")).ToDateTime();
                        DateTime value = nullable.Value;
                        dateTime = DateTime.Now;
                        string str2 = dateTime.ToString("yyyy-MM-dd");
                        dateTime = storeById.OpenEndDate;
                        nullable = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime();
                        DateTime dateTime2 = nullable.Value;
                        if (dateTime2 <= value)
                        {
                            dateTime2 = dateTime2.AddDays(1.0);
                        }
                        if (DateTime.Now < value || DateTime.Now > dateTime2)
                        {
                            this.btnToPay.Attributes.Add("NeedNotInTimeTip", "1");
                        }
                    }
                }
                if (this.order.Gateway == EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.OfflinePay, 1))
                {
                    this.btnToPay.InnerText = "线下支付帮助";
                    this.btnToPay.HRef      = "FinishOrder.aspx?OrderId=" + this.order.OrderId + "&onlyHelp=true";
                }
            }
            if (this.order.ReducedPromotionAmount <= decimal.Zero)
            {
                this.liFullReduction.Visible = false;
            }
            LineItemInfo value2 = this.order.LineItems.FirstOrDefault().Value;
            string       text   = "长期有效";
            int          num;

            if (!value2.IsValid)
            {
                nullable = value2.ValidStartDate;
                if (nullable.HasValue)
                {
                    nullable = value2.ValidEndDate;
                    num      = (nullable.HasValue ? 1 : 0);
                    goto IL_06a5;
                }
            }
            num = 0;
            goto IL_06a5;
IL_06a5:
            if (num != 0)
            {
                nullable = value2.ValidStartDate;
                dateTime = nullable.Value;
                string arg = dateTime.ToString("yyyy-MM-dd");
                nullable = value2.ValidEndDate;
                dateTime = nullable.Value;
                text     = string.Format("有效期&nbsp;&nbsp;{0} ~ {1}", arg, dateTime.ToString("yyyy-MM-dd"));
            }
            this.lit_ValidDate.Text = text;
            IList <OrderVerificationItemInfo> orderVerificationItems = TradeHelper.GetOrderVerificationItems(this.order.OrderId);
            ServiceOrderStatus serviceOrderStatus = this.GetOrderStatus(this.order, orderVerificationItems);

            this.litOrderStatus.Text = ((Enum)(object)serviceOrderStatus).ToDescription();
            this.CreateVerificationCodeQRCode(orderVerificationItems);
            this.rptVerCode.DataSource     = orderVerificationItems;
            this.rptVerCode.ItemDataBound += this.rptVerCode_ItemDataBound;
            this.rptVerCode.DataBind();
            this.litOrderId.Text = this.orderId;
            Literal literal3 = this.litOrderDate;

            dateTime      = this.order.OrderDate;
            literal3.Text = dateTime.ToString();
            this.litTotalPrice.SetWhenIsNotNull(this.order.GetAmount(false).F2ToString("f2"));
            Literal control = this.litPayTime;
            object  value3;

            if (!(this.order.PayDate != DateTime.MinValue))
            {
                value3 = "";
            }
            else
            {
                dateTime = this.order.PayDate;
                value3   = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            }
            control.SetWhenIsNotNull((string)value3);
            HtmlInputHidden control2 = this.orderStatus;

            paymentTypeId = (int)this.order.OrderStatus;
            control2.SetWhenIsNotNull(paymentTypeId.ToString());
            this.hidOrderId.SetWhenIsNotNull(this.orderId.ToString());
            this.litPaymentMode.SetWhenIsNotNull(this.order.PaymentType);
            this.litShipToDate.SetWhenIsNotNull(this.order.ShipToDate);
            if (this.order.PreSaleId > 0)
            {
                this.litBuildPrice.SetWhenIsNotNull((this.order.Deposit + this.order.FinalPayment).F2ToString("f2"));
            }
            else
            {
                this.litBuildPrice.SetWhenIsNotNull(this.order.GetPayTotal().F2ToString("f2"));
            }
            this.litRemark.SetWhenIsNotNull(this.order.Remark);
            this.litTakeCode.SetWhenIsNotNull((this.order.ShippingModeId == -2) ? this.order.TakeCode : "");
            this.litFreight.SetWhenIsNotNull(this.order.AdjustedFreight.F2ToString("f2"));
            this.litFreight2.SetWhenIsNotNull(this.order.AdjustedFreight.F2ToString("f2"));
            this.litFullCapacityReduction.SetWhenIsNotNull("-" + this.order.ReducedPromotionAmount.F2ToString("f2"));
            if (this.order.PreSaleId > 0)
            {
                if (productPreSaleInfo == null)
                {
                    productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.order.PreSaleId);
                }
                nullable = this.order.DepositDate;
                if (!nullable.HasValue)
                {
                    this.hidpresaleStaut.Value = "1";
                    if (this.order.OrderStatus == OrderStatus.Closed)
                    {
                        this.hidpresaleStaut.Value = "6";
                    }
                }
                else if (productPreSaleInfo.PaymentStartDate > DateTime.Now)
                {
                    this.hidpresaleStaut.Value = "2";
                }
                else if (productPreSaleInfo.PaymentEndDate < DateTime.Now)
                {
                    if (this.order.PayDate == DateTime.MinValue)
                    {
                        this.hidpresaleStaut.Value = "5";
                    }
                    else
                    {
                        this.hidpresaleStaut.Value = "4";
                    }
                }
                else if (this.order.PayDate == DateTime.MinValue)
                {
                    this.hidpresaleStaut.Value = "3";
                }
                else
                {
                    this.hidpresaleStaut.Value = "4";
                }
            }
        }
コード例 #5
0
 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);
                 }
             }
         }
     }
 }