Example #1
0
 private void btnSendGoods_Click(object sender, EventArgs e)
 {
     if (grdOrderGoods.Rows.Count <= 0)
     {
         ShowMsg("没有要进行发货的订单。", false);
     }
     else
     {
         DropdownColumn     column        = (DropdownColumn)grdOrderGoods.Columns[4];
         ListItemCollection selectedItems = column.SelectedItems;
         int num = 0;
         for (int i = 0; i < selectedItems.Count; i++)
         {
             string   orderId = (string)grdOrderGoods.DataKeys[grdOrderGoods.Rows[i].RowIndex].Value;
             TextBox  box     = (TextBox)grdOrderGoods.Rows[i].FindControl("txtShippOrderNumber");
             ListItem item    = selectedItems[i];
             int      result  = 0;
             int.TryParse(item.Value, out result);
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (((orderInfo != null) && ((orderInfo.GroupBuyId <= 0) || (orderInfo.GroupBuyStatus == GroupBuyStatus.Success))) && (((orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid) && (result > 0)) && (!string.IsNullOrEmpty(box.Text) && (box.Text.Length <= 20))))
             {
                 ShippingModeInfo shippingMode = SubsiteSalesHelper.GetShippingMode(result, true);
                 orderInfo.RealShippingModeId = shippingMode.ModeId;
                 orderInfo.RealModeName       = shippingMode.Name;
                 orderInfo.ExpressCompanyAbb  = shippingMode.ExpressCompanyAbb;
                 orderInfo.ExpressCompanyName = shippingMode.ExpressCompanyName;
                 orderInfo.ShipOrderNumber    = box.Text;
                 if (SubsiteSalesHelper.SendGoods(orderInfo))
                 {
                     if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && (orderInfo.GatewayOrderId.Trim().Length > 0))
                     {
                         PaymentModeInfo paymentMode = SubsiteSalesHelper.GetPaymentMode(orderInfo.PaymentTypeId);
                         if (paymentMode != null)
                         {
                             PaymentRequest.CreateInstance(paymentMode.Gateway, Cryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[] { paymentMode.Gateway })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS");
                         }
                     }
                     int userId = orderInfo.UserId;
                     if (userId == 0x44c)
                     {
                         userId = 0;
                     }
                     IUser user = Users.GetUser(userId);
                     Messenger.OrderShipping(orderInfo, user);
                     orderInfo.OnDeliver();
                 }
                 num++;
             }
         }
         if (num == 0)
         {
             ShowMsg("批量发货失败!,发货数量0个", false);
         }
         else if (num > 0)
         {
             BindData();
             ShowMsg(string.Format("批量发货成功!,发货数量{0}个", num), true);
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     btnRemark.Click += new EventHandler(btnRemark_Click);
     LoadUserControl();
     if (!string.IsNullOrEmpty(base.Request["isCallback"]) && (base.Request["isCallback"] == "true"))
     {
         string s = "{";
         if (!string.IsNullOrEmpty(Page.Request["OrderId"]))
         {
             string    orderId   = Page.Request["OrderId"];
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (!(((orderInfo == null) || ((orderInfo.OrderStatus != OrderStatus.SellerAlreadySent) && (orderInfo.OrderStatus != OrderStatus.Finished))) || string.IsNullOrEmpty(orderInfo.ExpressCompanyAbb)))
             {
                 string expressData = Express.GetExpressData(orderInfo.ExpressCompanyAbb, orderInfo.ShipOrderNumber);
                 s = s + "\"Express\":\"" + expressData + "\"";
             }
         }
         s = s + "}";
         base.Response.Clear();
         base.Response.ContentType = "application/json";
         base.Response.Write(s);
         base.Response.End();
     }
     if (!Page.IsPostBack)
     {
         BindRemark();
         LoadControl();
     }
 }
Example #3
0
 private void grdPurchaseOrders_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         HyperLink          link            = (HyperLink)e.Row.FindControl("lkbtnSendGoods");
         HtmlGenericControl control         = (HtmlGenericControl)e.Row.FindControl("lkBtnCancelPurchaseOrder");
         HyperLink          link2           = (HyperLink)e.Row.FindControl("lkbtnPay");
         OrderStatus        status          = (OrderStatus)DataBinder.Eval(e.Row.DataItem, "PurchaseStatus");
         string             purchaseOrderId = (string)DataBinder.Eval(e.Row.DataItem, "PurchaseOrderId");
         PurchaseOrderInfo  purchaseOrder   = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (!purchaseOrder.IsManualPurchaseOrder && (status == OrderStatus.SellerAlreadySent))
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(purchaseOrder.OrderId);
             if ((orderInfo != null) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid))
             {
                 link.Visible = true;
             }
         }
         if (status == OrderStatus.WaitBuyerPay)
         {
             control.Visible   = true;
             control.InnerHtml = control.InnerHtml + "<br />";
             link2.Visible     = true;
         }
     }
 }
