private void btnGetGoods_Click(object sender, EventArgs e)
        {
            int        returnId   = this.Page.Request["ReturnId"].ToInt(0);
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId);
            OrderInfo  orderInfo  = TradeHelper.GetOrderInfo(returnInfo.OrderId);

            if (orderInfo == null)
            {
                this.ShowMsg("订单不存在!", false);
            }
            else if (orderInfo.SupplierId != HiContext.Current.Manager.StoreId)
            {
                this.ShowMsg("订单不是当前供应商订单,请勿非法操作。", false);
            }
            else if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else if (returnInfo.HandleStatus != ReturnStatus.Deliverying)
            {
                this.ShowMsg("当前状态不允许进行收货!", false);
            }
            else if (TradeHelper.FinishGetGoodsForReturn_Supplier(returnInfo.ReturnId, returnInfo.OrderId, returnInfo.SkuId))
            {
                this.ShowMsg("收货成功,由平台进行退款处理!", true, HttpContext.Current.Request.Url.ToString());
            }
            else
            {
                this.ShowMsg("收货失败!", false);
            }
        }
Example #2
0
 public void GetReturnInfo(HttpContext context)
 {
     if (!this.CheckUserRole())
     {
         this.ShowMessage_New(context, "请先登录会员!", true);
     }
     else
     {
         int num = 0;
         if (context.Request["ReturnsId"] != null)
         {
             int.TryParse(context.Request["ReturnsId"], out num);
         }
         string text = "";
         text = context.Request["orderId"];
         string     text2      = context.Request["skuId"];
         ReturnInfo returnInfo = null;
         if (num > 0)
         {
             returnInfo = TradeHelper.GetReturnInfo(num);
         }
         if (returnInfo == null && !string.IsNullOrEmpty(text))
         {
             returnInfo = TradeHelper.GetReturnInfo(text, text2);
         }
         if (returnInfo == null)
         {
             this.ShowMessage_New(context, "参数不正确" + text + "-" + text2, true);
         }
         else
         {
             string s = JsonConvert.SerializeObject(new
             {
                 Result = new
                 {
                     success = "true",
                     Returns = new
                     {
                         ReturnId           = returnInfo.ReturnId,
                         OrderId            = returnInfo.OrderId,
                         SkuId              = returnInfo.SkuId,
                         ExpressCompanyAbb  = returnInfo.ExpressCompanyAbb,
                         ExpressCompanyName = returnInfo.ExpressCompanyName,
                         AdminCellPhone     = returnInfo.AdminCellPhone,
                         AdminShipTo        = returnInfo.AdminShipTo,
                         AdminRemark        = returnInfo.AdminRemark,
                         AdminShipAddress   = returnInfo.AdminShipAddress,
                         ShipOrderNumber    = returnInfo.ShipOrderNumber,
                         UserRemark         = returnInfo.UserRemark,
                         RefundType         = (int)returnInfo.RefundType,
                         RefundAmount       = returnInfo.RefundAmount.F2ToString("f2")
                     }
                 }
             });
             context.Response.Write(s);
             context.Response.End();
         }
     }
 }
        protected override void AttachChildControls()
        {
            this.btnSendGoods       = (HtmlInputButton)this.FindControl("btnSendGoods");
            this.txtOrderId         = (HtmlInputHidden)this.FindControl("txtOrderId");
            this.txtSkuId           = (HtmlInputHidden)this.FindControl("txtSkuId");
            this.txtReturnsId       = (HtmlInputHidden)this.FindControl("txtReturnsId");
            this.txtShowOrderId     = (Literal)this.FindControl("txtShowOrderId");
            this.txtProductName     = (Literal)this.FindControl("txtProductName");
            this.txtReturnAddress   = (Literal)this.FindControl("txtReturnAddress");
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.txtExpress         = (HtmlInputHidden)this.FindControl("txtExpress");
            this.txtShipOrderNumber = (TextBox)this.FindControl("txtShipOrderNumber");
            this.litExpressName     = (Literal)this.FindControl("litExpressName");
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(this.ReturnsId);

            if (returnInfo == null)
            {
                this.ShowError("错误的退货信息");
            }
            else
            {
                this.SkuId                   = returnInfo.SkuId;
                this.txtOrderId.Value        = returnInfo.OrderId;
                this.txtSkuId.Value          = returnInfo.SkuId;
                this.txtReturnsId.Value      = returnInfo.ReturnId.ToString();
                this.txtShowOrderId.Text     = returnInfo.OrderId;
                this.txtReturnAddress.Text   = returnInfo.AdminShipAddress + " " + returnInfo.AdminShipTo + "(" + returnInfo.AdminCellPhone + ")";
                this.litExpressName.Text     = returnInfo.ExpressCompanyName;
                this.txtExpress.Value        = returnInfo.ExpressCompanyName;
                this.txtShipOrderNumber.Text = returnInfo.ShipOrderNumber;
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowError("错误的订单信息");
                }
                else if (orderInfo.LineItems.ContainsKey(this.SkuId))
                {
                    if (orderInfo.LineItems[this.SkuId].Status != LineItemStatus.MerchantsAgreedForReturn && orderInfo.LineItems[this.SkuId].Status != LineItemStatus.DeliveryForReturn)
                    {
                        this.ShowError("商品退货状态不正确");
                    }
                    else
                    {
                        if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                        {
                            this.btnSendGoods.Value = "修改发货信息";
                        }
                        this.txtProductName.Text = orderInfo.LineItems[this.SkuId].ItemDescription;
                    }
                }
                else
                {
                    this.ShowError("订单中不包含商品信息");
                }
            }
        }
        private void JudgeOrderStatus(OrderInfo order)
        {
            this.lkbtnConfirmOrder.Visible = (order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl);
            if (order.PreSaleId > 0)
            {
                if (order.OrderStatus == OrderStatus.WaitBuyerPay && order.ItemStatus == OrderItemStatus.Nomarl && !order.DepositDate.HasValue)
                {
                    this.lkbtnCloseOrder.Visible = true;
                }
                else
                {
                    this.lkbtnCloseOrder.Visible = false;
                }
            }
            else
            {
                this.lkbtnCloseOrder.Visible = (order.OrderStatus == OrderStatus.WaitBuyerPay && order.ItemStatus == OrderItemStatus.Nomarl);
            }
            RefundInfo   refundInfo     = TradeHelper.GetRefundInfo(order.OrderId);
            ReturnInfo   returnInfo     = TradeHelper.GetReturnInfo(order.OrderId, "");
            ReplaceInfo  replaceInfo    = TradeHelper.GetReplaceInfo(order.OrderId, "");
            DateTime     finishDate     = order.FinishDate;
            OrderStatus  orderStatus    = order.OrderStatus;
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            HtmlAnchor   htmlAnchor     = this.lkbtnApplyForRefund;
            int          visible;

            if (order.GetTotal(false) > decimal.Zero && !TradeHelper.OrderHasRefundOrReturning(order))
            {
                if ((refundInfo == null || refundInfo.HandleStatus == RefundStatus.Refused) && returnInfo == null && replaceInfo == null)
                {
                    visible = ((order.OrderStatus == OrderStatus.BuyerAlreadyPaid && order.ItemStatus == OrderItemStatus.Nomarl) ? 1 : 0);
                    goto IL_0136;
                }
                visible = 0;
            }
            else
            {
                visible = 0;
            }
            goto IL_0136;
IL_0136:
            htmlAnchor.Visible = ((byte)visible != 0);
            this.lkbtnApplyForRefund.Attributes.Add("orderId", this.orderId);
            if (!masterSettings.OpenMultStore && masterSettings.IsOpenPickeupInStore && order.SupplierId == 0 && order.ShippingModeId == -2)
            {
                this.litGetGoodsRemark.Text = masterSettings.PickeupInStoreRemark;
            }
            else
            {
                this.divPickUpRemark.Visible = false;
            }
        }
 private void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         LineItemInfo lineItemInfo = e.Item.DataItem as LineItemInfo;
         HtmlAnchor   htmlAnchor   = e.Item.FindControl("hylinkProductName") as HtmlAnchor;
         Literal      literal      = e.Item.FindControl("ltlSKUContent") as Literal;
         Literal      literal2     = e.Item.FindControl("ltlPrice") as Literal;
         Literal      literal3     = e.Item.FindControl("ltlProductCount") as Literal;
         HtmlAnchor   htmlAnchor2  = e.Item.FindControl("hyDetailLink") as HtmlAnchor;
         Label        label        = e.Item.FindControl("litSendCount") as Label;
         string       hRef         = lineItemInfo.IsValid ? ("ServiceMemberOrderDetails.aspx?OrderId=" + lineItemInfo.OrderId.ToNullString()) : ("MemberOrderDetails.aspx?OrderId=" + lineItemInfo.OrderId.ToNullString());
         htmlAnchor.InnerText = lineItemInfo.ItemDescription.ToNullString();
         htmlAnchor.HRef      = hRef;
         literal.Text         = lineItemInfo.SKUContent.ToNullString();
         literal2.Text        = lineItemInfo.ItemAdjustedPrice.ToDecimal(0).F2ToString("f2");
         literal3.Text        = lineItemInfo.Quantity.ToNullString();
         if (lineItemInfo.ShipmentQuantity > lineItemInfo.Quantity)
         {
             label.Text = "赠" + (lineItemInfo.ShipmentQuantity - lineItemInfo.Quantity).ToString();
         }
         htmlAnchor2.HRef = hRef;
         Literal literal4 = (Literal)e.Item.FindControl("litStatus");
         if (literal4 != null)
         {
             LineItemStatus status      = lineItemInfo.Status;
             string         text        = "";
             ReturnInfo     returnInfo  = TradeHelper.GetReturnInfo(lineItemInfo.OrderId, lineItemInfo.SkuId);
             ReplaceInfo    replaceInfo = TradeHelper.GetReplaceInfo(lineItemInfo.OrderId, lineItemInfo.SkuId);
             if (status == LineItemStatus.Normal)
             {
                 text = "";
             }
             else if (returnInfo != null)
             {
                 if (returnInfo.HandleStatus != ReturnStatus.Refused)
                 {
                     text = ((returnInfo.AfterSaleType != AfterSaleTypes.OnlyRefund) ? EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 1) : EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3));
                 }
             }
             else if (replaceInfo != null && replaceInfo.HandleStatus != ReplaceStatus.Refused)
             {
                 text = EnumDescription.GetEnumDescription((Enum)(object)replaceInfo.HandleStatus, 1);
             }
             literal4.Text = text;
         }
     }
 }
