示例#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);
                    }
                }
            }
        }
示例#2
0
 protected override void AttachChildControls()
 {
     this.replaceId = System.Convert.ToInt32(this.Page.Request.QueryString["ReplaceId"]);
     //this.RefundDetails = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems");
     this.RefundDetails     = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts");
     this.txtOrderId        = (System.Web.UI.WebControls.Literal) this.FindControl("txtOrderId");
     this.handleStatus      = (System.Web.UI.WebControls.Literal) this.FindControl("handleStatus");
     this.litAddDate        = (FormatedTimeLabel)this.FindControl("litAddDate");
     this.litRemark         = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
     this.litAdminRemark    = (System.Web.UI.WebControls.Literal) this.FindControl("litAdminRemark");
     this.litWeight         = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
     this.litUsername       = (System.Web.UI.WebControls.Literal) this.FindControl("litUsername");
     this.litShippingRegion = (System.Web.UI.WebControls.Literal) this.FindControl("litShippingRegion");
     this.litZipCode        = (System.Web.UI.WebControls.Literal) this.FindControl("litZipCode");
     this.litEmailAddress   = (System.Web.UI.WebControls.Literal) this.FindControl("litEmailAddress");
     this.litCellPhone      = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
     this.litTelPhone       = (System.Web.UI.WebControls.Literal) this.FindControl("litTelPhone");
     this.litShipToDate     = (System.Web.UI.WebControls.Literal) this.FindControl("litShipToDate");
     this.litTotalPrice     = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     if (!this.Page.IsPostBack)
     {
         this.BindOrderReplace(this.replaceId);
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         replaceInfo = TradeHelper.GetReplaceInfo(this.replaceId);
         if (orderInfo == null || orderInfo.UserId != HiContext.Current.User.UserId)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
             return;
         }
         this.BindOrderItems(orderInfo);
         this.BindRefunds(replaceInfo);
     }
 }
        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);
            }
        }
示例#4
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            if (!TradeHelper.CanRefund(this.hdorderId.Value))
            {
                this.ShowMessage("已有待确认的申请!", false);
                return;
            }
            if (!this.CanRefundBalance())
            {
                this.ShowMessage("请先开通预付款账户", false);
                return;
            }
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.hdorderId.Value);
            //if (orderInfo.InClearance)
            //{
            //    this.ShowMessage("清关中,不支持退款", false);
            //    this.lkbtnApplyForReturn.Visible = true;
            //    this.lkbtnApplyForRefund.Visible = false;
            //    return;
            //}
            string reason = this.dropRefundReason.SelectedIndex == this.dropRefundReason.Items.Count - 1 ? this.txtRemark.Text : this.dropRefundReason.Text;

            string flagMsg = "";

            if (TradeHelper.ApplyForRefund(this.hdorderId.Value, reason, int.Parse(this.dropRefundType.SelectedValue), out flagMsg))
            {
                orderInfo = TradeHelper.GetOrderInfo(this.orderId);
                this.BindOrderBase(orderInfo);
                this.ShowMessage("成功的申请了退款", true);
                return;
            }
            this.ShowMessage("申请退款失败 " + flagMsg, false);
        }
示例#5
0
        protected override void AttachChildControls()
        {
            this.hidCleintType = (HtmlInputHidden)this.FindControl("hidCleintType");
            this.hidUrl        = (HtmlInputHidden)this.FindControl("hidUrl");
            this.hidErrorMsg   = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.sharePanel    = (HtmlGenericControl)this.FindControl("sharePanel");
            string userAgent = HttpContext.Current.Request.UserAgent;

            if (userAgent.ToLower().IndexOf("micromessenger") > -1)
            {
                this.sharePanel.Visible = true;
            }
            else
            {
                this.sharePanel.Visible = false;
                if (this.Status == "1")
                {
                    this.XmlBalancePay(this.OrderId);
                }
                else
                {
                    this.order = TradeHelper.GetOrderInfo(this.OrderId);
                    if (this.order == null)
                    {
                        this.ShowError("错误的订单信息!");
                    }
                    else
                    {
                        this.XmlPay(this.order);
                    }
                }
            }
        }