Example #4
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (this.Page.Request.QueryString["OrderId"] == null)
     {
         base.GotoResourceNotFound();
         return;
     }
     this.orderId                       = this.Page.Request.QueryString["OrderId"];
     this.order                         = SubsiteSalesHelper.GetOrderInfo(this.orderId);
     this.btnSearch.Click              += new System.EventHandler(this.btnSearch_Click);
     this.btnClear.Click               += new System.EventHandler(this.btnClear_Click);
     this.dlstGifts.ItemCommand        += new System.Web.UI.WebControls.DataListCommandEventHandler(this.dlstGifts_ItemCommand);
     this.dlstOrderGifts.DeleteCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.dlstOrderGifts_DeleteCommand);
     if (!base.IsPostBack)
     {
         if (this.order == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         if (this.order.OrderStatus != OrderStatus.WaitBuyerPay)
         {
             base.GotoResourceNotFound();
             return;
         }
         if (this.order.Gifts.Count > 0)
         {
             this.litPageTitle.Text = "编辑订单礼品";
             this.litPageNote.Text  = "修改赠送给买家的礼品.";
         }
         this.BindGifts();
         this.BindOrderGifts();
     }
 }
        private void dlstPurchaseOrders_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                HyperLink          link    = (HyperLink)e.Item.FindControl("lkbtnPay");
                HyperLink          link2   = (HyperLink)e.Item.FindControl("lkbtnSendGoods");
                HtmlGenericControl control = (HtmlGenericControl)e.Item.FindControl("lkBtnCancelPurchaseOrder");
                ImageLinkButton    button  = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder");
                OrderStatus        status  = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "PurchaseStatus");
                string             orderId = (string)DataBinder.Eval(e.Item.DataItem, "OrderId");
                switch (status)
                {
                case OrderStatus.WaitBuyerPay:
                    link.Visible    = true;
                    control.Visible = true;
                    break;

                case OrderStatus.SellerAlreadySent:
                {
                    OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
                    if ((orderInfo == null) || (orderInfo.OrderStatus != OrderStatus.BuyerAlreadyPaid))
                    {
                        button.Visible = true;
                        break;
                    }
                    link2.Visible = true;
                    break;
                }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.orderId = this.Page.Request.QueryString["OrderId"];
         this.order   = SubsiteSalesHelper.GetOrderInfo(this.orderId);
         this.btnUpdateOrderAmount.Click += new EventHandler(this.btnUpdateOrderAmount_Click);
         this.grdOrderGift.RowDeleting   += new GridViewDeleteEventHandler(this.grdOrderGift_RowDeleting);
         this.grdProducts.RowDeleting    += new GridViewDeleteEventHandler(this.grdProducts_RowDeleting);
         this.grdProducts.RowCommand     += new GridViewCommandEventHandler(this.grdProducts_RowCommand);
         if (!this.Page.IsPostBack)
         {
             if (this.order == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.BindProductList(this.order);
                 this.BindOtherAmount(this.order);
                 this.BindTatolAmount(this.order);
             }
         }
     }
 }
Example #7
0
 private void grdPurchaseOrders_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
 {
     if (e.Row.RowType == System.Web.UI.WebControls.DataControlRowType.DataRow)
     {
         System.Web.UI.WebControls.HyperLink           hyperLink          = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnSendGoods");
         System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Row.FindControl("lkBtnCancelPurchaseOrder");
         System.Web.UI.WebControls.HyperLink           hyperLink2         = (System.Web.UI.WebControls.HyperLink)e.Row.FindControl("lkbtnPay");
         OrderStatus       orderStatus     = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "PurchaseStatus");
         string            purchaseOrderId = (string)System.Web.UI.DataBinder.Eval(e.Row.DataItem, "PurchaseOrderId");
         PurchaseOrderInfo purchaseOrder   = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (!purchaseOrder.IsManualPurchaseOrder && orderStatus == OrderStatus.SellerAlreadySent)
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(purchaseOrder.OrderId);
             if (orderInfo != null && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid)
             {
                 hyperLink.Visible = true;
             }
         }
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             htmlGenericControl.Visible    = true;
             htmlGenericControl.InnerHtml += "<br />";
             hyperLink2.Visible            = true;
         }
     }
 }