Example #6
0
        private void btnRefuseReturn_Click(object sender, EventArgs e)
        {
            int    returnId = this.Page.Request["ReturnId"].ToInt(0);
            string text     = Globals.StripAllTags(this.txtAdminRemark.Text);

            if (string.IsNullOrEmpty(text))
            {
                this.ShowMsg("请填写拒绝售后原因!", false);
            }
            else
            {
                ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId);
                if (returnInfo == null)
                {
                    this.ShowMsg("售后信息错误!", false);
                }
                else
                {
                    OrderInfo orderInfo = OrderHelper.GetOrderInfo(returnInfo.OrderId);
                    string    skuId     = returnInfo.SkuId;
                    if (orderInfo?.IsStoreCollect ?? true)
                    {
                        this.ShowMsg("订单不存在,或者订单不属于该门店!", false);
                    }
                    else if (!orderInfo.LineItems.ContainsKey(skuId))
                    {
                        this.ShowMsg("订单中不存在要售后的商品!", false);
                    }
                    else
                    {
                        LineItemInfo lineItemInfo = orderInfo.LineItems[skuId];
                        if (lineItemInfo.Status != LineItemStatus.ReturnApplied)
                        {
                            this.ShowMsg("售后状态不正确.", false);
                        }
                        else
                        {
                            OrderHelper.CheckReturn(returnInfo, orderInfo, HiContext.Current.Manager.UserName, returnInfo.RefundAmount, text, false, false);
                            this.ShowMsg("成功的拒绝了订单售后", true, HttpContext.Current.Request.Url.ToString());
                        }
                    }
                }
            }
        }
        private void btnSendGoodsReturns_Click(object sender, EventArgs e)
        {
            string text = base.GetParameter("ReturnUrl", false).ToNullString();

            if (string.IsNullOrEmpty(text))
            {
                text = this.Page.Request.UrlReferrer.ToNullString();
                if (text == this.Page.Request.Url.ToString())
                {
                    text = "/User/UserOrders";
                }
            }
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(this.returnsId);

            if (returnInfo == null)
            {
                this.ShowMessage("错误的退货信息", false, "", 1);
            }
            else
            {
                string    skuId     = returnInfo.SkuId;
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMessage("错误的订单信息", false, "", 1);
                }
                else if (orderInfo.LineItems.ContainsKey(skuId))
                {
                    if (orderInfo.LineItems[skuId].Status != LineItemStatus.MerchantsAgreedForReturn && orderInfo.LineItems[skuId].Status != LineItemStatus.DeliveryForReturn)
                    {
                        this.ShowMessage("商品退货状态不正确", false, "", 1);
                    }
                    else
                    {
                        string value  = this.hidExpressCompanyName.Value;
                        string value2 = this.hidShipOrderNumber.Value;
                        if (string.IsNullOrEmpty(value))
                        {
                            this.ShowMessage("请选择一个快递公司!", false, "", 1);
                        }
                        else
                        {
                            string             text2 = "";
                            string             text3 = "";
                            ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNode(value);
                            if (value != null)
                            {
                                text2 = expressCompanyInfo.Kuaidi100Code;
                                text3 = expressCompanyInfo.Name;
                                if (value2.Trim() == "" || value2.Length > 20)
                                {
                                    this.ShowMessage("请输入快递编号,长度为1-20位!", false, "", 1);
                                }
                                else if (TradeHelper.UserSendGoodsForReturn(returnInfo.ReturnId, text2, text3, value2, orderInfo.OrderId, skuId))
                                {
                                    if (text2.ToUpper() == "HTKY")
                                    {
                                        ExpressHelper.GetDataByKuaidi100(text2, value2);
                                    }
                                    this.ShowMessage("发货成功", true, text, 2);
                                    this.BindOrderItems(orderInfo);
                                }
                                else
                                {
                                    this.ShowMessage("发货失败!", false, "", 1);
                                }
                            }
                            else
                            {
                                this.ShowMessage("请选择快递公司", false, "", 1);
                            }
                        }
                    }
                }
                else
                {
                    this.ShowMessage("订单中不包含商品信息", false, "", 1);
                }
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.hidBaseURL.Value = Globals.HostPath(base.Request.Url);
            string  text    = this.Page.Request.QueryString["orderId"];
            Literal literal = this.FindControl("litLogisiticType") as Literal;
            int     num     = 0;

            int.TryParse(this.Page.Request.QueryString["returnsId"], out num);
            int num2 = 0;

            int.TryParse(this.Page.Request.QueryString["replaceId"], out num2);
            string      text2       = "";
            string      text3       = "";
            string      text4       = "";
            string      text5       = "";
            string      text6       = "";
            string      text7       = "";
            bool        flag        = false;
            ReturnInfo  returnInfo  = null;
            ReplaceInfo replaceInfo = null;

            if (num > 0)
            {
                returnInfo = TradeHelper.GetReturnInfo(num);
            }
            if (num2 > 0)
            {
                replaceInfo = TradeHelper.GetReplaceInfo(num2);
            }
            OrderInfo orderInfo = null;

            if (!string.IsNullOrEmpty(text))
            {
                orderInfo = ShoppingProcessor.GetOrderInfo(text);
                if (orderInfo != null && orderInfo.ExpressCompanyName == "同城物流配送")
                {
                    this.hidIsShowDadaGIS.Value = "1";
                }
                if (orderInfo != null && !string.IsNullOrWhiteSpace(orderInfo.LatLng))
                {
                    this.hidUserLatlng.Value = orderInfo.LatLng;
                }
                else if (orderInfo != null && orderInfo.ShippingId > 0)
                {
                    ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(orderInfo.ShippingId);
                    if (shippingAddress != null && !string.IsNullOrWhiteSpace(shippingAddress.LatLng))
                    {
                        this.hidUserLatlng.Value = shippingAddress.LatLng;
                    }
                }
                if (orderInfo != null)
                {
                    if (orderInfo.StoreId > 0)
                    {
                        StoresInfo storeById = StoresHelper.GetStoreById(orderInfo.StoreId);
                        if (storeById != null && !string.IsNullOrWhiteSpace(storeById.LatLng))
                        {
                            this.hidStoreLatlng.Value = storeById.LatLng;
                        }
                    }
                    else
                    {
                        ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(0);
                        if (defaultOrFirstShipper != null)
                        {
                            this.hidStoreLatlng.Value = defaultOrFirstShipper.Latitude + "," + defaultOrFirstShipper.Longitude;
                        }
                    }
                }
            }
            int num3;

            if (returnInfo != null)
            {
                if (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned)
                {
                    text2 = returnInfo.ExpressCompanyName;
                    text3 = returnInfo.ShipOrderNumber;
                    text4 = returnInfo.AdminShipTo;
                    text5 = returnInfo.AdminCellPhone;
                    text6 = returnInfo.AdminShipAddress;
                    text7 = returnInfo.ExpressCompanyAbb;
                    flag  = true;
                }
            }
            else if (replaceInfo != null)
            {
                if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery)
                {
                    this.hidReplaceType.Value = "User";
                    text2 = replaceInfo.UserExpressCompanyName;
                    text3 = replaceInfo.UserShipOrderNumber;
                    text4 = replaceInfo.AdminShipTo;
                    text5 = replaceInfo.AdminCellPhone;
                    text6 = replaceInfo.AdminShipAddress;
                    text7 = replaceInfo.ExpressCompanyAbb;
                    flag  = true;
                }
                else if (replaceInfo.HandleStatus == ReplaceStatus.MerchantsDelivery || replaceInfo.HandleStatus == ReplaceStatus.Replaced)
                {
                    this.hidReplaceType.Value = "Mall";
                    text2 = replaceInfo.ExpressCompanyName;
                    text3 = replaceInfo.ShipOrderNumber;
                    text4 = orderInfo.ShipTo;
                    text5 = (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone);
                    text6 = orderInfo.ShippingRegion + "   " + orderInfo.Address;
                    text7 = orderInfo.ExpressCompanyAbb;
                }
                else
                {
                    this.LogisticsInfoPanel.InnerHtml = "商家还未发货";
                }
            }
            else if (orderInfo != null)
            {
                if ((orderInfo.OrderStatus == OrderStatus.SellerAlreadySent || orderInfo.OrderStatus == OrderStatus.Finished || (!string.IsNullOrEmpty(orderInfo.ExpressCompanyName) && !string.IsNullOrEmpty(orderInfo.ShipOrderNumber))) && orderInfo.ItemStatus != OrderItemStatus.HasReturnOrReplace)
                {
                    num3 = ((orderInfo.ShippingModeId != -2) ? 1 : 0);
                    goto IL_0456;
                }
                num3 = 0;
                goto IL_0456;
            }
            goto IL_0778;
