Ejemplo n.º 1
0
        private void btnRefuseReturn_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.hidOrderId.Value);

            OrderHelper.CheckReturn(orderInfo, Hidistro.Membership.Context.HiContext.Current.User.Username, 0m, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), false);
            this.BindOrders();
            this.ShowMsg("成功的拒绝了订单退货", true);
        }
Ejemplo n.º 2
0
        private void btnRefuseReturns_Click(object sender, System.EventArgs e)
        {
            ManagerHelper.CheckPrivilege(Privilege.OrderReturnsApplyRefuse);
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.hidOrderId.Value);

            OrderHelper.CheckReturn(orderInfo, HiContext.Current.User.Username, 0m, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), false);
            this.BindReturns();
            this.ShowMsg("成功的拒绝了订单退货", true);
        }
Ejemplo n.º 3
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());
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void btnAcceptReturn_Click(object sender, System.EventArgs e)
        {
            decimal num;

            if (!decimal.TryParse(this.hidRefundMoney.Value, out num))
            {
                this.ShowMsg("退款金额需为数字格式!", false);
                return;
            }
            decimal d;

            decimal.TryParse(this.hidOrderTotal.Value, out d);
            if (num > d)
            {
                this.ShowMsg("退款金额不能大于订单金额!", false);
                return;
            }
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.hidOrderId.Value);

            OrderHelper.CheckReturn(orderInfo, Hidistro.Membership.Context.HiContext.Current.User.Username, num, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), true);
            this.BindOrders();
            this.ShowMsg("成功的确认了订单退货", true);
        }
Ejemplo n.º 5
0
        private void btnAcceptReturn_Click(object sender, EventArgs e)
        {
            decimal num;

            if (!decimal.TryParse(this.hidRefundMoney.Value, out num))
            {
                this.ShowMsg("退款金额需为数字格式!", false);
            }
            else
            {
                decimal num2;
                decimal.TryParse(this.hidOrderTotal.Value, out num2);
                if (num > num2)
                {
                    this.ShowMsg("退款金额不能大于订单金额!", false);
                }
                else
                {
                    OrderHelper.CheckReturn(OrderHelper.GetOrderInfo(this.hidOrderId.Value), HiContext.Current.User.Username, num, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), true);
                    this.BindOrders();
                    this.ShowMsg("成功的确认了订单退货", true);
                }
            }
        }
Ejemplo n.º 6
0
 private void btnRefuseReturn_Click(object sender, EventArgs e)
 {
     OrderHelper.CheckReturn(OrderHelper.GetOrderInfo(this.hidOrderId.Value), HiContext.Current.User.Username, 0M, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), false);
     this.BindOrders();
     this.ShowMsg("成功的拒绝了订单退货", true);
 }
Ejemplo n.º 7
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());
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public void BatchDealException(HttpContext context)
        {
            string idList = context.Request["ReturnIds"].ToNullString();

            idList = Globals.GetSafeIDList(idList, ',', true);
            if (string.IsNullOrEmpty(idList))
            {
                throw new HidistroAshxException("请选择要退款/退货的ID");
            }
            IList <ReturnInfo> list = OrderHelper.GetReturnListOfReturnIds(idList);

            if (list != null && list.Count > 0)
            {
                string Operator = HiContext.Current.Manager.UserName;
                Task.Factory.StartNew(delegate
                {
                    int num = 0;
                    foreach (ReturnInfo item in list)
                    {
                        OrderInfo orderInfo = OrderHelper.GetOrderInfo(item.OrderId);
                        if (orderInfo != null && RefundHelper.IsBackReturn(orderInfo.Gateway) && item.RefundType == RefundTypes.BackReturn && !TradeHelper.AlipayCanRefundGateway.Contains(orderInfo.Gateway))
                        {
                            if (item.AfterSaleType == AfterSaleTypes.OnlyRefund)
                            {
                                if (item.HandleStatus == ReturnStatus.Applied)
                                {
                                    goto IL_00cc;
                                }
                            }
                            else if (item.HandleStatus == ReturnStatus.GetGoods || item.HandleStatus == ReturnStatus.Deliverying)
                            {
                                goto IL_00cc;
                            }
                        }
                        continue;
                        IL_00cc:
                        MemberInfo user = Users.GetUser(orderInfo.UserId);
                        string text     = RefundHelper.SendRefundRequest(orderInfo, item.RefundAmount, item.RefundOrderId, true);
                        if (text == "")
                        {
                            if (item.AfterSaleType == AfterSaleTypes.ReturnAndRefund)
                            {
                                if (OrderHelper.CheckReturn(item, orderInfo, Operator, item.RefundAmount, item.AdminRemark, true, false))
                                {
                                    Messenger.OrderRefund(user, orderInfo, item.SkuId);
                                }
                            }
                            else if (OrderHelper.AgreedReturns(item.ReturnId, item.RefundAmount, item.AdminRemark, orderInfo, item.SkuId, item.AdminShipAddress, item.AdminShipTo, item.AdminShipAddress, true, false))
                            {
                                VShopHelper.AppPushRecordForOrder(orderInfo.OrderId, item.SkuId, EnumPushOrderAction.OrderReturnConfirm);
                                Messenger.OrderRefund(user, orderInfo, item.SkuId);
                            }
                            num++;
                        }
                        else
                        {
                            TradeHelper.SaveRefundErr(item.ReturnId, text, false);
                        }
                        Thread.Sleep(5000);
                    }
                    base.ReturnSuccessResult(context, "退款自动处理提交成功,请稍后刷新页面", 0, true);
                });
                return;
            }
            throw new HidistroAshxException("未找到退款记录");
        }
Ejemplo n.º 9
0
        protected void btnAcceptReturns_Click(object sender, System.EventArgs e)
        {
            ManagerHelper.CheckPrivilege(Privilege.OrderReturnsApplyAccept);
            decimal num;

            if (!decimal.TryParse(this.hidRefundMoney.Value, out num))
            {
                this.ShowMsg("退款金额需为数字格式!", false);
                return;
            }
            decimal d;

            decimal.TryParse(this.hidOrderTotal.Value, out d);
            if (num > d)
            {
                this.ShowMsg("退款金额不能大于订单金额!", false);
                return;
            }
            decimal customsClearanceFee;

            if (!decimal.TryParse(this.hidCustomsClearanceFee.Value, out customsClearanceFee))
            {
                this.ShowMsg("清关费需为数字格式!", false);
                return;
            }
            decimal expressFee;

            if (!decimal.TryParse(this.hidExpressFee.Value, out expressFee))
            {
                this.ShowMsg("快递费需为数字格式!", false);
                return;
            }
            int feeAffiliation;

            if (!int.TryParse(hidFeeAffiliation.Value, out feeAffiliation))
            {
                this.ShowMsg("请选择快递费用归属!", false);
                return;
            }
            string Affiliation;

            switch (feeAffiliation)
            {
            case 1:
                Affiliation = "客户承担";
                break;

            case 2:
                Affiliation = "公司承担";
                break;

            case 3:
                Affiliation = "供应商承担";
                break;

            default:
                this.ShowMsg("快递费用归属选择错误!", false);
                return;
            }
            OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.hidOrderId.Value);

            OrderHelper.CheckReturn(orderInfo, HiContext.Current.User.Username, num, expressFee, customsClearanceFee, Affiliation, this.hidAdminRemark.Value, int.Parse(this.hidRefundType.Value), true);
            this.BindReturns();
            this.ShowMsg("成功的确认了订单退货", true);
        }