Example #8
0
        private void btnRefuseRefund_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            SubsiteSalesHelper.CheckRefund(orderInfo, this.txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), false);
            this.BindRefund();
            this.ShowMsg("成功的拒绝了订单退款", true);
        }
Example #9
0
        protected void btnRefuseReturn_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            SubsiteSalesHelper.CheckReturn(orderInfo, 0m, this.return_txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), false);
            this.BindReturns();
            this.ShowMsg("成功的拒绝了订单退货", true);
        }
Example #10
0
 private void dlstPurchaseOrders_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
 {
     if (e.Item.ItemType == System.Web.UI.WebControls.ListItemType.Item || e.Item.ItemType == System.Web.UI.WebControls.ListItemType.AlternatingItem)
     {
         System.Web.UI.WebControls.HyperLink           hyperLink          = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnPay");
         System.Web.UI.WebControls.HyperLink           hyperLink2         = (System.Web.UI.WebControls.HyperLink)e.Item.FindControl("lkbtnSendGoods");
         System.Web.UI.HtmlControls.HtmlGenericControl htmlGenericControl = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("lkBtnCancelPurchaseOrder");
         ImageLinkButton imageLinkButton = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder");
         System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor  = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund");
         System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor2 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn");
         System.Web.UI.HtmlControls.HtmlAnchor htmlAnchor3 = (System.Web.UI.HtmlControls.HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace");
         OrderStatus orderStatus = (OrderStatus)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "PurchaseStatus");
         string      orderId     = (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "OrderId");
         System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("litPayment");
         if (orderStatus == OrderStatus.SellerAlreadySent)
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (orderInfo != null && orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid)
             {
                 hyperLink2.Visible = true;
             }
             else
             {
                 imageLinkButton.Visible = true;
             }
             htmlAnchor2.Visible = true;
             htmlAnchor3.Visible = true;
         }
         if (orderStatus == OrderStatus.WaitBuyerPay)
         {
             hyperLink.Visible          = true;
             htmlGenericControl.Visible = true;
             if (System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway") != System.DBNull.Value && "hishop.plugins.payment.podrequest" == (string)System.Web.UI.DataBinder.Eval(e.Item.DataItem, "Gateway"))
             {
                 hyperLink.Visible = false;
             }
         }
         if (orderStatus == OrderStatus.BuyerAlreadyPaid)
         {
             htmlAnchor.Visible = true;
         }
         string            purchaseOrderId = this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString();
         PurchaseOrderInfo purchaseOrder   = SubsiteSalesHelper.GetPurchaseOrder(purchaseOrderId);
         if (string.IsNullOrEmpty(purchaseOrder.PaymentType))
         {
             if (orderStatus == OrderStatus.BuyerAlreadyPaid)
             {
                 literal.Text = "<br>支付方式:预付款";
                 return;
             }
         }
         else
         {
             literal.Text = "<br>支付方式:" + purchaseOrder.PaymentType;
         }
     }
 }
        private void dlstPurchaseOrders_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))
            {
                HyperLink          link    = (HyperLink)e.Item.FindControl("lkbtnPay");
                HyperLink          link2   = (HyperLink)e.Item.FindControl("lkbtnSendGoods");
                HtmlGenericControl control = (HtmlGenericControl)e.Item.FindControl("lkBtnCancelPurchaseOrder");
                ImageLinkButton    button  = (ImageLinkButton)e.Item.FindControl("lkbtnConfirmPurchaseOrder");
                HtmlAnchor         anchor  = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseRefund");
                HtmlAnchor         anchor2 = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReturn");
                HtmlAnchor         anchor3 = (HtmlAnchor)e.Item.FindControl("lkbtnApplyForPurchaseReplace");
                OrderStatus        status  = (OrderStatus)DataBinder.Eval(e.Item.DataItem, "PurchaseStatus");
                string             orderId = (string)DataBinder.Eval(e.Item.DataItem, "OrderId");
                Literal            literal = (Literal)e.Item.FindControl("litPayment");
                if (status == OrderStatus.SellerAlreadySent)
                {
                    OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
                    if ((orderInfo != null) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid))
                    {
                        link2.Visible = true;
                    }
                    else
                    {
                        button.Visible = true;
                    }
                    anchor2.Visible = true;
                    anchor3.Visible = true;
                }
                switch (status)
                {
                case OrderStatus.WaitBuyerPay:
                    link.Visible    = true;
                    control.Visible = true;
                    if ((DataBinder.Eval(e.Item.DataItem, "Gateway") != DBNull.Value) && ("hishop.plugins.payment.podrequest" == ((string)DataBinder.Eval(e.Item.DataItem, "Gateway"))))
                    {
                        link.Visible = false;
                    }
                    break;

                case OrderStatus.BuyerAlreadyPaid:
                    anchor.Visible = true;
                    break;
                }
                PurchaseOrderInfo purchaseOrder = SubsiteSalesHelper.GetPurchaseOrder(this.dlstPurchaseOrders.DataKeys[e.Item.ItemIndex].ToString());
                if (string.IsNullOrEmpty(purchaseOrder.PaymentType))
                {
                    if (status == OrderStatus.BuyerAlreadyPaid)
                    {
                        literal.Text = "<br>支付方式:预付款";
                    }
                }
                else
                {
                    literal.Text = "<br>支付方式:" + purchaseOrder.PaymentType;
                }
            }
        }