示例#6
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("商品评价");
     if (string.IsNullOrEmpty(this.Page.Request.QueryString["orderId"]))
     {
         this.ShowWapMessage("订单还未完成,不能进行评价", "goHomeUrl");
     }
     this.orderId    = this.Page.Request.QueryString["orderId"];
     this.orderItems = (AppshopTemplatedRepeater)this.FindControl("rptRegisterCoupons");
     if (!this.Page.IsPostBack)
     {
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (orderInfo != null && HiContext.Current.UserId != 0 && HiContext.Current.UserId == orderInfo.UserId)
         {
             this.CanToProductReviews(orderInfo);
             if (orderInfo.OrderStatus != OrderStatus.Finished && (orderInfo.OrderStatus != OrderStatus.Closed || orderInfo.OnlyReturnedCount != orderInfo.LineItems.Count))
             {
                 this.ShowWapMessage("订单还未完成,不能进行评价", "MemberOrderDetails.aspx?OrderId=" + orderInfo.OrderId);
             }
             this.BindOrderItems(orderInfo);
         }
         else
         {
             this.ShowWapMessage("该订单不存在或者不属于当前用户的订单", "goHomeUrl");
         }
     }
 }
示例#7
0
 protected override void AttachChildControls()
 {
     this.hlkDetails   = (HyperLink)this.FindControl("hlkDetails");
     this.lblPaystatus = (Label)this.FindControl("lblPayStatus");
     if (!this.Page.IsPostBack)
     {
         if (string.IsNullOrEmpty(this.Page.Request.QueryString["orderId"]))
         {
             this.lblPaystatus.Text  = "无效访问";
             this.hlkDetails.Visible = false;
         }
         else
         {
             OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.Page.Request.QueryString["orderId"]);
             if ((orderInfo == null) || (orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid))
             {
                 this.lblPaystatus.Text  = "订单不存在或订单状态不是已付款";
                 this.hlkDetails.Visible = false;
             }
             else
             {
                 this.hlkDetails.NavigateUrl = Globals.ApplicationPath + "/user/UserOrders.aspx?orderStatus=" + 2;
             }
         }
     }
 }
示例#8
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("查看提货码");
            this.hfTakeCode = (HtmlInputHidden)this.FindControl("hfTakeCode");
            string    orderId   = this.Page.Request.QueryString["orderId"].ToNullString();
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

            if (orderInfo != null && orderInfo.UserId == HiContext.Current.UserId)
            {
                HtmlImage    htmlImage    = this.FindControl("imgProduct") as HtmlImage;
                Literal      control      = this.FindControl("litItemCount") as Literal;
                Literal      control2     = this.FindControl("litStoreName") as Literal;
                Literal      control3     = this.FindControl("litStoreAddress") as Literal;
                Literal      control4     = this.FindControl("litTel") as Literal;
                LineItemInfo lineItemInfo = orderInfo.LineItems.Values.FirstOrDefault();
                Literal      control5     = this.FindControl("litTakeCode") as Literal;
                htmlImage.Src = (string.IsNullOrEmpty(lineItemInfo.ThumbnailsUrl) ? SettingsManager.GetMasterSettings().DefaultProductImage : lineItemInfo.ThumbnailsUrl);
                control.SetWhenIsNotNull(orderInfo.LineItems.Count.ToString());
                control5.SetWhenIsNotNull(orderInfo.TakeCode);
                this.hfTakeCode.SetWhenIsNotNull(Globals.HIPOSTAKECODEPREFIX + orderInfo.TakeCode);
                StoresInfo storeById = DepotHelper.GetStoreById(orderInfo.StoreId);
                if (storeById != null)
                {
                    control2.SetWhenIsNotNull(storeById.StoreName);
                    control4.SetWhenIsNotNull(storeById.Tel);
                    control3.SetWhenIsNotNull(RegionHelper.GetFullRegion(storeById.RegionId, " ", true, 0) + " " + storeById.Address);
                }
            }
        }