IL_0778:
            if (flag)
            {
                this.hidOrderId.Value           = ((orderInfo != null) ? orderInfo.OrderId : string.Empty);
                this.ltlExpressCompanyName.Text = (text2.Equals("店员配送") ? "店员配送" : (text2 + ":"));
                this.ltlShipOrderNumber.Text    = text3;
                this.divlogisticsInfo.Visible   = !text2.Equals("店员配送");
                this.ltlReceiveName.Text        = text4;
                this.ltlTel.Text         = text5;
                this.ltlShipAddress.Text = text6;
                if (!string.IsNullOrEmpty(text3))
                {
                    string text8 = HttpContext.Current.Request.Url.ToString().ToLower();
                    if (text8.IndexOf("/wapshop/") != -1)
                    {
                        if (text7.ToLower() == "sf")
                        {
                            this.hylExpress100Search.NavigateUrl = $"http://www.sf-express.com/mobile/cn/sc/dynamic_function/waybill/waybill_query_info.html?billno={text3}";
                            this.hylExpress100Search.Text        = "顺丰官网查询>";
                        }
                        else
                        {
                            this.hylExpress100Search.NavigateUrl = $"https://m.kuaidi100.com/result.jsp?nu={text3}";
                        }
                    }
                    else if (text7.ToLower() == "sf")
                    {
                        this.hylExpress100Search.NavigateUrl = $"http://www.sf-express.com/mobile/cn/sc/dynamic_function/waybill/waybill_query_info.html?billno={text3}";
                        this.hylExpress100Search.Text        = "顺丰官网查询>";
                    }
                    else
                    {
                        this.hylExpress100Search.NavigateUrl = $"https://www.kuaidi100.com/chaxun?nu={text3}";
                    }
                }
                else
                {
                    this.ulExpress.Visible = false;
                }
            }
            return;

IL_0456:
            if (num3 != 0)
            {
                flag  = true;
                text2 = ((orderInfo.ExpressCompanyName != null) ? orderInfo.ExpressCompanyName : "");
                text3 = orderInfo.ShipOrderNumber;
                text4 = orderInfo.ShipTo;
                text5 = (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone);
                text6 = orderInfo.ShippingRegion + "   " + orderInfo.Address;
                text7 = orderInfo.ExpressCompanyAbb;
            }
            else if (orderInfo.ItemStatus == OrderItemStatus.HasReturn)
            {
                returnInfo = TradeHelper.GetReturnInfo(orderInfo.OrderId, "");
                if (returnInfo == null)
                {
                    foreach (LineItemInfo value in orderInfo.LineItems.Values)
                    {
                        if (value.ReturnInfo != null)
                        {
                            returnInfo = value.ReturnInfo;
                            break;
                        }
                    }
                }
                if (returnInfo != null && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
                {
                    text2 = returnInfo.ExpressCompanyName;
                    text3 = returnInfo.ShipOrderNumber;
                    text4 = returnInfo.AdminShipTo;
                    text5 = returnInfo.AdminCellPhone;
                    text6 = returnInfo.AdminShipAddress;
                    text7 = returnInfo.ExpressCompanyAbb;
                    flag  = true;
                }
            }
            else if (orderInfo.ItemStatus == OrderItemStatus.HasReplace)
            {
                replaceInfo = TradeHelper.GetReplaceInfo(orderInfo.OrderId, "");
                orderInfo   = ShoppingProcessor.GetOrderInfo(replaceInfo.OrderId);
                if (orderInfo == null)
                {
                    foreach (LineItemInfo value2 in orderInfo.LineItems.Values)
                    {
                        if (value2.ReplaceInfo != null)
                        {
                            replaceInfo = value2.ReplaceInfo;
                            break;
                        }
                    }
                }
                if (replaceInfo != null)
                {
                    if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery)
                    {
                        this.hidReplaceType.Value = "User";
                        text2 = replaceInfo.UserExpressCompanyName;
                        text3 = replaceInfo.UserShipOrderNumber;
                        text4 = replaceInfo.AdminShipTo;
                        text5 = replaceInfo.AdminCellPhone;
                        text6 = replaceInfo.AdminShipAddress;
                        text7 = replaceInfo.ExpressCompanyAbb;
                        flag  = true;
                    }
                    if (replaceInfo.HandleStatus == ReplaceStatus.MerchantsDelivery || replaceInfo.HandleStatus == ReplaceStatus.Replaced)
                    {
                        this.hidReplaceType.Value = "Mall";
                        text2 = replaceInfo.ExpressCompanyName;
                        text3 = replaceInfo.ShipOrderNumber;
                        text4 = orderInfo.ShipTo;
                        text5 = (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone);
                        text6 = orderInfo.ShippingRegion + "   " + orderInfo.Address;
                        text7 = orderInfo.ExpressCompanyAbb;
                    }
                    else
                    {
                        this.LogisticsInfoPanel.InnerHtml = "商家还未发货";
                    }
                }
            }
            goto IL_0778;
        }
 protected override void AttachChildControls()
 {
     this.btnSendGoodsReturns        = ButtonManager.Create(this.FindControl("btnSendGoodsReturns"));
     this.divCredentials             = (HtmlGenericControl)this.FindControl("divCredentials");
     this.returnsId                  = base.GetParameter("ReturnsId", false).ToInt(0);
     this.products                   = (Common_OrderItems_AfterSales)this.FindControl("Common_OrderItems_AfterSales");
     this.txtOrderId                 = (Literal)this.FindControl("txtOrderId");
     this.litRemark                  = (Literal)this.FindControl("litRemark");
     this.litAdminRemark             = (Literal)this.FindControl("litAdminRemark");
     this.litType                    = (Literal)this.FindControl("litType");
     this.litTotalPrice              = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     this.litRefundTotal             = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
     this.litOrderTotal              = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
     this.expresslist1               = (ExpressDropDownList)this.FindControl("expressDropDownList");
     this.hidExpressCompanyName      = (HiddenField)this.FindControl("hidExpressCompanyName");
     this.hidShipOrderNumber         = (HiddenField)this.FindControl("hidShipOrderNumber");
     this.txtAfterSaleType           = (HtmlInputHidden)this.FindControl("txtAfterSaleType");
     this.litStep                    = (Literal)this.FindControl("litStep");
     this.litTime                    = (Literal)this.FindControl("litTime");
     this.litProcess                 = (Literal)this.FindControl("litProcess");
     this.litUserRemark              = (Literal)this.FindControl("litUserRemark");
     this.litCredentialsImg          = (Literal)this.FindControl("litCredentialsImg");
     this.txtAfterSaleId             = (Literal)this.FindControl("txtAfterSaleId");
     this.txtIsRefused               = (HtmlInputHidden)this.FindControl("txtIsRefused");
     this.lnkToSendGoods             = (HtmlAnchor)this.FindControl("lnkToSendGoods");
     this.lnkReApply                 = (HtmlAnchor)this.FindControl("lnkReApply");
     this.litReturnAmount            = (Literal)this.FindControl("litReturnAmount");
     this.litBankName                = (Literal)this.FindControl("litBankName");
     this.litBankAccountName         = (Literal)this.FindControl("litBankAccountName");
     this.litBankAccountNo           = (Literal)this.FindControl("litBankAccountNo");
     this.bankRow1                   = (HtmlGenericControl)this.FindControl("bankRow1");
     this.bankRow2                   = (HtmlGenericControl)this.FindControl("bankRow2");
     this.bankRow3                   = (HtmlGenericControl)this.FindControl("bankRow3");
     this.AdminRemarkRow             = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
     this.btnViewLogistic            = (HtmlAnchor)this.FindControl("btnViewLogistic");
     this.btnSendGoodsReturns.Click += this.btnSendGoodsReturns_Click;
     this.returns                    = TradeHelper.GetReturnInfo(this.returnsId);
     this.txtAfterSaleId.Text        = this.returnsId.ToString();
     if (this.returns == null)
     {
         this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("退货信息不存在或者不属于当前用户"));
     }
     else
     {
         this.order = TradeHelper.GetOrderInfo(this.returns.OrderId);
         if (this.order == null || this.order.UserId != HiContext.Current.UserId)
         {
             this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
         }
         else if (!this.Page.IsPostBack)
         {
             if (this.expresslist1 != null)
             {
                 this.expresslist1.ShowAllExpress = true;
                 this.expresslist1.DataBind();
             }
             this.BindReturnsTable(this.returnsId);
             this.BindOrderItems(this.order);
             this.BindProducts(this.order, this.returns.SkuId);
         }
     }
 }
        private void BindReturnsTable(int returnsId)
        {
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnsId);
            int        num;
            DateTime   dateTime;
            DateTime   value;
            DateTime   dateTime2;
            string     text;

            if (returnInfo != null)
            {
                if (returnInfo.HandleStatus == ReturnStatus.Refused && (this.order.OrderStatus == OrderStatus.SellerAlreadySent || (this.order.OrderStatus == OrderStatus.Finished && !this.order.IsServiceOver)))
                {
                    this.lnkReApply.Visible = true;
                    this.lnkReApply.HRef    = "AfterSalesApply?OrderId=" + returnInfo.OrderId + "&SkuId=" + returnInfo.SkuId;
                }
                if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed || returnInfo.HandleStatus == ReturnStatus.Deliverying)
                {
                    this.lnkToSendGoods.Visible = true;
                    AttributeCollection attributes = this.lnkToSendGoods.Attributes;
                    num = returnInfo.ReturnId;
                    attributes.Add("ReturnId", num.ToString());
                    if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                    {
                        this.lnkToSendGoods.InnerText = "修改发货信息";
                    }
                    else
                    {
                        this.lnkToSendGoods.InnerText = "发货";
                    }
                }
                HtmlInputHidden htmlInputHidden = this.txtAfterSaleType;
                num = (int)returnInfo.AfterSaleType;
                htmlInputHidden.Value = num.ToString();
                text     = "";
                dateTime = (returnInfo.AgreedOrRefusedTime.HasValue ? returnInfo.AgreedOrRefusedTime.Value : this.returns.ApplyForTime);
                if (returnInfo.FinishTime.HasValue)
                {
                    DateTime?finishTime = returnInfo.FinishTime;
                    value = DateTime.MinValue;
                    if (!(finishTime == (DateTime?)value))
                    {
                        dateTime2 = returnInfo.FinishTime.Value;
                        goto IL_01c9;
                    }
                }
                dateTime2 = this.returns.ApplyForTime;
                goto IL_01c9;
            }
            return;