Example #12
0
        protected void btnAcceptRefund_Click(object sender, EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            if (SubsiteSalesHelper.CheckRefund(orderInfo, this.txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), true))
            {
                this.BindRefund();
                orderInfo.GetTotal();
                if ((orderInfo.GroupBuyId > 0) && (orderInfo.GroupBuyStatus != GroupBuyStatus.Failed))
                {
                    decimal decimal1 = orderInfo.GetTotal() - orderInfo.NeedPrice;
                }
                this.ShowMsg("成功的确认了订单退款", true);
            }
        }
Example #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
            {
                base.GotoResourceNotFound();
                return;
            }
            this.orderId             = this.Page.Request.QueryString["OrderId"];
            this.btnSendGoods.Click += new System.EventHandler(this.btnSendGoods_Click);
            this.radioShippingMode.SelectedIndexChanged += new System.EventHandler(this.radioShippingMode_SelectedIndexChanged);
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.orderId);

            this.BindOrderItems(orderInfo);
            if (!this.Page.IsPostBack)
            {
                if (orderInfo == null)
                {
                    base.GotoResourceNotFound();
                    return;
                }
                this.radioShippingMode.DataBind();
                this.BindShippingAddress(orderInfo);
                PurchaseOrderInfo purchaseByOrderId = SubsiteSalesHelper.GetPurchaseByOrderId(this.orderId);
                if (purchaseByOrderId != null && purchaseByOrderId.PurchaseStatus != OrderStatus.WaitBuyerPay && purchaseByOrderId.PurchaseStatus != OrderStatus.BuyerAlreadyPaid)
                {
                    this.txtShipOrderNumber.Text         = purchaseByOrderId.ShipOrderNumber;
                    this.radioShippingMode.SelectedValue = new int?(purchaseByOrderId.RealShippingModeId);
                    this.BindExpressCompany(purchaseByOrderId.RealShippingModeId);
                    this.expressRadioButtonList.SelectedValue = purchaseByOrderId.ExpressCompanyName;
                }
                else
                {
                    this.radioShippingMode.SelectedValue = new int?(orderInfo.ShippingModeId);
                    this.BindExpressCompany(orderInfo.ShippingModeId);
                    this.expressRadioButtonList.SelectedValue = orderInfo.ExpressCompanyName;
                }
                this.litShippingModeName.Text = orderInfo.ModeName;
                this.litShipToDate.Text       = orderInfo.ShipToDate;
                this.litRemark.Text           = orderInfo.Remark;
                if (this.txtShipOrderNumber.Text.IndexOf("showWindow_ShipInfoPage") != -1)
                {
                    this.htmlContent1.Attributes.Add("style", "display:none");
                    this.litlShipOrderNumber.Text = this.txtShipOrderNumber.Text;
                    return;
                }
                //this.htmlContent2.Attributes.Add("style", "display:none");
            }
        }