示例#9
0
 protected override void AttachChildControls()
 {
     if (string.IsNullOrEmpty(this.Page.Request.QueryString["orderId"]))
     {
         this.ShowWapMessage("订单还未完成,不能进行评价", "Default.aspx");
     }
     this.orderId    = this.Page.Request.QueryString["orderId"];
     this.orderItems = (WapTemplatedRepeater)this.FindControl("rptRegisterCoupons");
     this.hidHasProductCommentPoint       = (HtmlInputHidden)this.FindControl("hidHasProductCommentPoint");
     this.hidHasProductCommentPoint.Value = (this.GetProductCommentPoint() ? "1" : "0");
     if (!this.Page.IsPostBack)
     {
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (orderInfo != null && HiContext.Current.UserId != 0 && HiContext.Current.UserId == orderInfo.UserId)
         {
             this.CanToProductReviews(orderInfo);
             if (orderInfo.OrderStatus != OrderStatus.Finished && (orderInfo.OrderStatus != OrderStatus.Closed || orderInfo.OnlyReturnedCount != orderInfo.LineItems.Count))
             {
                 this.ShowWapMessage("订单还未完成,不能进行评价", "MemberOrderDetails.aspx?OrderId=" + orderInfo.OrderId);
             }
             this.BindOrderItems(orderInfo);
         }
         else
         {
             this.ShowWapMessage("该订单不存在或者不属于当前用户的订单", "MemberOrders.aspx");
         }
     }
 }
        protected override void AttachChildControls()
        {
            this.refundId = System.Convert.ToInt32(this.Page.Request.QueryString["RefundId"]);
            //this.RefundDetails = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems");
            this.txtOrderId       = (System.Web.UI.WebControls.Literal) this.FindControl("txtOrderId");
            this.handleStatus     = (System.Web.UI.WebControls.Literal) this.FindControl("handleStatus");
            this.litAddDate       = (FormatedTimeLabel)this.FindControl("litAddDate");
            this.litRemark        = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
            this.litAdminRemark   = (System.Web.UI.WebControls.Literal) this.FindControl("litAdminRemark");
            this.litWeight        = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
            this.litType          = (System.Web.UI.WebControls.Literal) this.FindControl("litType");
            this.litTotalPrice    = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
            this.litRefundTotal   = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
            this.litOrderTotal    = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
            this.rptOrderProducts = (WapTemplatedRepeater)this.FindControl("rptOrderProducts");
            if (!this.Page.IsPostBack)
            {
                this.BindOrderRefund(this.refundId);
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
                if (orderInfo == null || orderInfo.UserId != HiContext.Current.User.UserId)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
                    return;
                }
                this.BindOrderItems(orderInfo);
                this.BindRefunds(orderInfo);
            }

            PageTitle.AddSiteNameTitle("退款申请单");

            WAPHeadName.AddHeadName("退款申请单");
        }
 protected override void AttachChildControls()
 {
     this.returnsId              = System.Convert.ToInt32(this.Page.Request.QueryString["ReturnsId"]);
     this.RefundDetails          = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems");
     this.txtOrderId             = (System.Web.UI.WebControls.Literal) this.FindControl("txtOrderId");
     this.handleStatus           = (System.Web.UI.WebControls.Literal) this.FindControl("handleStatus");
     this.litAddDate             = (FormatedTimeLabel)this.FindControl("litAddDate");
     this.litRemark              = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
     this.litAdminRemark         = (System.Web.UI.WebControls.Literal) this.FindControl("litAdminRemark");
     this.litWeight              = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
     this.litType                = (System.Web.UI.WebControls.Literal) this.FindControl("litType");
     this.litTotalPrice          = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     this.litRefundTotal         = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
     this.litOrderTotal          = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
     this.litCustomsClearanceFee = (FormatedMoneyLabel)this.FindControl("litCustomsClearanceFee");
     this.litExpressFee          = (FormatedMoneyLabel)this.FindControl("litExpressFee");
     this.litFeeAffiliation      = (System.Web.UI.WebControls.Literal) this.FindControl("litFeeAffiliation");
     this.litLogisticsCompany    = (System.Web.UI.WebControls.Literal) this.FindControl("litLogisticsCompany");
     this.litLogisticsId         = (System.Web.UI.WebControls.Literal) this.FindControl("litLogisticsId");
     if (!this.Page.IsPostBack)
     {
         this.BindReturnsTable(this.returnsId);
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (orderInfo == null || orderInfo.UserId != HiContext.Current.User.UserId)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
             return;
         }
         this.BindOrderItems(orderInfo);
         this.BindRefunds(orderInfo);
     }
 }
