Пример #1
0
        private void btnAcceptReplace_Click(object sender, EventArgs e)
        {
            string      text           = Globals.StripAllTags(this.txtAdminRemark.Text);
            string      text2          = Globals.StripAllTags(this.txtAdminShipAddress.Text);
            string      adminShipTo    = Globals.StripAllTags(this.txtAdminShipTo.Text);
            string      adminCellPhone = Globals.StripAllTags(this.txtAdminCellPhone.Text);
            int         replaceId      = this.Page.Request["replaceId"].ToInt(0);
            ReplaceInfo replaceInfo    = TradeHelper.GetReplaceInfo(replaceId);

            if (replaceInfo == null)
            {
                this.ShowMsg("换货信息错误!", false);
            }
            else if (this.UserStoreId != replaceInfo.StoreId && replaceInfo.StoreId >= 0)
            {
                this.ShowMsg("换货只能由发货的店铺或者平台进行处理!", false);
            }
            else
            {
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(replaceInfo.OrderId);
                if (orderInfo == null)
                {
                    this.ShowMsg("绑定的订单信息不存在!", false);
                }
                else if (replaceInfo.HandleStatus != 0)
                {
                    this.ShowMsg("错误的售后状态", false);
                }
                else
                {
                    if (string.IsNullOrEmpty(text))
                    {
                        text = replaceInfo.AdminRemark;
                    }
                    if (string.IsNullOrEmpty(text2))
                    {
                        this.ShowMsg("请输入平台收货地址,告之用户发货的地址和联系方式", false);
                    }
                    else if (OrderHelper.AgreedReplace(replaceInfo.ReplaceId, replaceInfo.OrderId, replaceInfo.SkuId, text, text2, adminShipTo, adminCellPhone, false))
                    {
                        this.ShowMsg("成功的确认了订单换货", true, HttpContext.Current.Request.Url.ToString());
                    }
                    else
                    {
                        this.ShowMsg("订单或者订单项状态错误!", false);
                    }
                }
            }
        }