Example #14
0
        protected void btnAcceptRefund_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            if (SubsiteSalesHelper.CheckRefund(orderInfo, this.txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), true))
            {
                this.BindOrders();
                decimal amount = orderInfo.GetTotal();
                if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Failed)
                {
                    amount = orderInfo.GetTotal() - orderInfo.NeedPrice;
                }
                Hidistro.Membership.Context.Member user = Hidistro.Membership.Context.Users.GetUser(orderInfo.UserId) as Hidistro.Membership.Context.Member;
                Messenger.OrderRefund(user, orderInfo.OrderId, amount);
                this.ShowMsg("成功的确认了订单退款", true);
            }
        }
        protected void btnAcceptRefund_Click(object sender, EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            if (SubsiteSalesHelper.CheckRefund(orderInfo, this.txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), true))
            {
                this.BindOrders();
                decimal total = orderInfo.GetTotal();
                if ((orderInfo.GroupBuyId > 0) && (orderInfo.GroupBuyStatus != GroupBuyStatus.Failed))
                {
                    total = orderInfo.GetTotal() - orderInfo.NeedPrice;
                }
                Member user = Users.GetUser(orderInfo.UserId) as Member;
                Messenger.OrderRefund(user, orderInfo.OrderId, total);
                this.ShowMsg("成功的确认了订单退款", true);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.Page.Request.QueryString["OrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.orderId             = this.Page.Request.QueryString["OrderId"];
         this.btnSendGoods.Click += new EventHandler(this.btnSendGoods_Click);
         this.radioShippingMode.SelectedIndexChanged += new EventHandler(this.radioShippingMode_SelectedIndexChanged);
         OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.orderId);
         this.BindOrderItems(orderInfo);
         if (!this.Page.IsPostBack)
         {
             if (orderInfo == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.radioShippingMode.DataBind();
                 this.BindShippingAddress(orderInfo);
                 PurchaseOrderInfo purchaseByOrderId = SubsiteSalesHelper.GetPurchaseByOrderId(this.orderId);
                 if (((purchaseByOrderId != null) && (purchaseByOrderId.PurchaseStatus != OrderStatus.WaitBuyerPay)) && (purchaseByOrderId.PurchaseStatus != OrderStatus.BuyerAlreadyPaid))
                 {
                     this.txtShipOrderNumber.Text         = purchaseByOrderId.ShipOrderNumber;
                     this.radioShippingMode.SelectedValue = new int?(purchaseByOrderId.RealShippingModeId);
                     this.BindExpressCompany(purchaseByOrderId.RealShippingModeId);
                     this.expressRadioButtonList.SelectedValue = purchaseByOrderId.ExpressCompanyName;
                 }
                 else
                 {
                     this.radioShippingMode.SelectedValue = new int?(orderInfo.ShippingModeId);
                     this.BindExpressCompany(orderInfo.ShippingModeId);
                     this.expressRadioButtonList.SelectedValue = orderInfo.ExpressCompanyName;
                 }
                 this.litShippingModeName.Text = orderInfo.ModeName;
                 this.litShipToDate.Text       = orderInfo.ShipToDate;
                 this.litRemark.Text           = orderInfo.Remark;
             }
         }
     }
 }
Example #17
0
        private void grdOrderGift_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            if (!this.order.CheckAction(OrderActions.SELLER_MODIFY_TRADE))
            {
                this.ShowMsg("你当前订单的状态不能进行修改订单费用操作", false);
                return;
            }
            int giftId = (int)this.grdOrderGift.DataKeys[e.RowIndex].Value;

            if (SubsiteSalesHelper.DeleteOrderGift(this.order, giftId))
            {
                this.order = SubsiteSalesHelper.GetOrderInfo(this.orderId);
                this.BindProductList(this.order);
                this.BindTatolAmount(this.order);
                this.ShowMsg("成功删除了一件礼品", true);
                return;
            }
            this.ShowMsg("删除礼品失败", false);
        }
Example #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Page.Request.QueryString["OrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         orderId = Page.Request.QueryString["OrderId"];
         if (!Page.IsPostBack)
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (orderInfo == null)
             {
                 base.GotoResourceNotFound();
             }
             else if ((orderInfo.RefundStatus != RefundStatus.Refund) && (orderInfo.RefundStatus != RefundStatus.Below))
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 litOrderId.Text       = orderInfo.OrderId;
                 lblOrderDate.Time     = orderInfo.OrderDate;
                 lblTotalPrice.Money   = orderInfo.GetTotal();
                 lblRefundDate.Time    = orderInfo.FinishDate;
                 lblRefundAmount.Money = orderInfo.RefundAmount;
                 litRefundRemark.Text  = orderInfo.RefundRemark;
                 if (orderInfo.RefundStatus == RefundStatus.Below)
                 {
                     lblRefundMode.InnerHtml  = "线下退款";
                     lblDescription.InnerHtml = "退款成功,通过线下操作返回给了买家";
                 }
                 else if (orderInfo.RefundStatus == RefundStatus.Refund)
                 {
                     lblRefundMode.InnerHtml  = "预付款退款";
                     lblDescription.InnerHtml = "退款成功直接返还到买家的预付款帐户中";
                 }
             }
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         LoadUserControl();
         hlkOrder.Text           = base.purchaseOrder.OrderId;
         hlkOrder.NavigateUrl    = Globals.ApplicationPath + string.Format("/shopadmin/sales/UnShippingOrderDetails.aspx?OrderId={0}", base.purchaseOrder.OrderId);
         litPurchaseOrderId.Text = base.purchaseOrder.PurchaseOrderId;
         OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(base.purchaseOrder.OrderId);
         if ((orderInfo != null) && (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid))
         {
             btnSendGood.Visible     = true;
             btnSendGood.NavigateUrl = Globals.ApplicationPath + "/Shopadmin/sales/SendMyGoods.aspx?OrderId=" + base.purchaseOrder.OrderId;
         }
         if (base.purchaseOrder.RefundStatus == RefundStatus.Refund)
         {
             divRefundDetails.Visible     = true;
             hlkRefundDetails.NavigateUrl = Globals.ApplicationPath + "/Shopadmin/purchaseOrder/RefundPurchaseDetails.aspx?PurchaseOrderId=" + base.purchaseOrder.PurchaseOrderId;
         }
     }
 }