示例#12
0
文件: Pay.cs 项目: uvbs/eshopSanQiang
 protected override void AttachChildControls()
 {
     this.lblOrderId        = (System.Web.UI.WebControls.Label) this.FindControl("lblOrderId");
     this.lblOrderAmount    = (FormatedMoneyLabel)this.FindControl("lblOrderAmount");
     this.txtPassword       = (System.Web.UI.WebControls.TextBox) this.FindControl("txtPassword");
     this.litUseableBalance = (FormatedMoneyLabel)this.FindControl("litUseableBalance");
     this.btnPay            = ButtonManager.Create(this.FindControl("btnPay"));
     this.orderId           = this.Page.Request.QueryString["orderId"];
     PageTitle.AddSiteNameTitle("订单支付", HiContext.Current.Context);
     this.btnPay.Click += new System.EventHandler(this.btnPay_Click);
     if (string.IsNullOrEmpty(this.orderId))
     {
         base.GotoResourceNotFound();
     }
     if (!this.Page.IsPostBack)
     {
         Member member = Users.GetUser(HiContext.Current.User.UserId, false) as Member;
         if (!member.IsOpenBalance)
         {
             this.Page.Response.Redirect(Globals.ApplicationPath + string.Format("/user/OpenBalance.aspx?ReturnUrl={0}", System.Web.HttpContext.Current.Request.Url));
         }
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (!orderInfo.CheckAction(OrderActions.BUYER_PAY))
         {
             this.ShowMessage("当前的订单订单状态不是等待付款,所以不能支付", false);
             this.btnPay.Visible = false;
         }
         this.lblOrderId.Text         = orderInfo.OrderId;
         this.lblOrderAmount.Money    = orderInfo.GetTotal();
         this.litUseableBalance.Money = member.Balance - member.RequestBalance;
     }
 }
示例#13
0
 protected override void AttachChildControls()
 {
     if (string.IsNullOrEmpty(this.Page.Request.QueryString["orderId"]))
     {
         base.GotoResourceNotFound();
     }
     this.orderId         = this.Page.Request.QueryString["orderId"];
     this.orderItems      = (Common_OrderManage_ReviewsOrderItems)this.FindControl("Common_OrderManage_ReviewsOrderItems");
     this.litWeight       = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
     this.litOrderId      = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId");
     this.lbltotalPrice   = (FormatedMoneyLabel)this.FindControl("lbltotalPrice");
     this.litAddDate      = (FormatedTimeLabel)this.FindControl("litAddDate");
     this.lblOrderStatus  = (OrderStatusLabel)this.FindControl("lblOrderStatus");
     this.litCloseReason  = (System.Web.UI.WebControls.Literal) this.FindControl("litCloseReason");
     this.btnRefer        = ButtonManager.Create(this.FindControl("btnRefer"));
     this.btnRefer.Click += new System.EventHandler(this.btnRefer_Click);
     if (!this.Page.IsPostBack && HiContext.Current.User.UserRole == UserRole.Member)
     {
         this.btnRefer.Text = "提交评论";
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (orderInfo.OrderStatus != OrderStatus.Finished)
         {
             this.ShowMessage("订单还未完成,不能进行评价", false);
             this.btnRefer.Visible = false;
         }
         this.BindOrderItems(orderInfo);
         this.BindOrderBase(orderInfo);
     }
 }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.btnAcceptRefund.Click += this.btnAcceptRefund_Click;
            this.btnRefuseRefund.Click += this.btnRefuseRefund_Click;
            int refundId = this.Page.Request["RefundId"].ToInt(0);

            this.refund     = TradeHelper.GetRefundInfo(refundId);
            this.RefundData = this.refund;
            if (this.refund == null)
            {
                this.ShowMsg("退款信息错误!", false);
            }
            else
            {
                this.order = TradeHelper.GetOrderInfo(this.refund.OrderId);
                if (this.order == null)
                {
                    this.ShowMsg("错误的订单信息!", false);
                }
                else if (!this.Page.IsPostBack)
                {
                    this.bindRefundInfo();
                }
            }
        }
