Пример #1
0
        public string GetKuaidi100Url()
        {
            SinGooCMS.Plugin.KuaidiComInfo kuaidiComInfo = KuaidiCom.Get(this.order.ShippingID);
            string result;

            if (kuaidiComInfo != null && !string.IsNullOrEmpty(this.order.ShippingNo))
            {
                result = Kuaidi100.Get(kuaidiComInfo.CompanyCode, this.order.ShippingNo);
            }
            else
            {
                result = string.Empty;
            }
            return(result);
        }
Пример #2
0
        private void UpdateOrder(eumOrderAction action)
        {
            OrdersInfo dataById = Orders.GetDataById(base.OpID);

            dataById.LastModifyTime = System.DateTime.Now;
            string strEventContent = string.Empty;
            string @string         = WebUtils.GetString(this.txtRemark.Text);

            if (string.IsNullOrEmpty(@string))
            {
                base.ShowMsg("请填写本次操作事由");
            }
            else
            {
                switch (action)
                {
                case eumOrderAction.Audit:
                    dataById.OrderStatus    = 1;
                    dataById.OrderAuditTime = System.DateTime.Now;
                    break;

                case eumOrderAction.ChangeAmount:
                    dataById.OrderTotalAmount = WebUtils.GetDecimal(this.newamount.Text);
                    strEventContent           = "管理员[" + base.AccountName + "]修改订单价格为:" + dataById.OrderTotalAmount.ToString("f2");
                    break;

                case eumOrderAction.Pay:
                {
                    SinGooCMS.Payments.PaymentInfo byPayCode = Payment.GetByPayCode(this.paymenttype.SelectedValue);
                    dataById.PayID        = ((byPayCode == null) ? -1 : byPayCode.AutoID);
                    dataById.PayName      = ((byPayCode == null) ? "无" : byPayCode.PayName);
                    dataById.OrderStatus  = 10;
                    dataById.OrderPayTime = System.DateTime.Now;
                    strEventContent       = "管理员[" + base.AccountName + "]已收款,收款方式为:" + dataById.PayName;
                    break;
                }

                case eumOrderAction.SendGoods:
                {
                    SinGooCMS.Plugin.KuaidiComInfo kuaidiComInfo = KuaidiCom.Get(this.kuaidicompany.SelectedValue);
                    dataById.ShippingID    = ((kuaidiComInfo == null) ? -1 : kuaidiComInfo.AutoID);
                    dataById.ShippingName  = ((kuaidiComInfo == null) ? "无" : kuaidiComInfo.CompanyName);
                    dataById.ShippingNo    = WebUtils.GetString(this.shippingno.Text);
                    dataById.OrderStatus   = 11;
                    dataById.GoodsSendTime = System.DateTime.Now;
                    strEventContent        = string.Concat(new string[]
                        {
                            "管理员[",
                            base.AccountName,
                            "]已发货,发件方式为:",
                            dataById.ShippingName,
                            "(快递单号:",
                            dataById.ShippingNo,
                            ")"
                        });
                    break;
                }

                case eumOrderAction.SignGoods:
                    dataById.OrderStatus     = 99;
                    dataById.GoodsServedTime = System.DateTime.Now;
                    strEventContent          = "管理员[" + base.AccountName + "]代签收";
                    break;

                case eumOrderAction.Cancel:
                    dataById.OrderStatus = 101;
                    strEventContent      = "管理员[" + base.AccountName + "]关闭了订单";
                    break;
                }
                if (Orders.Update(dataById))
                {
                    System.Collections.Generic.IList <OrderItemInfo> listByOID = OrderItem.GetListByOID(dataById.AutoID);
                    if (eumOrderAction.Cancel == action)
                    {
                        if (listByOID.Count > 0)
                        {
                            foreach (OrderItemInfo current in listByOID)
                            {
                                Orders.ReBackStock(Product.GetDataById(current.ProID), GoodsSpecify.Get(current.ProID, current.GuiGePath), current.Quantity);
                            }
                        }
                    }
                    if (eumOrderAction.SendGoods == action)
                    {
                        UserInfo dataById2 = SinGooCMS.BLL.User.GetDataById(dataById.UserID);
                        this.SendMsgOnFH(dataById, dataById2);
                        this.SendEmailOnFH(dataById, dataById2);
                        this.SendMobileOnFH(dataById, dataById2);
                        new MsgService(SinGooCMS.BLL.User.GetDataById(dataById.UserID)).SendGoodsFH(dataById, dataById.ShippingName, dataById.ShippingNo);
                    }
                    if (eumOrderAction.SignGoods == action)
                    {
                        foreach (OrderItemInfo current in listByOID)
                        {
                            ProductInfo dataById3 = Product.GetDataById(current.ProID);
                            if (dataById3 != null)
                            {
                                AccountDetail.AddIntegral(base.LoginUser, 1, (double)(dataById3.GiveIntegral * current.Quantity), string.Concat(new object[]
                                {
                                    "成功购买商品[",
                                    current.ProName,
                                    "] x ",
                                    current.Quantity,
                                    ",获得赠送积分"
                                }));
                            }
                        }
                    }
                    SinGooCMS.BLL.OrderAction.AddLog(dataById, base.AccountName, strEventContent, @string);
                    base.ClientScript.RegisterClientScriptBlock(base.GetType(), "alertandredirect", "<script>$.dialog.open.origin.location.reload();</script>");
                }
                else
                {
                    base.ShowMsg("Thao tác thất bại");
                }
            }
        }