Example #20
0
        private void btnCloseOrder_Click(object sender, System.EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value);

            orderInfo.CloseReason = this.ddlCloseReason.SelectedValue;
            if (SubsiteSalesHelper.CloseTransaction(orderInfo))
            {
                int num = orderInfo.UserId;
                if (num == 1100)
                {
                    num = 0;
                }
                Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num);
                Messenger.OrderClosed(user, orderInfo.OrderId, orderInfo.CloseReason);
                orderInfo.OnClosed();
                this.BindOrders();
                this.ShowMsg("关闭订单成功", true);
                return;
            }
            this.ShowMsg("关闭订单失败", false);
        }
Example #21
0
        private void btnCloseOrder_Click(object sender, EventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(hidOrderId.Value);

            orderInfo.CloseReason = ddlCloseReason.SelectedValue;
            if (SubsiteSalesHelper.CloseTransaction(orderInfo))
            {
                int userId = orderInfo.UserId;
                if (userId == 0x44c)
                {
                    userId = 0;
                }
                Messenger.OrderClosed(Users.GetUser(userId), orderInfo.OrderId, orderInfo.CloseReason);
                orderInfo.OnClosed();
                BindOrders();
                ShowMsg("关闭订单成功", true);
            }
            else
            {
                ShowMsg("关闭订单失败", false);
            }
        }
Example #22
0
 private void grdOrderGift_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (!order.CheckAction(OrderActions.SELLER_MODIFY_TRADE))
     {
         ShowMsg("你当前订单的状态不能进行修改订单费用操作", false);
     }
     else
     {
         int giftId = (int)grdOrderGift.DataKeys[e.RowIndex].Value;
         if (SubsiteSalesHelper.DeleteOrderGift(order, giftId))
         {
             order = SubsiteSalesHelper.GetOrderInfo(orderId);
             BindProductList(order);
             BindTatolAmount(order);
             ShowMsg("成功删除了一件礼品", true);
         }
         else
         {
             ShowMsg("删除礼品失败", false);
         }
     }
 }
 private void grdProducts_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (!this.order.CheckAction(OrderActions.SELLER_MODIFY_TRADE))
     {
         this.ShowMsg("你当前订单的状态不能进行修改订单费用操作", false);
     }
     else if (this.order.LineItems.Values.Count <= 1)
     {
         this.ShowMsg("订单的最后一件商品不允许删除", false);
     }
     else if (SubsiteSalesHelper.DeleteOrderProduct(this.grdProducts.DataKeys[e.RowIndex].Value.ToString(), this.order))
     {
         this.order = SubsiteSalesHelper.GetOrderInfo(this.orderId);
         this.BindProductList(this.order);
         this.BindTatolAmount(this.order);
         this.ShowMsg("成功删除了一件商品", true);
     }
     else
     {
         this.ShowMsg("删除商品失败", false);
     }
 }
Example #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Page.Request.QueryString["OrderId"] == null)
     {
         base.GotoResourceNotFound();
     }
     else
     {
         orderId                       = Page.Request.QueryString["OrderId"];
         order                         = SubsiteSalesHelper.GetOrderInfo(orderId);
         btnReturn.Click              += new EventHandler(btnReturn_Click);
         btnSearch.Click              += new EventHandler(btnSearch_Click);
         btnClear.Click               += new EventHandler(btnClear_Click);
         dlstGifts.ItemCommand        += new DataListCommandEventHandler(dlstGifts_ItemCommand);
         dlstOrderGifts.DeleteCommand += new DataListCommandEventHandler(dlstOrderGifts_DeleteCommand);
         if (!base.IsPostBack)
         {
             if (order == null)
             {
                 base.GotoResourceNotFound();
             }
             else if (order.OrderStatus != OrderStatus.WaitBuyerPay)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 if (order.Gifts.Count > 0)
                 {
                     litPageTitle.Text = "编辑订单礼品";
                     litPageNote.Text  = "修改赠送给买家的礼品.";
                 }
                 BindGifts();
                 BindOrderGifts();
             }
         }
     }
 }