示例#15
0
        private void btnReturn_Click(object sender, System.EventArgs e)
        {
            if (!TradeHelper.CanReturn(this.hdorderId.Value))
            {
                this.ShowMessage("已有待确认的申请!", false);
                return;
            }
            if (!this.CanReturnBalance())
            {
                this.ShowMessage("请先开通预付款账户", false);
                return;
            }
            string reason = string.Empty;

            if (this.dropReturnReason.SelectedIndex == this.dropReturnReason.Items.Count - 1)
            {
                reason = this.txtReturnRemark.Text;
            }
            else
            {
                reason = this.dropReturnReason.Text + Environment.NewLine + this.txtReturnRemark.Text;
            }
            if (TradeHelper.ApplyForReturn(this.hdorderId.Value, reason, int.Parse(this.dropReturnRefundType.SelectedValue)))
            {
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
                this.BindOrderBase(orderInfo);
                this.ShowMessage("成功的申请了退货", true);
                return;
            }
            this.ShowMessage("申请退货失败", false);
        }
        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("订单中不包含商品信息");
                }
            }
        }
示例#17
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="orderNo"></param>
        private void updateOrder(string orderNo)
        {
            int i = TradeHelper.GetOrderInfo(orderNo).OrderStatusInt;

            if (i == 1)
            {
                OrderHelper.UpdateOrders(orderNo, 4, "订单未按时完成付款");
                //dealmain.UpdateExecStatusByWait(orderNo);
            }
        }
示例#18
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);
                    }
                }
            }
        }
示例#19
0
 private void lkbtnCloseOrder_Click(object sender, System.EventArgs e)
 {
     // 2015-08-19
     if (TradeHelper.CloseOrder(this.orderId))
     {
         this.ShowMessage("成功的关闭了该订单", true);
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         this.BindOrderBase(orderInfo);
         return;
     }
     this.ShowMessage("关闭订单失败", false);
 }
示例#20
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);
        }
示例#21
0
 private void lkbtnCloseOrder_Click(object sender, EventArgs e)
 {
     if (TradeHelper.CloseOrder(this.orderId, "会员主动关闭"))
     {
         this.ShowMessage("成功的关闭了该订单", true, "", 1);
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         this.BindOrderBase(orderInfo);
     }
     else
     {
         this.ShowMessage("关闭订单失败!", false, "", 1);
     }
 }
示例#22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.Request.QueryString["orderId"] != null)
            {
                string orderId = Page.Request.QueryString["orderId"];

                OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

                if (orderInfo != null)
                {
                    if (orderInfo.OrderStatus == OrderStatus.WaitBuyerPay)
                    {
                        PaymentModeInfo paymentMode = TradeHelper.GetPaymentMode(orderInfo.PaymentTypeId);

                        if (paymentMode == null)
                        {
                            Response.Write("<div><font color='red'>您之前选择的支付方式已经不存在</font></div>");
                        }
                        else
                        {
                            string showUrl = Globals.FullPath(Globals.GetSiteUrls().Home);

                            if (string.Compare(paymentMode.Gateway, "Hishop.Plugins.Payment.BankRequest", true) == 0)
                            {
                                showUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("bank_pay", new object[] { orderInfo.OrderId }));
                            }
                            if (string.Compare(paymentMode.Gateway, "Hishop.Plugins.Payment.AdvanceRequest", true) == 0)
                            {
                                showUrl = Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("advance_pay", new object[] { orderInfo.OrderId }));
                            }

                            string attach = "";

                            HttpCookie cookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];

                            if (!((cookie == null) || string.IsNullOrEmpty(cookie.Value)))
                            {
                                attach = cookie.Value;
                            }

                            PaymentRequest.CreateInstance(paymentMode.Gateway, Cryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单支付", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, showUrl, Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[] { paymentMode.Gateway })), attach).SendRequest();
                        }
                    }
                    else
                    {
                        Page.Response.Write("订单当前状态不能支付");
                    }
                }
            }
        }