IL_01c9:
            DateTime dateTime3 = dateTime2;
            DateTime dateTime4 = returnInfo.UserSendGoodsTime.HasValue ? returnInfo.UserSendGoodsTime.Value : dateTime;
            DateTime dateTime5 = returnInfo.ConfirmGoodsTime.HasValue ? returnInfo.ConfirmGoodsTime.Value : dateTime4;
            Literal  literal   = this.litReturnAmount;

            num                      = returnInfo.Quantity;
            literal.Text             = num.ToString();
            this.litRefundTotal.Text = this.returns.RefundAmount.F2ToString("f2");
            if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                this.stepTemplate = "<span>买家申请退款</span><span>商家同意申请</span><span>退款完成</span>";
                if (returnInfo.HandleStatus == ReturnStatus.Applied)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                    string format = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format, arg, value.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                    string format2 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg2 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format2, arg2, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Returned)
                {
                    this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                    string format3 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg3 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format3, arg3, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Refused)
                {
                    this.txtIsRefused.Value = "1";
                    this.stepTemplate       = "<span>买家申请退款</span><span>商家拒绝申请</span><span>退款失败</span>";
                    this.processTemplate    = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                    string format4 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    string arg4 = value.ToString("yyyy-MM-dd");
                    value = returnInfo.ApplyForTime;
                    text  = string.Format(format4, arg4, value.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                    text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
                }
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Applied)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format5 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg5 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format5, arg5, value.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format6 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg6 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format6, arg6, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string format7 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg7 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = string.Format(format7, arg7, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.GetGoods)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div><div class=\"proce\"></div><div class=\"node\"></div>";
                string str     = text;
                string format8 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg8 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = str + string.Format(format8, arg8, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd"), dateTime5.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Returned)
            {
                this.processTemplate = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
                string str2    = text;
                string format9 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                string arg9 = value.ToString("yyyy-MM-dd");
                value = returnInfo.ApplyForTime;
                text  = str2 + string.Format(format9, arg9, value.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd"), dateTime.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd"), dateTime4.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd"), dateTime5.ToString("HH:mm:ss"));
                text += string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd"), dateTime3.ToString("HH:mm:ss"));
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Refused)
            {
                this.txtIsRefused.Value = "1";
                this.stepTemplate       = "<span>买家申请退货</span><span>商家拒绝申请</span><span>退货失败</span>";
                this.processTemplate    = "<div class=\"node ready\"></div><div class=\"proce done\"></div><div class=\"node done\"></div><div class=\"proce done\"></div><div class=\"node now\"></div>";
            }
            this.litStep.Text       = this.stepTemplate;
            this.litTime.Text       = text;
            this.litProcess.Text    = this.processTemplate;
            this.litUserRemark.Text = returnInfo.UserRemark;
            string userCredentials = returnInfo.UserCredentials;

            if (string.IsNullOrEmpty(userCredentials))
            {
                this.divCredentials.Visible = false;
            }
            else
            {
                string[] array = userCredentials.Split('|');
                userCredentials = "";
                string[] array2 = array;
                foreach (string str3 in array2)
                {
                    userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str3);
                }
                this.litCredentialsImg.Text = userCredentials;
            }
            if (!string.IsNullOrEmpty(returnInfo.AdminRemark))
            {
                this.litAdminRemark.Text = returnInfo.AdminRemark;
                if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = true;
                }
            }
            else if (this.AdminRemarkRow != null)
            {
                this.AdminRemarkRow.Visible = false;
            }
            this.litAdminRemark.Text = returnInfo.AdminRemark;
            this.litRemark.Text      = returnInfo.ReturnReason;
            this.litType.Text        = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
            this.orderId             = returnInfo.OrderId;
            if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed || returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.btnSendGoodsReturns.Visible = true;
            }
            if (returnInfo.RefundType == RefundTypes.InBankCard)
            {
                this.bankRow1.Visible        = true;
                this.bankRow2.Visible        = true;
                this.bankRow3.Visible        = true;
                this.litBankName.Text        = returnInfo.BankName;
                this.litBankAccountName.Text = returnInfo.BankAccountName;
                this.litBankAccountNo.Text   = returnInfo.BankAccountNo;
            }
            if (this.returns.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (this.returns.HandleStatus == ReturnStatus.Deliverying || this.returns.HandleStatus == ReturnStatus.GetGoods || this.returns.HandleStatus == ReturnStatus.Returned))
            {
                this.btnViewLogistic.Visible = true;
                AttributeCollection attributes2 = this.btnViewLogistic.Attributes;
                num = this.returns.ReturnId;
                attributes2.Add("returnsid", num.ToString());
            }
        }