Example #25
0
        protected void btnAcceptReturn_Click(object sender, System.EventArgs e)
        {
            decimal num;

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

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

            SubsiteSalesHelper.CheckReturn(orderInfo, num, this.return_txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), true);
            this.BindReturns();
            this.ShowMsg("成功的确认了订单退货", true);
        }
        private void btnAcceptReturn_Click(object sender, EventArgs e)
        {
            decimal num;

            if (!decimal.TryParse(this.return_txtRefundMoney.Text, out num))
            {
                this.ShowMsg("退款金额需为数字格式", false);
            }
            else
            {
                decimal num2;
                decimal.TryParse(this.hidOrderTotal.Value, out num2);
                if (num > num2)
                {
                    this.ShowMsg("退款金额不能大于订单金额", false);
                }
                else
                {
                    SubsiteSalesHelper.CheckReturn(SubsiteSalesHelper.GetOrderInfo(this.hidOrderId.Value), num, this.return_txtAdminRemark.Value, int.Parse(this.hidRefundType.Value), true);
                    this.BindOrders();
                    this.ShowMsg("成功的确认了订单退货", true);
                }
            }
        }
Example #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Page.Request.QueryString["OrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         orderId          = Page.Request.QueryString["OrderId"];
         BtnRefund.Click += new EventHandler(BtnRefund_Click);
         if (!Page.IsPostBack)
         {
             OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(orderId);
             if (orderInfo == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 SetControl(orderInfo);
             }
         }
     }
 }
Example #28
0
 protected override void OnInit(EventArgs e)
 {
     if (string.IsNullOrEmpty(Page.Request.QueryString["OrderId"]))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         orderId = Page.Request.QueryString["OrderId"];
         Order   = SubsiteSalesHelper.GetOrderInfo(orderId);
         if (Order == null)
         {
             base.GotoResourceNotFound();
         }
         else if (Order.OrderStatus != pageOrderStatus)
         {
             Redirect();
         }
         else
         {
             base.OnInit(e);
         }
     }
 }
Example #29
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.dlstOrders.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.dlstOrders_ItemDataBound);
     this.btnSearchButton.Click    += new System.EventHandler(this.btnSearchButton_Click);
     this.dlstOrders.ItemCommand   += new System.Web.UI.WebControls.DataListCommandEventHandler(this.dlstOrders_ItemCommand);
     this.btnRemark.Click          += new System.EventHandler(this.btnRemark_Click);
     this.btnCloseOrder.Click      += new System.EventHandler(this.btnCloseOrder_Click);
     this.lkbtnDeleteCheck.Click   += new System.EventHandler(this.lkbtnDeleteCheck_Click);
     this.btnAcceptRefund.Click    += new System.EventHandler(this.btnAcceptRefund_Click);
     this.btnRefuseRefund.Click    += new System.EventHandler(this.btnRefuseRefund_Click);
     this.btnAcceptReturn.Click    += new System.EventHandler(this.btnAcceptReturn_Click);
     this.btnRefuseReturn.Click    += new System.EventHandler(this.btnRefuseReturn_Click);
     this.btnAcceptReplace.Click   += new System.EventHandler(this.btnAcceptReplace_Click);
     this.btnRefuseReplace.Click   += new System.EventHandler(this.btnRefuseReplace_Click);
     if (!string.IsNullOrEmpty(base.Request["isCallback"]) && base.Request["isCallback"] == "true")
     {
         if (string.IsNullOrEmpty(base.Request["orderId"]))
         {
             base.Response.Write("{\"Status\":\"0\"}");
             base.Response.End();
             return;
         }
         OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(base.Request["orderId"]);
         System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
         int    num;
         string text;
         if (base.Request["type"] == "refund")
         {
             SubsiteSalesHelper.GetRefundType(base.Request["orderId"], out num, out text);
         }
         else
         {
             if (base.Request["type"] == "return")
             {
                 SubsiteSalesHelper.GetRefundTypeFromReturn(base.Request["orderId"], out num, out text);
             }
             else
             {
                 num  = 0;
                 text = "";
             }
         }
         string arg;
         if (num == 1)
         {
             arg = "退到预存款";
         }
         else
         {
             arg = "银行转帐";
         }
         stringBuilder.AppendFormat(",\"OrderTotal\":\"{0}\"", Globals.FormatMoney(orderInfo.GetTotal()));
         if (base.Request["type"] == "replace")
         {
             string replaceComments = SubsiteSalesHelper.GetReplaceComments(base.Request["orderId"]);
             stringBuilder.AppendFormat(",\"Comments\":\"{0}\"", replaceComments.Replace("\r\n", ""));
         }
         else
         {
             stringBuilder.AppendFormat(",\"RefundType\":\"{0}\"", num);
             stringBuilder.AppendFormat(",\"RefundTypeStr\":\"{0}\"", arg);
         }
         stringBuilder.AppendFormat(",\"Contacts\":\"{0}\"", orderInfo.RealName);
         stringBuilder.AppendFormat(",\"Email\":\"{0}\"", orderInfo.EmailAddress);
         stringBuilder.AppendFormat(",\"Telephone\":\"{0}\"", orderInfo.TelPhone);
         stringBuilder.AppendFormat(",\"Address\":\"{0}\"", orderInfo.Address);
         stringBuilder.AppendFormat(",\"Remark\":\"{0}\"", text.Replace("\r\n", ""));
         stringBuilder.AppendFormat(",\"PostCode\":\"{0}\"", orderInfo.ZipCode);
         base.Response.Clear();
         base.Response.ContentType = "application/json";
         base.Response.Write("{\"Status\":\"1\"" + stringBuilder.ToString() + "}");
         base.Response.End();
     }
     if (!this.Page.IsPostBack)
     {
         this.SetOrderStatusLink();
         this.BindOrders();
     }
     CheckBoxColumn.RegisterClientCheckEvents(this.Page, this.Page.Form.ClientID);
 }