示例#23
0
        private DataGridViewModel <Dictionary <string, object> > GetOrderList(OrderQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();
            DbQueryResult orders = OrderHelper.GetOrders(query);

            dataGridViewModel.rows  = DataHelper.DataTableToDictionary(orders.Data);
            dataGridViewModel.total = orders.TotalRecords;
            string[] orderIds = (from d in dataGridViewModel.rows
                                 select d["OrderId"].ToString()).ToArray();
            List <RefundInfo> refundInfos = TradeHelper.GetRefundInfos(orderIds);

            foreach (Dictionary <string, object> row in dataGridViewModel.rows)
            {
                OrderInfo order = TradeHelper.GetOrderInfo(row["OrderId"].ToString());
                row.Add("OrderStatusText", OrderHelper.GetOrderStatusText(order.OrderStatus, order.ShippingModeId, order.IsConfirm, order.Gateway, 0, order.PreSaleId, order.DepositDate, false, order.ItemStatus, order.OrderType));
                row.Add("CanConfirmOrder", order.CanConfirmOrder());
                row.Add("canCheckTake", order.CanConfirmTakeCode());
                row.Add("canCloseOrder", order.CanClose(base.CurrentSiteSetting.OpenMultStore, true));
                row.Add("canOfflineReceipt", OrderHelper.CanConfirmOfflineReceipt(order, true));
                row.Add("canSendGoods", order.CanSendGoods(base.CurrentSiteSetting.OpenMultStore));
                row.Add("canFinishTrade", order.OrderStatus == OrderStatus.SellerAlreadySent && order.ItemStatus == OrderItemStatus.Nomarl);
                row.Add("canCancelSendGoods", order.OrderStatus == OrderStatus.SellerAlreadySent && (order.DadaStatus == DadaStatus.WaitOrder || order.DadaStatus == DadaStatus.WaitTake));
                row.Add("InvoiceTypeText", string.IsNullOrEmpty(order.InvoiceTitle) ? "" : EnumDescription.GetEnumDescription((Enum)(object)order.InvoiceType, 0));
                row.Add("dadaState", (order.DadaStatus != 0) ? ((Enum)(object)order.DadaStatus).ToDescription() : "");
                RefundInfo refundInfo = refundInfos.FirstOrDefault((RefundInfo d) => d.OrderId == order.OrderId);
                if (refundInfo != null)
                {
                    row.Add("RefundId", refundInfo.RefundId);
                }
                if (order.IsStoreCollect)
                {
                    row.Add("isShowCheckRefund", order.OrderStatus == OrderStatus.ApplyForRefund && order.StoreId == base.CurrentManager.StoreId);
                }
                bool flag = false;
                if (order.FightGroupId > 0)
                {
                    FightGroupInfo fightGroup = VShopHelper.GetFightGroup(order.FightGroupId);
                    if (fightGroup != null)
                    {
                        row.Add("FightGroupActivityId", fightGroup.FightGroupActivityId);
                        if (fightGroup.Status == FightGroupStatus.FightGroupIn && order.OrderStatus != OrderStatus.WaitBuyerPay && order.OrderStatus != OrderStatus.Closed)
                        {
                            flag = true;
                        }
                    }
                }
                row.Add("FightGrouping", flag);
            }
            return(dataGridViewModel);
        }
示例#24
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);
            }
        }
示例#25
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);
                    }
                }
            }
        }