Example #11
0
        private void btnFinishReturn_Click(object sender, EventArgs e)
        {
            int    num  = this.Page.Request["ReturnId"].ToInt(0);
            string text = "";

            text = this.txtAdminRemark.Text;
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(num);
            OrderInfo  orderInfo  = TradeHelper.GetOrderInfo(returnInfo.OrderId);
            decimal    num2       = this.txtRefundMoney.Text.ToDecimal(0);

            if (orderInfo == null)
            {
                this.ShowMsg("订单不存在!", false);
            }
            else if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else if (orderInfo.IsStoreCollect && this.UserStoreId == 0)
            {
                this.ShowMsg("该订单为门店收款,完成退货(退款)操作操作只能由门店进行操作", false);
            }
            else
            {
                if (!orderInfo.IsStoreCollect && this.UserStoreId != 0)
                {
                    this.ShowMsg("非门店收款订单,只能由平台进行完成退货(退款)操作!", false);
                }
                if (returnInfo.HandleStatus != ReturnStatus.GetGoods && returnInfo.HandleStatus != ReturnStatus.Deliverying)
                {
                    this.ShowMsg("当前状态不允许完成退货!", false);
                }
                else
                {
                    GroupBuyInfo groupbuy = null;
                    if (orderInfo.GroupBuyId > 0)
                    {
                        groupbuy = ProductBrowser.GetGroupBuy(orderInfo.GroupBuyId);
                    }
                    decimal canRefundAmount = orderInfo.GetCanRefundAmount(returnInfo.SkuId, groupbuy, 0);
                    if (num2 < decimal.Zero)
                    {
                        this.ShowMsg("退款金额必须大于等于0", false);
                    }
                    else if (num2 > canRefundAmount)
                    {
                        this.ShowMsg("退款金额不能大于退货订单或者商品的金额!", false);
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(text))
                        {
                            text = returnInfo.AdminRemark;
                        }
                        string skuId = returnInfo.SkuId;
                        if (!orderInfo.LineItems.ContainsKey(skuId))
                        {
                            this.ShowMsg("订单中不存在要退货的商品!", false);
                        }
                        else
                        {
                            LineItemInfo lineItemInfo = orderInfo.LineItems[skuId];
                            if (this.UserStoreId != 0 && lineItemInfo.Status != LineItemStatus.DeliveryForReturn && lineItemInfo.Status != LineItemStatus.GetGoodsForReturn)
                            {
                                this.ShowMsg("当前状态不允许完成退货.", false);
                            }
                            else
                            {
                                MemberInfo user  = Users.GetUser(orderInfo.UserId);
                                string     text2 = "";
                                if (RefundHelper.IsBackReturn(orderInfo.Gateway) && returnInfo.RefundType == RefundTypes.BackReturn)
                                {
                                    text2 = RefundHelper.SendRefundRequest(orderInfo, num2, returnInfo.RefundOrderId, false);
                                    if (text2 == "")
                                    {
                                        if (OrderHelper.CheckReturn(returnInfo, orderInfo, HiContext.Current.Manager.UserName, num2, text, true, false))
                                        {
                                            Messenger.OrderRefund(user, orderInfo, returnInfo.SkuId);
                                            this.ShowMsg("成功的完成退货并且已成功原路退回退款金额", true, HttpContext.Current.Request.Url.ToString());
                                        }
                                    }
                                    else
                                    {
                                        TradeHelper.SaveRefundErr(num, text2, false);
                                        this.ShowMsg("退货退款原路返回请求失败,错误信息:" + text2 + ",请重试!", false);
                                    }
                                }
                                else if (OrderHelper.CheckReturn(returnInfo, orderInfo, HiContext.Current.Manager.UserName, num2, text, true, false))
                                {
                                    Messenger.OrderRefund(user, orderInfo, returnInfo.SkuId);
                                    if (returnInfo.RefundType == RefundTypes.InBalance)
                                    {
                                        this.ShowMsg("成功确定了退款,退款金额已退回用户预付款帐号!", true, HttpContext.Current.Request.Url.ToString());
                                    }
                                    else
                                    {
                                        this.ShowMsg("成功的完成了退款,请即时给用户退款", true, HttpContext.Current.Request.Url.ToString());
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        public void bindReturnInfo()
        {
            int        returnId   = this.Page.Request["ReturnId"].ToInt(0);
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId);

            if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else
            {
                HiddenField hiddenField = this.hidReturnStatus;
                int         num         = (int)returnInfo.HandleStatus;
                hiddenField.Value = num.ToString();
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMsg("错误的订单信息!", false);
                }
                else if (orderInfo.SupplierId != HiContext.Current.Manager.StoreId)
                {
                    this.ShowMsg("订单不是当前供应商订单,请勿非法操作。", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(returnInfo.SkuId))
                    {
                        this.listPrducts.DataSource = orderInfo.LineItems.Values;
                    }
                    else
                    {
                        Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                        foreach (LineItemInfo value in orderInfo.LineItems.Values)
                        {
                            if (value.SkuId == returnInfo.SkuId)
                            {
                                dictionary.Add(value.SkuId, value);
                            }
                        }
                        this.listPrducts.DataSource = dictionary.Values;
                    }
                    this.listPrducts.DataBind();
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.AfterSaleType = "退款";
                    }
                    this.litOrderId.Text      = orderInfo.OrderId;
                    this.litRefundReason.Text = returnInfo.ReturnReason;
                    this.litRemark.Text       = returnInfo.UserRemark;
                    Literal literal = this.litReturnQuantity;
                    num          = returnInfo.Quantity;
                    literal.Text = num.ToString();
                    string userCredentials = returnInfo.UserCredentials;
                    if (!string.IsNullOrEmpty(userCredentials))
                    {
                        string[] array = userCredentials.Split('|');
                        userCredentials = "";
                        string[] array2 = array;
                        foreach (string str in array2)
                        {
                            userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                        }
                        this.litImageList.Text = userCredentials;
                    }
                    else
                    {
                        this.divCredentials.Visible = false;
                    }
                    if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                    {
                        Button button  = this.btnGetGoods;
                        Button button2 = this.btnGetGood2;
                        bool   visible = button2.Visible = true;
                        button.Visible = visible;
                    }
                    if (returnInfo.HandleStatus != 0)
                    {
                        this.litAdminCellPhone.Text  = returnInfo.AdminCellPhone;
                        this.litAdminShipTo.Text     = returnInfo.AdminShipTo;
                        this.litAdminShipAddrss.Text = returnInfo.AdminShipAddress;
                    }
                    else
                    {
                        ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(HiContext.Current.Manager.StoreId);
                        if (defaultGetGoodsShipperBysupplierId != null)
                        {
                            this.litAdminShipAddrss.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address;
                            this.litAdminShipTo.Text     = defaultGetGoodsShipperBysupplierId.ShipperName;
                            this.litAdminCellPhone.Text  = defaultGetGoodsShipperBysupplierId.CellPhone;
                        }
                    }
                    this.liAdminRemark.Text = returnInfo.AdminRemark;
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3);
                    }
                    else
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0);
                    }
                    Literal literal2 = this.txtAfterSaleId;
                    num           = returnInfo.ReturnId;
                    literal2.Text = num.ToString();
                    HiddenField hiddenField2 = this.hidAfterSaleType;
                    num = (int)returnInfo.AfterSaleType;
                    hiddenField2.Value            = num.ToString();
                    this.hidRefundMaxAmount.Value = orderInfo.GetCanRefundAmount(returnInfo.SkuId, null, 0).F2ToString("f2");
                    if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
                    {
                        this.btnViewLogistic.Visible = true;
                        AttributeCollection attributes = this.btnViewLogistic.Attributes;
                        num = returnInfo.ReturnId;
                        attributes.Add("returnsid", num.ToString());
                        this.btnViewLogistic.Attributes.Add("expresscompanyname", returnInfo.ExpressCompanyName.ToString());
                        this.btnViewLogistic.Attributes.Add("shipordernumber", returnInfo.ShipOrderNumber.ToString());
                    }
                }
            }
        }
Example #13
0
        private void btnGetGoods_Click(object sender, EventArgs e)
        {
            int     num  = this.Page.Request["ReturnId"].ToInt(0);
            string  text = "";
            decimal num2 = this.txtRefundMoney.Text.ToDecimal(0);

            text = Globals.StripAllTags(this.txtAdminRemark.Text);
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(num);
            OrderInfo  orderInfo  = TradeHelper.GetOrderInfo(returnInfo.OrderId);

            if (orderInfo == null)
            {
                this.ShowMsg("订单不存在!", false);
            }
            else if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else if (returnInfo.HandleStatus != ReturnStatus.Deliverying)
            {
                this.ShowMsg("当前状态不允许进行收货!", false);
            }
            else if (this.UserStoreId != returnInfo.StoreId && returnInfo.StoreId >= 0)
            {
                this.ShowMsg("收货处理只能由发货的店铺或者平台进行处理!", false);
            }
            else
            {
                GroupBuyInfo groupbuy = null;
                if (orderInfo.GroupBuyId > 0)
                {
                    groupbuy = ProductBrowser.GetGroupBuy(orderInfo.GroupBuyId);
                }
                decimal canRefundAmount = orderInfo.GetCanRefundAmount(returnInfo.SkuId, groupbuy, 0);
                if (num2 < decimal.Zero)
                {
                    this.ShowMsg("退款金额必须大于等于0", false);
                }
                else if (num2 > canRefundAmount)
                {
                    this.ShowMsg("退款金额不能大于退货订单或者商品的金额!", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(text))
                    {
                        text = returnInfo.AdminRemark;
                    }
                    if (TradeHelper.FinishGetGoodsForReturn(num, text, returnInfo.OrderId, returnInfo.SkuId, num2))
                    {
                        MemberInfo user = Users.GetUser(orderInfo.UserId);
                        returnInfo.HandleStatus = ReturnStatus.GetGoods;
                        Messenger.AfterSaleDeal(user, orderInfo, returnInfo, null);
                        this.ShowMsg("收货成功,由平台进行退款处理!", true, HttpContext.Current.Request.Url.ToString());
                    }
                    else
                    {
                        this.ShowMsg("收货失败!", false);
                    }
                }
            }
        }
Example #14
0
        private void btnAcceptReturn_Click(object sender, EventArgs e)
        {
            int        num            = this.Page.Request["ReturnId"].ToInt(0);
            string     text           = Globals.StripAllTags(this.txtAdminShipAddress.Text);
            string     adminShipTo    = Globals.StripAllTags(this.txtAdminShipTo.Text);
            string     adminCellPhone = Globals.StripAllTags(this.txtAdminCellPhone.Text);
            ReturnInfo returnInfo     = TradeHelper.GetReturnInfo(num);
            string     adminRemark    = Globals.StripAllTags(this.txtAdminRemark.Text);
            string     text2          = "退货";

            if (returnInfo == null)
            {
                this.ShowMsg("售后信息错误!", false);
            }
            else
            {
                bool flag = false;
                if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                {
                    text2 = "退款";
                    flag  = true;
                }
                string    skuId     = returnInfo.SkuId;
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMsg("订单不存在!", false);
                }
                else if (!orderInfo.LineItems.ContainsKey(skuId))
                {
                    this.ShowMsg("订单中不存在要退货的商品!", false);
                }
                else
                {
                    LineItemInfo lineItemInfo = orderInfo.LineItems[skuId];
                    decimal      num2         = default(decimal);
                    if (lineItemInfo.Status != LineItemStatus.ReturnApplied)
                    {
                        this.ShowMsg(text2 + "状态不正确.", false);
                    }
                    else if (!decimal.TryParse(this.txtRefundMoney.Text, out num2))
                    {
                        this.ShowMsg("退款金额需为数字格式!", false);
                    }
                    else if (num2 < decimal.Zero)
                    {
                        this.ShowMsg("退款金额必须大于等于0", false);
                    }
                    else
                    {
                        if (this.UserStoreId != returnInfo.StoreId && returnInfo.StoreId >= 0)
                        {
                            if (flag)
                            {
                                if (orderInfo.IsStoreCollect && this.UserStoreId == 0)
                                {
                                    this.ShowMsg("门店收的款,只能由门店进行退款确认处理!", false);
                                    return;
                                }
                            }
                            else if (this.UserStoreId > 0)
                            {
                                this.ShowMsg("同意" + text2 + "只能由发货的店铺或者平台进行处理!", false);
                                return;
                            }
                        }
                        if (!flag && string.IsNullOrEmpty(text))
                        {
                            this.ShowMsg("请输入平台收货地址,告之用户发货的地址和联系方式", false);
                        }
                        else
                        {
                            GroupBuyInfo groupbuy = null;
                            if (orderInfo.GroupBuyId > 0)
                            {
                                groupbuy = ProductBrowser.GetGroupBuy(orderInfo.GroupBuyId);
                            }
                            decimal canRefundAmount = orderInfo.GetCanRefundAmount(skuId, groupbuy, 0);
                            if (num2 > canRefundAmount)
                            {
                                this.ShowMsg("退款金额不能大于退货订单或者商品的金额!", false);
                            }
                            else if (flag)
                            {
                                RefundTypes refundType = returnInfo.RefundType;
                                string      userRemark = returnInfo.UserRemark;
                                MemberInfo  user       = Users.GetUser(orderInfo.UserId);
                                string      text3      = "";
                                if (RefundHelper.IsBackReturn(orderInfo.Gateway) && returnInfo.RefundType == RefundTypes.BackReturn)
                                {
                                    text3 = RefundHelper.SendRefundRequest(orderInfo, num2, returnInfo.RefundOrderId, false);
                                    if (text3 == "")
                                    {
                                        if (OrderHelper.AgreedReturns(num, num2, adminRemark, orderInfo, returnInfo.SkuId, text, adminShipTo, adminCellPhone, flag, false))
                                        {
                                            if (flag)
                                            {
                                                VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, returnInfo.SkuId, EnumPushOrderAction.OrderReturnConfirm);
                                            }
                                            else
                                            {
                                                VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, returnInfo.SkuId, EnumPushOrderAction.OrderRefund);
                                            }
                                            Messenger.OrderRefund(user, orderInfo, returnInfo.SkuId);
                                            this.ShowMsg("成功的完成退款并且已成功原路退回退款金额!", true, HttpContext.Current.Request.Url.ToString());
                                        }
                                    }
                                    else
                                    {
                                        TradeHelper.SaveRefundErr(num, text3, false);
                                        this.ShowMsg("退款原路返回错误,错误信息" + text3 + ",请重新尝试!", false);
                                    }
                                }
                                else if (OrderHelper.AgreedReturns(num, num2, adminRemark, orderInfo, returnInfo.SkuId, text, adminShipTo, adminCellPhone, flag, returnInfo.RefundType == RefundTypes.InBalance))
                                {
                                    if (flag)
                                    {
                                        VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, returnInfo.SkuId, EnumPushOrderAction.OrderReturnConfirm);
                                    }
                                    else
                                    {
                                        VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, returnInfo.SkuId, EnumPushOrderAction.OrderRefund);
                                    }
                                    Messenger.OrderRefund(user, orderInfo, returnInfo.SkuId);
                                    if (returnInfo.RefundType == RefundTypes.InBalance)
                                    {
                                        this.ShowMsg("成功确定了退款,退款金额已退回用户预付款帐号!", true, HttpContext.Current.Request.Url.ToString());
                                    }
                                    else
                                    {
                                        this.ShowMsg("成功的完成了退款,请即时给用户退款", true, HttpContext.Current.Request.Url.ToString());
                                    }
                                }
                            }
                            else if (OrderHelper.AgreedReturns(num, num2, adminRemark, orderInfo, returnInfo.SkuId, text, adminShipTo, adminCellPhone, flag, false))
                            {
                                VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, returnInfo.SkuId, EnumPushOrderAction.OrderReturnConfirm);
                                this.ShowMsg("成功的确认了售后", true, HttpContext.Current.Request.Url.ToString());
                            }
                            else
                            {
                                this.ShowMsg("确认售后失败!", false);
                            }
                        }
                    }
                }
            }
        }