Example #30
0
        private void dlstOrders_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            OrderInfo orderInfo = SubsiteSalesHelper.GetOrderInfo(e.CommandArgument.ToString());

            if (orderInfo != null)
            {
                if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY))
                {
                    int num  = 0;
                    int num2 = 0;
                    int num3 = 0;
                    if (orderInfo.CountDownBuyId > 0)
                    {
                        CountDownInfo countDownInfo = SubsitePromoteHelper.GetCountDownInfo(orderInfo.CountDownBuyId);
                        if (countDownInfo == null || countDownInfo.EndDate < System.DateTime.Now)
                        {
                            this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false);
                            return;
                        }
                    }
                    if (orderInfo.GroupBuyId > 0)
                    {
                        GroupBuyInfo groupBuy = SubsitePromoteHelper.GetGroupBuy(orderInfo.GroupBuyId);
                        if (groupBuy != null)
                        {
                            if (groupBuy.Status == GroupBuyStatus.UnderWay)
                            {
                                num2 = SubsitePromoteHelper.GetOrderCount(orderInfo.GroupBuyId);
                                num  = groupBuy.MaxCount;
                                num3 = orderInfo.GetGroupBuyOerderNumber();
                                if (num < num2 + num3)
                                {
                                    this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false);
                                    return;
                                }
                                goto IL_DB;
                            }
                        }
                        this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false);
                        return;
                    }
IL_DB:
                    if (SubsiteSalesHelper.ConfirmPay(orderInfo))
                    {
                        DebitNote debitNote = new DebitNote();
                        debitNote.NoteId   = Globals.GetGenerateId();
                        debitNote.OrderId  = e.CommandArgument.ToString();
                        debitNote.Operator = Hidistro.Membership.Context.HiContext.Current.User.Username;
                        debitNote.Remark   = "后台" + debitNote.Operator + "支付成功";
                        SubsiteSalesHelper.SaveDebitNote(debitNote);
                        if (orderInfo.GroupBuyId > 0 && num == num2 + num3)
                        {
                            SubsitePromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId);
                        }
                        this.BindOrders();
                        int num4 = orderInfo.UserId;
                        if (num4 == 1100)
                        {
                            num4 = 0;
                        }
                        Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num4);
                        Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal());
                        orderInfo.OnPayment();
                        this.ShowMsg("成功的确认了订单收款", true);
                        return;
                    }
                    this.ShowMsg("确认订单收款失败", false);
                    return;
                }
                else
                {
                    if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE))
                    {
                        if (SubsiteSalesHelper.ConfirmOrderFinish(orderInfo))
                        {
                            this.BindOrders();
                            this.ShowMsg("成功的完成了该订单", true);
                            return;
                        }
                        this.ShowMsg("完成订单失败", false);
                        return;
                    }
                    else
                    {
                        if (e.CommandName == "CREATE_PURCHASEORDER" && orderInfo.CheckAction(OrderActions.SUBSITE_CREATE_PURCHASEORDER))
                        {
                            if (SubsiteSalesHelper.CreatePurchaseOrder(orderInfo))
                            {
                                this.BindOrders();
                                this.ShowMsg("生成采购单成功", true);
                                return;
                            }
                            this.ShowMsg(" 生成采购单失败", false);
                        }
                    }
                }
            }
        }