示例#26
0
 protected override void AttachChildControls()
 {
     this.credentialsImg     = (HtmlImage)this.FindControl("credentialsImg");
     this.divCredentials     = (HtmlGenericControl)this.FindControl("divCredentials");
     this.litRefundReason    = (Literal)this.FindControl("litRefundReason");
     this.refundId           = base.GetParameter("RefundId", false).ToInt(0);
     this.products           = (Common_OrderItems_AfterSales)this.FindControl("Common_OrderItems_AfterSales");
     this.txtOrderId         = (Literal)this.FindControl("txtOrderId");
     this.txtAfterSaleId     = (Literal)this.FindControl("txtAfterSaleId");
     this.litRemark          = (Literal)this.FindControl("litRemark");
     this.litAdminRemark     = (Literal)this.FindControl("litAdminRemark");
     this.litWeight          = (Literal)this.FindControl("litWeight");
     this.litType            = (Literal)this.FindControl("litType");
     this.litUserRemark      = (Literal)this.FindControl("litUserRemark");
     this.litTotalPrice      = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
     this.litRefundTotal     = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
     this.litOrderTotal      = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
     this.litStep            = (Literal)this.FindControl("litStep");
     this.litTime            = (Literal)this.FindControl("litTime");
     this.litProcess         = (Literal)this.FindControl("litProcess");
     this.lnkReApply         = (HtmlAnchor)this.FindControl("lnkReApply");
     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.refund             = TradeHelper.GetRefundInfo(this.refundId);
     if (this.refund == null)
     {
         this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("退款信息不存在或者不属于当前用户"));
     }
     else
     {
         this.order = TradeHelper.GetOrderInfo(this.refund.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)
         {
             this.BindOrderRefund(this.refund);
             this.BindOrderItems(this.order);
             this.BindProducts(this.order);
         }
     }
 }
示例#27
0
 private void btnReplace_Click(object sender, System.EventArgs e)
 {
     if (!TradeHelper.CanReplace(this.hdorderId.Value))
     {
         this.ShowMessage("已有待确认的申请!", false);
         return;
     }
     if (TradeHelper.ApplyForReplace(this.hdorderId.Value, this.txtReplaceRemark.Text))
     {
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         this.BindOrderBase(orderInfo);
         this.ShowMessage("成功的申请了换货", true);
         return;
     }
     this.ShowMessage("申请换货失败", false);
 }
示例#28
0
        private bool CheckRedEnvelope(string sendCode, string orderId)
        {
            if (string.IsNullOrEmpty(sendCode))
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=发送码错误", true);
            }
            if (string.IsNullOrEmpty(orderId))
            {
                NameValueCollection nameValueCollection = new NameValueCollection
                {
                    this.Context.Request.QueryString,
                    this.Context.Request.Form
                };
                nameValueCollection.Add("OrderId1", orderId);
                nameValueCollection.Add("sendCode1", sendCode);
                Globals.AppendLog(nameValueCollection, "", "", "", "CheckRedEnvelope");
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=订单编号为空", true);
            }
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(orderId);

            if (orderInfo == null)
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=订单不存在", true);
            }
            RedEnvelopeSendRecord redEnvelopeSendRecord = WeiXinRedEnvelopeProcessor.GetRedEnvelopeSendRecord(Guid.Parse(sendCode), orderId, "");

            if (redEnvelopeSendRecord == null)
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=发送码不存在", true);
            }
            this.weiXinRedEnvelope = WeiXinRedEnvelopeProcessor.GetWeiXinRedEnvelope(redEnvelopeSendRecord.RedEnvelopeId.Value);
            if (this.weiXinRedEnvelope == null)
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=红包活动已经被删除", true);
            }
            if (this.weiXinRedEnvelope.State == 0)
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=红包活动已经关闭", true);
            }
            DateTime now = DateTime.Now;

            if (now > this.weiXinRedEnvelope.ActiveStartTime && this.weiXinRedEnvelope.ActiveEndTime < now)
            {
                this.Page.Response.Redirect("/Vshop/RedEnvelopeError?errorInfo=红包活动没有开始或已过期", true);
            }
            return(true);
        }