Example #15
0
        protected override void AttachChildControls()
        {
            string orderId = this.Page.Request.QueryString["orderId"];

            this.LogisticsInfo = (HtmlGenericControl)this.FindControl("LogisticsInfoPanel");
            Literal literal = this.FindControl("litLogisiticType") as Literal;

            this.hylExpress100Search = (HyperLink)this.FindControl("hylExpress100Search");
            this.ulExpress           = (HtmlGenericControl)this.FindControl("ulExpress");
            int num = 0;

            int.TryParse(this.Page.Request.QueryString["returnsId"], out num);
            int num2 = 0;

            int.TryParse(this.Page.Request.QueryString["replaceId"], out num2);
            string          text            = "";
            string          text2           = "";
            string          text3           = "";
            string          text4           = "";
            string          text5           = "";
            string          text6           = "";
            bool            flag            = false;
            HtmlInputHidden htmlInputHidden = this.FindControl("hidReplaceType") as HtmlInputHidden;
            OrderInfo       orderInfo       = ShoppingProcessor.GetOrderInfo(orderId);

            if (orderInfo == null || orderInfo.UserId != HiContext.Current.UserId)
            {
                if (num > 0)
                {
                    ReturnInfo returnInfo = TradeHelper.GetReturnInfo(num);
                    if (returnInfo != null && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
                    {
                        text  = returnInfo.ExpressCompanyName;
                        text2 = returnInfo.ShipOrderNumber;
                        text3 = returnInfo.AdminShipTo;
                        text4 = returnInfo.AdminCellPhone;
                        text5 = returnInfo.AdminShipAddress;
                        text6 = returnInfo.ExpressCompanyAbb;
                        flag  = true;
                    }
                }
                if (num2 > 0)
                {
                    ReplaceInfo replaceInfo = TradeHelper.GetReplaceInfo(num2);
                    orderInfo = ShoppingProcessor.GetOrderInfo(replaceInfo.OrderId);
                    if (orderInfo == null)
                    {
                        this.LogisticsInfo.InnerHtml = "订单不存在或已被删除";
                        return;
                    }
                    if (replaceInfo != null)
                    {
                        if (replaceInfo.HandleStatus == ReplaceStatus.UserDelivery)
                        {
                            htmlInputHidden.Value = "User";
                            text  = replaceInfo.UserExpressCompanyName;
                            text2 = replaceInfo.UserShipOrderNumber;
                            text3 = replaceInfo.AdminShipTo;
                            text4 = replaceInfo.AdminCellPhone;
                            text5 = replaceInfo.AdminShipAddress;
                            text6 = replaceInfo.ExpressCompanyAbb;
                            flag  = true;
                        }
                        if (replaceInfo.HandleStatus == ReplaceStatus.MerchantsDelivery || replaceInfo.HandleStatus == ReplaceStatus.Replaced)
                        {
                            htmlInputHidden.Value = "Mall";
                            text  = replaceInfo.ExpressCompanyName;
                            text2 = replaceInfo.ShipOrderNumber;
                            text3 = orderInfo.ShipTo;
                            text4 = (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone);
                            text5 = orderInfo.ShippingRegion + "   " + orderInfo.Address;
                            text6 = orderInfo.ExpressCompanyAbb;
                        }
                        else
                        {
                            this.LogisticsInfo.InnerHtml = "商家还未发货";
                        }
                    }
                }
            }
            else
            {
                flag  = true;
                text  = orderInfo.ExpressCompanyName;
                text2 = orderInfo.ShipOrderNumber;
                text3 = orderInfo.ShipTo;
                text4 = (string.IsNullOrEmpty(orderInfo.CellPhone) ? orderInfo.TelPhone : orderInfo.CellPhone);
                text5 = orderInfo.ShippingRegion + "   " + orderInfo.Address;
                text6 = orderInfo.ExpressCompanyAbb;
            }
            if (!flag)
            {
                base.GotoResourceNotFound("错误的物流数据");
            }
            Literal         literal2         = this.FindControl("ltlExpressCompanyName") as Literal;
            Literal         literal3         = this.FindControl("ltlShipOrderNumber") as Literal;
            Literal         literal4         = this.FindControl("ltlReceiveName") as Literal;
            Literal         literal5         = this.FindControl("ltlTel") as Literal;
            Literal         literal6         = this.FindControl("ltlShipAddress") as Literal;
            Literal         literal7         = this.FindControl("Repeater") as Literal;
            HtmlInputHidden htmlInputHidden2 = this.FindControl("hidOrderId") as HtmlInputHidden;

            htmlInputHidden2.Value = ((orderInfo != null) ? orderInfo.OrderId : string.Empty);
            HtmlInputHidden htmlInputHidden3 = this.FindControl("hidIsShowDadaGIS") as HtmlInputHidden;
            HtmlInputHidden htmlInputHidden4 = this.FindControl("hidUserLatlng") as HtmlInputHidden;
            HtmlInputHidden htmlInputHidden5 = this.FindControl("hidStoreLatlng") as HtmlInputHidden;
            HtmlInputHidden htmlInputHidden6 = this.FindControl("hidBaseURL") as HtmlInputHidden;

            htmlInputHidden6.Value = Globals.HostPath(this.Page.Request.Url);
            if (orderInfo != null)
            {
                if (orderInfo.ExpressCompanyName.ToNullString() == "同城物流配送")
                {
                    htmlInputHidden3.Value = "1";
                }
                if (orderInfo.ShippingId > 0)
                {
                    ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(orderInfo.ShippingId);
                    if (shippingAddress != null && !string.IsNullOrWhiteSpace(shippingAddress.LatLng))
                    {
                        htmlInputHidden4.Value = shippingAddress.LatLng;
                    }
                }
                if (orderInfo.StoreId > 0)
                {
                    StoresInfo storeById = StoresHelper.GetStoreById(orderInfo.StoreId);
                    if (storeById != null && !string.IsNullOrWhiteSpace(storeById.LatLng))
                    {
                        htmlInputHidden5.Value = storeById.LatLng;
                    }
                }
                else
                {
                    ShippersInfo defaultOrFirstShipper = SalesHelper.GetDefaultOrFirstShipper(0);
                    if (defaultOrFirstShipper != null)
                    {
                        htmlInputHidden5.Value = defaultOrFirstShipper.Latitude + "," + defaultOrFirstShipper.Longitude;
                    }
                }
            }
            literal2.Text = text;
            literal3.Text = text2;
            if (!string.IsNullOrEmpty(text2))
            {
                string text7 = HttpContext.Current.Request.Url.ToString().ToLower();
                if (text7.IndexOf("/wapshop/") != -1)
                {
                    if (text6.ToLower() == "sf")
                    {
                        this.hylExpress100Search.NavigateUrl = $"http://www.sf-express.com/mobile/cn/sc/dynamic_function/waybill/waybill_query_info.html?billno={text2}";
                        this.hylExpress100Search.Text        = "顺丰官网查询>";
                    }
                    else
                    {
                        this.hylExpress100Search.NavigateUrl = $"https://m.kuaidi100.com/result.jsp?nu={text2}";
                    }
                }
                else if (text6.ToLower() == "sf")
                {
                    this.hylExpress100Search.NavigateUrl = $"http://www.sf-express.com/mobile/cn/sc/dynamic_function/waybill/waybill_query_info.html?billno={text2}";
                    this.hylExpress100Search.Text        = "顺丰官网查询>";
                }
                else
                {
                    this.hylExpress100Search.NavigateUrl = $"https://www.kuaidi100.com/chaxun?nu={text2}";
                }
            }
            else
            {
                this.ulExpress.Visible = false;
            }
            literal4.Text = text3;
            literal5.Text = text4;
            literal6.Text = text5;
            PageTitle.AddSiteNameTitle("查看物流");
        }
Example #16
0
        public void bindReturnInfo()
        {
            int        returnId   = this.Page.Request["ReturnId"].ToInt(0);
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(returnId);

            if (returnInfo == null)
            {
                this.ShowMsg("退货信息错误!", false);
            }
            else
            {
                HiddenField hiddenField = this.hidReturnStatus;
                int         num         = (int)returnInfo.HandleStatus;
                hiddenField.Value = num.ToString();
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMsg("错误的订单信息!", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(returnInfo.SkuId))
                    {
                        this.listPrducts.DataSource = orderInfo.LineItems.Values;
                    }
                    else
                    {
                        Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                        foreach (LineItemInfo value in orderInfo.LineItems.Values)
                        {
                            if (value.SkuId == returnInfo.SkuId)
                            {
                                dictionary.Add(value.SkuId, value);
                            }
                        }
                        this.listPrducts.DataSource = dictionary.Values;
                    }
                    this.listPrducts.DataBind();
                    this.litOrderId.Text      = orderInfo.PayOrderId;
                    this.litOrderTotal.Text   = orderInfo.GetTotal(false).F2ToString("f2");
                    this.litRefundReason.Text = returnInfo.ReturnReason;
                    this.litRefundTotal.Text  = returnInfo.RefundAmount.F2ToString("f2");
                    this.litRemark.Text       = returnInfo.UserRemark;
                    Literal literal = this.litReturnQuantity;
                    num          = returnInfo.Quantity;
                    literal.Text = num.ToString();
                    if (returnInfo.RefundType == RefundTypes.InBankCard)
                    {
                        this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0) + "(" + returnInfo.BankName + "  " + returnInfo.BankAccountName + "  " + returnInfo.BankAccountNo + ")";
                    }
                    else
                    {
                        this.litType.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
                    }
                    string userCredentials = returnInfo.UserCredentials;
                    if (!string.IsNullOrEmpty(userCredentials))
                    {
                        string[] array = userCredentials.Split('|');
                        userCredentials = "";
                        string[] array2 = array;
                        foreach (string str in array2)
                        {
                            userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                        }
                        this.litImageList.Text = userCredentials;
                    }
                    else
                    {
                        this.divCredentials.Visible = false;
                    }
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.btnAcceptReturn.Text = "确认退款";
                        this.btnRefuseReturn.Text = "拒绝退款";
                        this.AfterSaleType        = "退款";
                    }
                    if (returnInfo.HandleStatus == ReturnStatus.Applied && !orderInfo.IsStoreCollect)
                    {
                        this.btnAcceptReturn.Visible = true;
                        this.btnRefuseReturn.Visible = true;
                    }
                    if (returnInfo.HandleStatus == ReturnStatus.Deliverying && this.UserStoreId > 0 && !orderInfo.IsStoreCollect)
                    {
                        this.btnGetGoods.Visible = true;
                    }
                    if ((orderInfo.StoreId == this.UserStoreId || orderInfo.StoreId <= 0 || (!orderInfo.IsStoreCollect && this.UserStoreId == 0)) && (returnInfo.HandleStatus == ReturnStatus.GetGoods || (returnInfo.HandleStatus == ReturnStatus.Deliverying && orderInfo.StoreId <= 0)))
                    {
                        if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
                        {
                            this.btnFinishReturn.Text = "确认收货并完成退款";
                        }
                        this.btnFinishReturn.Visible = true;
                    }
                    if (returnInfo.HandleStatus != ReturnStatus.Refused && returnInfo.HandleStatus != ReturnStatus.Returned)
                    {
                        this.inputPanel.Visible = true;
                        this.showPanel.Visible  = false;
                    }
                    else
                    {
                        this.inputPanel.Visible = false;
                        this.showPanel.Visible  = true;
                    }
                    if (returnInfo.HandleStatus != 0)
                    {
                        this.txtAdminCellPhone.Visible   = false;
                        this.txtAdminShipAddress.Visible = false;
                        this.txtAdminShipTo.Visible      = false;
                        this.litAdminCellPhone.Visible   = true;
                        this.litAdminShipAddrss.Visible  = true;
                        this.litAdminShipTo.Visible      = true;
                        this.litAdminCellPhone.Text      = returnInfo.AdminCellPhone;
                        this.litAdminShipTo.Text         = returnInfo.AdminShipTo;
                        this.litAdminShipAddrss.Text     = returnInfo.AdminShipAddress;
                    }
                    else if (orderInfo.SupplierId > 0)
                    {
                        ShippersInfo defaultGetGoodsShipperBysupplierId = SalesHelper.GetDefaultGetGoodsShipperBysupplierId(orderInfo.SupplierId);
                        if (defaultGetGoodsShipperBysupplierId != null)
                        {
                            Literal literal2 = this.litAdminShipAddrss;
                            TextBox textBox  = this.txtAdminShipAddress;
                            string  text3    = literal2.Text = (textBox.Text = RegionHelper.GetFullRegion(defaultGetGoodsShipperBysupplierId.RegionId, " ", true, 0) + " " + defaultGetGoodsShipperBysupplierId.Address);
                            Literal literal3 = this.litAdminShipTo;
                            TextBox textBox2 = this.txtAdminShipTo;
                            text3 = (literal3.Text = (textBox2.Text = defaultGetGoodsShipperBysupplierId.ShipperName));
                            Literal literal4 = this.litAdminCellPhone;
                            TextBox textBox3 = this.txtAdminCellPhone;
                            text3 = (literal4.Text = (textBox3.Text = defaultGetGoodsShipperBysupplierId.CellPhone));
                        }
                    }
                    else if (orderInfo.StoreId > 0)
                    {
                        StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                        if (storeById != null)
                        {
                            Literal literal5 = this.litAdminShipAddrss;
                            TextBox textBox4 = this.txtAdminShipAddress;
                            string  text3    = literal5.Text = (textBox4.Text = RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
                            Literal literal6 = this.litAdminShipTo;
                            TextBox textBox5 = this.txtAdminShipTo;
                            text3 = (literal6.Text = (textBox5.Text = storeById.ContactMan));
                            Literal literal7 = this.litAdminCellPhone;
                            TextBox textBox6 = this.txtAdminCellPhone;
                            text3 = (literal7.Text = (textBox6.Text = storeById.Tel));
                        }
                    }
                    else
                    {
                        ShippersInfo defaultOrFirstGetGoodShipper = TradeHelper.GetDefaultOrFirstGetGoodShipper();
                        if (defaultOrFirstGetGoodShipper != null)
                        {
                            Literal literal8 = this.litAdminShipAddrss;
                            TextBox textBox7 = this.txtAdminShipAddress;
                            string  text3    = literal8.Text = (textBox7.Text = RegionHelper.GetFullRegion(defaultOrFirstGetGoodShipper.RegionId, " ", true, 0) + " " + defaultOrFirstGetGoodShipper.Address);
                            Literal literal9 = this.litAdminShipTo;
                            TextBox textBox8 = this.txtAdminShipTo;
                            text3 = (literal9.Text = (textBox8.Text = defaultOrFirstGetGoodShipper.ShipperName));
                            Literal literal10 = this.litAdminCellPhone;
                            TextBox textBox9  = this.txtAdminCellPhone;
                            text3 = (literal10.Text = (textBox9.Text = defaultOrFirstGetGoodShipper.CellPhone));
                        }
                    }
                    this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元";
                    this.txtAdminRemark.Text = returnInfo.AdminRemark;
                    if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3);
                    }
                    else
                    {
                        this.txtStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0);
                    }
                    this.litRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2") + "元";
                    Literal literal11 = this.txtAfterSaleId;
                    num                      = returnInfo.ReturnId;
                    literal11.Text           = num.ToString();
                    this.txtPayMoney.Text    = orderInfo.GetTotal(false).F2ToString("f2");
                    this.txtRefundMoney.Text = returnInfo.RefundAmount.F2ToString("f2");
                    HiddenField hiddenField2 = this.hidAfterSaleType;
                    num = (int)returnInfo.AfterSaleType;
                    hiddenField2.Value            = num.ToString();
                    this.hidRefundMaxAmount.Value = orderInfo.GetCanRefundAmount(returnInfo.SkuId, null, 0).F2ToString("f2");
                    if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
                    {
                        this.btnViewLogistic.Visible = true;
                        AttributeCollection attributes = this.btnViewLogistic.Attributes;
                        num = returnInfo.ReturnId;
                        attributes.Add("returnsid", num.ToString());
                        AttributeCollection attributes2 = this.btnViewLogistic.Attributes;
                        num = returnInfo.ReturnId;
                        attributes2.Add("returnsid", num.ToString());
                        this.btnViewLogistic.Attributes.Add("expresscompanyname", returnInfo.ExpressCompanyName.ToString());
                        this.btnViewLogistic.Attributes.Add("shipordernumber", returnInfo.ShipOrderNumber.ToString());
                    }
                    if (orderInfo.SupplierId > 0)
                    {
                        this.btnGetGoods.Visible = false;
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            this.btnReferral        = (HtmlInputButton)this.FindControl("btnReferral");
            this.btnSendGoods       = (HtmlInputButton)this.FindControl("btnSendGoods");
            this.btnLogistic        = (HtmlInputButton)this.FindControl("btnLogistic");
            this.hidUploadImages    = (HtmlInputHidden)this.FindControl("hidUploadImages");
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.hidOldImages       = (HtmlInputHidden)this.FindControl("hidOldImages");
            this.txtReturnsId       = (HtmlInputHidden)this.FindControl("txtReturnsId");
            this.txtOrderId         = (Literal)this.FindControl("txtOrderId");
            this.txtRefundMoney     = (Literal)this.FindControl("txtRefundMoney");
            this.txtRefundType      = (Literal)this.FindControl("txtRefundType");
            this.txtMemo            = (Literal)this.FindControl("txtMemo");
            this.txtStatus          = (Literal)this.FindControl("txtStatus");
            this.txtAdminRemark     = (Literal)this.FindControl("txtAdminRemark");
            this.txtQuantity        = (Literal)this.FindControl("txtQuantity");
            this.ExpressRow         = (HtmlGenericControl)this.FindControl("ExpressRow");
            this.ExpressNumberRow   = (HtmlGenericControl)this.FindControl("ExpressNumberRow");
            this.AdminRemarkRow     = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
            this.txtExpress         = (Literal)this.FindControl("txtExpress");
            this.txtExpressNo       = (Literal)this.FindControl("txtExpressNo");
            this.txtReturnReason    = (Literal)this.FindControl("txtReturnReason");
            this.litStep            = (Literal)this.FindControl("litStep");
            this.litStatus          = (Literal)this.FindControl("litStatus");
            this.txtIsRefund        = (HtmlInputHidden)this.FindControl("txtIsRefund");
            this.products           = (Common_OrderItem_AfterSales)this.FindControl("Common_OrderItemAfterSales");
            this.txtAfterSaleId     = (Literal)this.FindControl("txtAfterSaleId");
            this.litCredentialsImg  = (Literal)this.FindControl("litCredentialsImg");
            this.litBankName        = (Literal)this.FindControl("litBankName");
            this.litBankAccountName = (Literal)this.FindControl("litBankAccountName");
            this.litBankAccountNo   = (Literal)this.FindControl("litBankAccountNo");
            this.bankRow1           = (HtmlGenericControl)this.FindControl("bankRow1");
            this.bankRow2           = (HtmlGenericControl)this.FindControl("bankRow2");
            this.bankRow3           = (HtmlGenericControl)this.FindControl("bankRow3");
            int num = HttpContext.Current.Request.QueryString["ReturnId"].ToInt(0);

            if (num <= 0)
            {
                HttpContext.Current.Request.QueryString["ReturnsId"].ToInt(0);
            }
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(num);

            if (returnInfo == null)
            {
                this.ShowError("错误的退货信息");
                return;
            }
            if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund)
            {
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0);
            }
            else
            {
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3);
            }
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);

            if (orderInfo == null || orderInfo.UserId != HiContext.Current.UserId)
            {
                this.ShowMessage("退货订单不存在或者不属于当前用户的订单", false, "", 1);
                return;
            }
            if (!string.IsNullOrEmpty(returnInfo.UserCredentials))
            {
                this.hidOldImages.Value = returnInfo.UserCredentials;
            }
            Literal literal = this.txtAfterSaleId;
            int     num2    = returnInfo.ReturnId;

            literal.Text = num2.ToString();
            Literal literal2 = this.txtQuantity;

            num2          = returnInfo.Quantity;
            literal2.Text = num2.ToString();
            HtmlInputHidden htmlInputHidden = this.txtReturnsId;

            num2 = returnInfo.ReturnId;
            htmlInputHidden.Value     = num2.ToString();
            this.txtOrderId.Text      = returnInfo.OrderId;
            this.txtRefundMoney.Text  = returnInfo.RefundAmount.F2ToString("f2");
            this.txtRefundType.Text   = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
            this.txtMemo.Text         = returnInfo.UserRemark;
            this.txtReturnReason.Text = returnInfo.ReturnReason;
            if (returnInfo.RefundType == RefundTypes.InBankCard)
            {
                this.bankRow1.Visible        = true;
                this.bankRow2.Visible        = true;
                this.bankRow3.Visible        = true;
                this.litBankName.Text        = returnInfo.BankName;
                this.litBankAccountName.Text = returnInfo.BankAccountName;
                this.litBankAccountNo.Text   = returnInfo.BankAccountNo;
            }
            string userCredentials = returnInfo.UserCredentials;

            if (!string.IsNullOrEmpty(userCredentials))
            {
                string[] array = userCredentials.Split('|');
                userCredentials = "";
                string[] array2 = array;
                foreach (string str in array2)
                {
                    userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                }
                this.litCredentialsImg.Text = userCredentials;
            }
            if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
            {
                this.txtExpress.Text   = returnInfo.ExpressCompanyName;
                this.txtExpressNo.Text = returnInfo.ShipOrderNumber;
            }
            else
            {
                this.ExpressRow.Visible       = false;
                this.ExpressNumberRow.Visible = false;
                this.btnLogistic.Visible      = false;
            }
            if (returnInfo.HandleStatus != ReturnStatus.MerchantsAgreed && returnInfo.HandleStatus != ReturnStatus.Deliverying)
            {
                this.btnSendGoods.Visible = false;
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.btnSendGoods.Value = "修改发货信息";
            }
            if (!string.IsNullOrEmpty(returnInfo.AdminRemark))
            {
                this.txtAdminRemark.Text = returnInfo.AdminRemark;
                if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = true;
                }
            }
            else if (this.AdminRemarkRow != null)
            {
                this.AdminRemarkRow.Visible = false;
            }
            if (orderInfo != null)
            {
                this.products.order = orderInfo;
                if (string.IsNullOrEmpty(returnInfo.SkuId))
                {
                    this.products.DataSource = orderInfo.LineItems.Values;
                }
                else
                {
                    Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                    foreach (LineItemInfo value2 in orderInfo.LineItems.Values)
                    {
                        if (value2.SkuId == returnInfo.SkuId)
                        {
                            dictionary.Add(value2.SkuId, value2);
                        }
                    }
                    this.products.DataSource = dictionary.Values;
                }
                this.products.DataBind();
            }
            DateTime dateTime = returnInfo.AgreedOrRefusedTime.HasValue ? returnInfo.AgreedOrRefusedTime.Value : returnInfo.ApplyForTime;
            DateTime value;
            DateTime dateTime2;

            if (returnInfo.FinishTime.HasValue)
            {
                DateTime?finishTime = returnInfo.FinishTime;
                value = DateTime.MinValue;
                if (!(finishTime == (DateTime?)value))
                {
                    dateTime2 = returnInfo.FinishTime.Value;
                    goto IL_0842;
                }
            }
            dateTime2 = returnInfo.ApplyForTime;
            goto IL_0842;
