Exemplo n.º 1
0
        protected void listOrders_ItemCommand(object sender, GridViewCommandEventArgs e)
        {
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(e.CommandArgument.ToString());

            if (orderInfo != null)
            {
                if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                {
                    if (TradeHelper.ConfirmOrderFinish(orderInfo))
                    {
                        this.BindOrders();
                        this.ShowMessage("成功的完成了该订单", true);
                    }
                    else
                    {
                        this.ShowMessage("完成订单失败", false);
                    }
                }
                if ((e.CommandName == "CLOSE_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_CLOSE))
                {
                    if (TradeHelper.CloseOrder(orderInfo.OrderId))
                    {
                        this.BindOrders();
                        this.ShowMessage("成功的关闭了该订单", true);
                    }
                    else
                    {
                        this.ShowMessage("关闭订单失败", false);
                    }
                }
            }
        }
Exemplo n.º 2
0
        protected void listOrders_ItemCommand(object sender, RepeaterCommandEventArgs e)
        {
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(e.CommandArgument.ToString());

            if (orderInfo != null)
            {
                if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                {
                    if (TradeHelper.ConfirmOrderFinish(orderInfo))
                    {
                        this.BindOrders();
                        this.ShowMessage("成功的完成了该订单", true, "", 1);
                        if (orderInfo.LineItems.Count > 0)
                        {
                            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                            if (masterSettings != null && masterSettings.ProductCommentPoint > 0)
                            {
                                Panel panel = (Panel)this.FindControl("panl_productcommentTip");
                                if (panel != null)
                                {
                                    panel.Visible = true;
                                    HiddenField hiddenField = (HiddenField)this.FindControl("goCommentLink");
                                    if (hiddenField != null)
                                    {
                                        hiddenField.Value = $"/user/OrderReviews/{orderInfo.OrderId}";
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        this.ShowMessage("完成订单失败,订单状态错误或者订单商品有退款、退货或者换货正在进行中!", false, "", 1);
                    }
                }
                if (e.CommandName == "CLOSE_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_CLOSE))
                {
                    if (TradeHelper.CloseOrder(orderInfo.OrderId, "会员主动关闭") && orderInfo.ItemStatus == OrderItemStatus.Nomarl)
                    {
                        if (orderInfo.ShippingModeId == -2 && orderInfo.IsConfirm)
                        {
                            OrderHelper.CloseDeportOrderReturnStock(orderInfo, "会员" + HiContext.Current.User.UserName + "关闭订单");
                        }
                        Messenger.OrderClosed(HiContext.Current.User, orderInfo, "用户自己关闭订单");
                        this.BindOrders();
                        this.ShowMessage("成功的关闭了该订单", true, "", 1);
                    }
                    else
                    {
                        this.ShowMessage("关闭订单失败。", false, "", 1);
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void lkbtnConfirmOrder_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);

            if (TradeHelper.ConfirmOrderFinish(orderInfo))
            {
                this.ShowMessage("成功的完成了该订单", true);
                HiContext.Current.Context.Response.Redirect("OrderDetails.aspx?OrderId=" + this.orderId);
                return;
            }
            this.ShowMessage("完成订单失败", false);
        }
Exemplo n.º 4
0
        private void lkbtnConfirmOrder_Click(object sender, EventArgs e)
        {
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);

            if (TradeHelper.ConfirmOrderFinish(orderInfo))
            {
                this.ShowMessage("成功的完成了该订单", true, "", 1);
                HiContext.Current.Context.Response.Redirect("OrderDetails.aspx?OrderId=" + this.orderId);
            }
            else
            {
                this.ShowMessage("完成订单失败,订单状态错误或者订单商品有退款、退货或者换货正在进行中!", false, "", 1);
            }
        }
 private void FinishOrder()
 {
     if (this.Order.OrderStatus == OrderStatus.Finished)
     {
         this.ResponseStatus(true, "success");
         return;
     }
     if (this.Order.CheckAction(OrderActions.BUYER_CONFIRM_GOODS) && TradeHelper.ConfirmOrderFinish(this.Order))
     {
         this.ResponseStatus(true, "success");
         return;
     }
     this.ResponseStatus(false, "fail");
 }
Exemplo n.º 6
0
 private void FinishOrder()
 {
     if (this.Order.OrderStatus == OrderStatus.Finished)
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</p>", this.OrderId, this.Amount.ToString("F")));
         return;
     }
     if (this.Order.CheckAction(OrderActions.BUYER_CONFIRM_GOODS) && TradeHelper.ConfirmOrderFinish(this.Order))
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}</p>", this.OrderId, this.Amount.ToString("F")));
         return;
     }
     base.Response.Write(string.Format("<p style=\"font-size:16px;color:#ff0000;\">订单支付已成功,但是系统在处理过程中遇到问题,请联系管理员</br>支付金额:{0}</p>", this.Amount.ToString("F")));
 }
Exemplo n.º 7
0
 private void FinishOrder()
 {
     if (this.Order.OrderStatus == OrderStatus.Finished)
     {
         base.Response.Write("OK");
     }
     else if (this.Order.CheckAction(OrderActions.BUYER_CONFIRM_GOODS) && TradeHelper.ConfirmOrderFinish(this.Order))
     {
         base.Response.Write("OK");
     }
     else
     {
         base.Response.Write("OK");
     }
 }
Exemplo n.º 8
0
 private void FinishOrder()
 {
     if (this.Order.GroupBuyId > 0)
     {
         this.toFightGroupSuccess();
     }
     else if (this.Order.OrderStatus == OrderStatus.Finished)
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}<br><a href=\"{2}\">查看订单</a></p>", this.OrderId, this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
     }
     else if (this.Order.CheckAction(OrderActions.BUYER_CONFIRM_GOODS) && TradeHelper.ConfirmOrderFinish(this.Order))
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;\">恭喜您,订单已成功完成支付:{0}</br>支付金额:{1}<br><a href=\"{2}\">查看订单</a></p>", this.OrderId, this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
     }
     else
     {
         base.Response.Write(string.Format("<p style=\"font-size:16px;color:#ff0000;\">订单支付已成功,但是系统在处理过程中遇到问题,请联系管理员</br>支付金额:{0}<br><a href=\"{1}\">查看订单</a></p>", this.Amount.ToString("F"), this.GetReturnLink(this.Order.OrderSource)));
     }
 }
Exemplo n.º 9
0
        protected void listOrders_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
        {
            string    orderId   = e.CommandArgument.ToString();
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

            if (orderInfo != null)
            {
                if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                {
                    if (TradeHelper.ConfirmOrderFinish(orderInfo))
                    {
                        this.BindOrders();
                        this.ShowMessage("成功的完成了该订单", true);
                    }
                    else
                    {
                        this.ShowMessage("完成订单失败", false);
                    }
                }
                if (e.CommandName == "CLOSE_TRADE")
                {
                    if (orderInfo.CheckAction(OrderActions.SELLER_CLOSE))
                    {
                        if (TradeHelper.CloseOrder(orderInfo.OrderId, CloseOrderType.Manually))
                        {
                            Messenger.OrderClosed(HiContext.Current.User, orderInfo, "用户自己关闭订单");
                            this.BindOrders();
                            this.ShowMessage("成功的关闭了该订单", true);
                            return;
                        }
                        this.ShowMessage("关闭订单失败", false);
                    }
                    this.BindOrders();
                }
                if (e.CommandName == "CLOSE_Refund")//申请退款
                {
                    this.ReloadUserOrders(true);
                }
                //    string refundrest = string.Empty;
                //    OrderRefundTime = OrderRefundTime > 0 ? OrderRefundTime : 30;
                //    if (orderInfo.IsRefund == 2)
                //    {
                //        this.ShowMessage("您退款已申请成功,无需再提交!", true);
                //        return;
                //    }
                //    if (Convert.ToDateTime(orderInfo.PayDate) > DateTime.Now.AddMinutes(-OrderRefundTime) && orderInfo.IsRefund != 1 && (int)orderInfo.OrderStatus == 2)//可以取消
                //    {
                //        int type = string.IsNullOrEmpty(orderInfo.SourceOrderId) ? 1 : 2;
                //        orderId = type == 1 ? orderId : orderInfo.SourceOrderId;
                //        bool Rest = TradeHelper.ChangeRefundType(orderId, type);
                //        if (Rest)
                //        {
                //            this.Enabled = false;
                //            this.ShowMessage("退款申请成功", true);
                //            this.BindOrders();
                //        }
                //        else
                //        {
                //            this.ShowMessage("退款失败,", false);
                //        }
                //    }
                //    else
                //    {
                //        this.ShowMessage("您离付款时间已经超过" + OrderRefundTime + "分钟,不能自动退款!", false);
                //    }

                //}
            }

            //删除订单(逻辑删除,放到回收站)
            if (e.CommandName == "LogicDelete")
            {
                int result = TradeHelper.LogicDeleteOrder(orderId, (int)UserStatus.RecycleDelete);
                if (result > 0)
                {
                    this.BindOrders();
                    this.ShowMessage("删除订单成功", true);
                }
                else
                {
                    this.ShowMessage("删除订单失败", false);
                }
            }
        }
Exemplo n.º 10
0
        protected void listOrders_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
        {
            string    orderId   = e.CommandArgument.ToString();
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

            if (orderInfo != null)
            {
                if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                {
                    if (TradeHelper.ConfirmOrderFinish(orderInfo))
                    {
                        this.BindOrders();
                        this.ShowMessage("成功的完成了该订单", true);
                    }
                    else
                    {
                        this.ShowMessage("完成订单失败", false);
                    }
                }
                if (e.CommandName == "CLOSE_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_CLOSE))
                {
                    // 2015-08-19
                    if (TradeHelper.CloseOrder(orderInfo.OrderId))
                    {
                        Messenger.OrderClosed(HiContext.Current.User, orderInfo, "用户自己关闭订单");
                        this.BindOrders();
                        this.ShowMessage("成功的关闭了该订单", true);
                        return;
                    }
                    this.ShowMessage("关闭订单失败", false);
                }
            }

            //回收站彻底删除订单
            if (e.CommandName == "completeDel")
            {
                int result = TradeHelper.LogicDeleteOrder(orderId, (int)UserStatus.CompleteDelete);
                if (result > 0)
                {
                    this.BindOrders();
                    this.ShowMessage("删除订单成功", true);
                }
                else
                {
                    this.ShowMessage("删除订单失败", false);
                }
            }

            if (e.CommandName == "RevertDel")
            {
                int result = TradeHelper.LogicDeleteOrder(orderId, (int)UserStatus.DefaultStatus);
                if (result > 0)
                {
                    this.BindOrders();
                    this.ShowMessage("还原订单成功", true);
                }
                else
                {
                    this.ShowMessage("还原订单失败", false);
                }
            }
        }