示例#29
0
 protected override void AttachChildControls()
 {
     this.lblOrderId        = (Label)this.FindControl("lblOrderId");
     this.lblOrderAmount    = (FormatedMoneyLabel)this.FindControl("lblOrderAmount");
     this.txtPassword       = (TextBox)this.FindControl("txtPassword");
     this.litUseableBalance = (FormatedMoneyLabel)this.FindControl("litUseableBalance");
     this.btnPay            = ButtonManager.Create(this.FindControl("btnPay"));
     this.lblDeposit        = (FormatedMoneyLabel)this.FindControl("lblDeposit");
     this.lblFinalPayment   = (FormatedMoneyLabel)this.FindControl("lblFinalPayment");
     this.hidPreSaleId      = (HiddenField)this.FindControl("hidPreSaleId");
     this.hidIsPayDeposit   = (HiddenField)this.FindControl("hidIsPayDeposit");
     this.orderId           = base.GetParameter("orderId", false);
     PageTitle.AddSiteNameTitle("订单支付");
     this.btnPay.Click += this.btnPay_Click;
     if (string.IsNullOrEmpty(this.orderId))
     {
         base.GotoResourceNotFound();
     }
     if (!this.Page.IsPostBack)
     {
         MemberInfo user = HiContext.Current.User;
         if (!user.IsOpenBalance)
         {
             this.Page.Response.Redirect($"/user/OpenBalance.aspx?ReturnUrl={HttpContext.Current.Request.Url}");
         }
         OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
         if (!orderInfo.CheckAction(OrderActions.BUYER_PAY))
         {
             this.ShowMessage("当前的订单订单状态不是等待付款,所以不能支付", false, "", 1);
             this.btnPay.Visible = false;
         }
         this.lblOrderId.Text         = orderInfo.OrderId;
         this.lblOrderAmount.Money    = orderInfo.GetTotal(true);
         this.litUseableBalance.Money = user.Balance - user.RequestBalance;
         if (orderInfo.PreSaleId > 0)
         {
             this.lblDeposit.Money      = orderInfo.Deposit;
             this.lblFinalPayment.Money = orderInfo.FinalPayment;
             this.hidPreSaleId.Value    = "1";
             if (orderInfo.DepositDate.HasValue)
             {
                 this.hidIsPayDeposit.Value = "1";
             }
         }
     }
 }
示例#30
0
        private void CancelSendGoods(HttpContext context)
        {
            StoresInfo storeById = StoresHelper.GetStoreById(HiContext.Current.ManagerId);
            string     text      = context.Request["OrderId"].ToNullString();
            int        num       = context.Request["ReasonId"].ToInt(0);
            string     text2     = context.Request["CancelReason"].ToNullString();

            if (string.IsNullOrEmpty(text))
            {
                context.Response.Write(this.GetFailResultJson("错误的订单编号"));
            }
            else
            {
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(text);
                if (orderInfo == null)
                {
                    context.Response.Write(this.GetFailResultJson("订单信息不存在"));
                }
                else if (orderInfo.StoreId != storeById.StoreId)
                {
                    context.Response.Write(this.GetFailResultJson("订单不是该门店的"));
                }
                else if (num == 0)
                {
                    context.Response.Write(this.GetFailResultJson("请选择取消原因"));
                }
                else
                {
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                    DadaHelper.orderFormalCancel(masterSettings.DadaSourceID, text, num, text2);
                    orderInfo.OrderStatus = OrderStatus.BuyerAlreadyPaid;
                    orderInfo.CloseReason = text2;
                    orderInfo.DadaStatus  = DadaStatus.Cancel;
                    TradeHelper.UpdateOrderInfo(orderInfo);
                    string s = JsonConvert.SerializeObject(new
                    {
                        Result = new
                        {
                            Status = "SUCCESS"
                        }
                    });
                    context.Response.Write(s);
                    context.Response.End();
                }
            }
        }