IL_0842:
            DateTime dateTime3 = dateTime2;
            DateTime dateTime4 = returnInfo.UserSendGoodsTime.HasValue ? returnInfo.UserSendGoodsTime.Value : dateTime;
            DateTime dateTime5 = returnInfo.ConfirmGoodsTime.HasValue ? returnInfo.ConfirmGoodsTime.Value : dateTime4;
            string   text      = "<ul>";

            returnInfo.AdminRemark = (string.IsNullOrEmpty(returnInfo.AdminRemark) ? "" : ("备注:" + returnInfo.AdminRemark));
            if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                this.txtIsRefund.Value = "1";
                if (returnInfo.HandleStatus == ReturnStatus.Applied)
                {
                    string str2   = text;
                    string text2  = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str2 + text2.Replace("{time}", string.Format(format, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
                {
                    string str3    = text;
                    string text3   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format2 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str3 + text3.Replace("{time}", string.Format(format2, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家同意申请");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Returned)
                {
                    string str4    = text;
                    string text4   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format3 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str4 + text4.Replace("{time}", string.Format(format3, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家同意申请");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Refused)
                {
                    string str5    = text;
                    string text5   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format4 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str5 + text5.Replace("{time}", string.Format(format4, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家拒绝申请");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, ""))
                            .Replace("{StatusText}", "退款失败");
                }
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Applied)
            {
                string str6    = text;
                string text6   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format5 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str6 + text6.Replace("{time}", string.Format(format5, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
            {
                string str7    = text;
                string text7   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format6 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str7 + text7.Replace("{time}", string.Format(format6, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                string str8    = text;
                string text8   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format7 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str8 + text8.Replace("{time}", string.Format(format7, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.GetGoods)
            {
                string str9    = text;
                string text9   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format8 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str9 + text9.Replace("{time}", string.Format(format8, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Returned)
            {
                string str10   = text;
                string text10  = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format9 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str10 + text10.Replace("{time}", string.Format(format9, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Refused)
            {
                string str11    = text;
                string text11   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format10 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str11 + text11.Replace("{time}", string.Format(format10, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家拒绝退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "退货失败");
            }
            text += "</ul>";
            this.litStep.Text = text;
            if (returnInfo != null && returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                PageTitle.AddSiteNameTitle("退款详情");
            }
            else
            {
                PageTitle.AddSiteNameTitle("退货详情");
            }
        }