示例#1
0
    //public void BindGoods()
    //{
    //    SelectGoods.Clear(this.CompID);
    //    SelectGoods.OrderDetail(KeyID, DisID, this.CompID);
    //    DataTable dt = Session["GoodsInfo"] as DataTable;
    //    if (dt != null)
    //    {
    //        this.rpDtl.DataSource = dt;
    //        this.rpDtl.DataBind();
    //    }
    //    else
    //    {
    //        this.rpDtl.DataSource = "";
    //        this.rpDtl.DataBind();
    //    }
    //    SelectGoods.Clear(DisID, this.CompID);
    //}


    //protected void A_AddOrderReturn(object sender, EventArgs e)
    //{
    //    if (order != null)
    //    {
    //        if (!string.IsNullOrEmpty(txtremark.Value.Trim()))
    //        {
    //            if (string.IsNullOrEmpty(Request.QueryString["type"]))
    //            {
    //                Hi.Model.DIS_OrderReturn orderreturn = new Hi.Model.DIS_OrderReturn();
    //                Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetDisID(user.UserName);
    //                orderreturn.CompID = dis.CompID;
    //                orderreturn.DisID = dis.ID;
    //                orderreturn.OrderID = order.ID;
    //                orderreturn.CreateDate = DateTime.Now;
    //                orderreturn.CreateUserID = user.ID;
    //                orderreturn.ReturnContent = txtremark.Value;
    //                orderreturn.ReturnState = (int)Enums.AuditState.未提交;
    //                orderreturn.ts = DateTime.Now;
    //                orderreturn.modifyuser = user.ID;

    //                int orderreturnid = OrderInfoType.ReturnOrderAdd(orderreturn, order.ID);
    //                if (orderreturnid > 0)
    //                {
    //                    Utils.AddSysBusinessLog(this.CompID, "Order", order.ID.ToString(), "申请退货", "");
    //                    Response.Redirect("returnorderinfo.aspx?KeyID=" + order.ID);
    //                }
    //                else
    //                {
    //                    JScript.AlertMsg(this, "退货失败,请稍候再试");
    //                }
    //            }
    //            else if (Request.QueryString["type"].ToString() == "update")
    //            {
    //                Hi.Model.DIS_OrderReturn orderreturn = new Hi.BLL.DIS_OrderReturn().GetModel(KeyID.ToString());
    //                Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetDisID(user.UserName);
    //                orderreturn.CompID = dis.CompID;
    //                orderreturn.DisID = dis.ID;
    //                orderreturn.OrderID = order.ID;
    //                orderreturn.CreateDate = DateTime.Now;
    //                orderreturn.CreateUserID = user.ID;
    //                orderreturn.ReturnContent = txtremark.Value;
    //                orderreturn.ReturnState = (int)Enums.AuditState.未提交;
    //                orderreturn.ts = DateTime.Now;
    //                orderreturn.modifyuser = user.ID;
    //                if (new Hi.BLL.DIS_OrderReturn().Update(orderreturn))
    //                {
    //                    Response.Redirect("returnorderinfo.aspx?KeyID=" + order.ID);
    //                }
    //            }

    //        }
    //        else
    //        {
    //            JScript.AlertMsg(this, "请注明退货原因");
    //        }
    //    }
    //}

    //public int GetGoodsID(string goodsinfoid)
    //{
    //    Hi.Model.BD_GoodsInfo goodsinfo = new Hi.BLL.BD_GoodsInfo().GetModel(int.Parse(goodsinfoid));
    //    return goodsinfo.GoodsID;
    //}

    protected void A_AddOrderReturn(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order order = OrderBll.GetModel(KeyID);
        if (order != null)
        {
            if (order.OState == (int)Enums.OrderState.已到货 && (order.ReturnState == (int)Enums.ReturnState.未退货 || order.ReturnState == (int)Enums.ReturnState.拒绝退货))
            {
                if (string.IsNullOrEmpty(Request.QueryString["type"]))
                {
                    Hi.Model.DIS_OrderReturn orderreturn = new Hi.Model.DIS_OrderReturn();
                    //Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetModel(this.DisID);
                    orderreturn.ReceiptNo     = order.ReceiptNo + SysCode.GetCode("退单", order.ID.ToString());
                    orderreturn.CompID        = this.CompID;
                    orderreturn.DisID         = this.DisID;
                    orderreturn.OrderID       = order.ID;
                    orderreturn.ReturnDate    = DateTime.Now;
                    orderreturn.CreateDate    = DateTime.Now;
                    orderreturn.CreateUserID  = this.UserID;
                    orderreturn.ReturnContent = Common.NoHTML(txtremark.Value);
                    orderreturn.ReturnState   = (int)Enums.AuditState.提交;
                    orderreturn.ts            = DateTime.Now;
                    orderreturn.modifyuser    = this.UserID;

                    int orderreturnid = OrderInfoType.ReturnOrderAdd(orderreturn, order.ID);
                    if (orderreturnid > 0)
                    {
                        order.ts                = DateTime.Now;
                        order.ReturnState       = (int)Enums.ReturnState.申请退货;
                        order.ReturnMoneyDate   = DateTime.Now;
                        order.ReturnMoneyUser   = this.UserName;
                        order.ReturnMoneyUserId = this.UserID;
                        if (new Hi.BLL.DIS_Order().Update(order))
                        {
                            //Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单修改", orderreturn.ReturnContent);
                            ClientScript.RegisterStartupScript(GetType(), "msg", "<script>window.parent.ResurnOrder();</script>");
                        }
                    }
                    else
                    {
                        JScript.AlertMsgOne(this, "退货失败,请稍候再试!", JScript.IconOption.哭脸);
                    }
                }
                else if (Request.QueryString["type"].ToString() == "update")
                {
                    Hi.Model.DIS_OrderReturn orderreturn = new Hi.BLL.DIS_OrderReturn().GetModel(KeyID.ToString());
                    Hi.Model.BD_Distributor  dis         = new Hi.BLL.BD_Distributor().GetModel(DisID);
                    orderreturn.CompID        = dis.CompID;
                    orderreturn.DisID         = dis.ID;
                    orderreturn.OrderID       = order.ID;
                    orderreturn.CreateDate    = DateTime.Now;
                    orderreturn.CreateUserID  = this.UserID;
                    orderreturn.ReturnContent = Common.NoHTML(txtremark.Value);
                    orderreturn.ReturnState   = (int)Enums.AuditState.未提交;
                    orderreturn.ts            = DateTime.Now;
                    orderreturn.modifyuser    = this.UserID;
                    if (new Hi.BLL.DIS_OrderReturn().Update(orderreturn))
                    {
                        Response.Redirect("returnorderinfo.aspx?KeyID=" + Common.DesEncrypt(order.ID.ToString(), Common.EncryptKey));
                    }
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "订单处理中,不能申请退货!", JScript.IconOption.哭脸);
            }
        }
    }
示例#2
0
    //public Hi.Model.SYS_Users user = null;

    //public int KeyID = 0;
    //public int CompID = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        //user = LoginModel.IsLogined(this);
        //if (Request["KeyID"] != null)
        //{
        //    string Id = Common.DesDecrypt(Request["KeyID"].ToString(), Common.EncryptKey);
        //    KeyID = Id.ToInt(0);
        //    CompID = user.CompID;
        //}
        if (KeyID != 0)
        {
            //user = LoginModel.IsLogined(this);
            //if (user != null)
            //{
            if (KeyID != 0)
            {
                if (!Common.PageDisOperable("Order", KeyID, this.DisID))
                {
                    Response.Redirect("../NoOperable.aspx");
                    return;
                }

                order       = new Hi.BLL.DIS_Order().GetModel(KeyID);
                orderreturn = new Hi.BLL.DIS_OrderReturn().GetModel(order.ID.ToString());
                if (orderreturn == null)
                {
                    Response.Redirect("OrderList.aspx");
                }

                ReceiptNo = orderreturn.ReceiptNo;

                ProID    = OrderInfoType.getOrderExt(orderreturn.OrderID, "ProID");
                ProPrice = OrderInfoType.getOrderExt(orderreturn.OrderID, "ProAmount");
                ProIDD   = OrderInfoType.getOrderExt(orderreturn.OrderID, "ProDID");
                ProType  = OrderInfoType.getOrderExt(orderreturn.OrderID, "Protype");

                this.lblTotalPrice.InnerText = order.AuditAmount.ToString("N");

                Hi.Model.SYS_Users disuser = new Hi.BLL.SYS_Users().GetModel(orderreturn.AuditUserID);
                switch (orderreturn.ReturnState)
                {
                case -1: ReturnState = "已拒绝";
                    AuditUserName    = disuser == null ? "" : disuser.TrueName;
                    AuditDate        = orderreturn.AuditDate.ToString("yyyy-MM-dd");
                    AuditRemark      = orderreturn.AuditRemark;
                    A_btn.InnerHtml  = "<a href=\"#\" onclick=\"returnLog();\" class=\"btnBl\"><i class=\"dailyIcon\"></i>日志</a><a href=\"returnorderlist.aspx\" class=\"btnBl\"><i class=\"returnIcon\"></i>返回</a>";
                    //增加修改,取消退货按钮代码,把后面一截拷进去就OK了   <a href=\"returnorderadd.aspx?KeyID="+KeyID+"&type=update\" class=\"btnBl\"><i class=\"editIcon\"></i>修改退货单</a><a href=\"#\" onclick=\"offIcon();\" class=\"btnBl\"><i class=\"offIcon\"></i>取消退货单</a>
                    break;

                case 0: ReturnState = "未提交"; A_btn.InnerHtml = "<a href=\"#\" onclick=\"editIcon();\" class=\"btnOr\"><i class=\"editIcon\"></i>提交退货单</a><a href=\"#\" onclick=\"offIcon();\" class=\"btnBl\"><i class=\"offIcon\"></i>取消退货单</a><a href=\"#\" onclick=\"returnLog();\" class=\"btnBl\"><i class=\"dailyIcon\"></i>日志</a><a href=\"#\" onclick=\"areturn()\" class=\"btnBl\"><i class=\"returnIcon\"></i>返回</a>"; break;

                case 1: ReturnState = "待审核"; A_btn.InnerHtml = "<a href=\"#\" onclick=\"returnLog();\" class=\"btnBl\"><i class=\"dailyIcon\"></i>日志</a><a href=\"ReturnOrderList.aspx\" class=\"btnBl\"><i class=\"returnIcon\"></i>返回</a>"; break;

                case 2: ReturnState = "已退货";
                    AuditUserName   = disuser == null ? "" : disuser.TrueName;
                    AuditDate       = orderreturn.AuditDate.ToString("yyyy-MM-dd");
                    AuditRemark     = orderreturn.AuditRemark;
                    A_btn.InnerHtml = "<a href=\"#\" onclick=\"returnLog();\" class=\"btnBl\"><i class=\"dailyIcon\"></i>日志</a><a href=\"ReturnOrderList.aspx\" class=\"btnBl\"><i class=\"returnIcon\"></i>返回</a>";
                    break;

                case 4: ReturnState = "已退货款";
                    AuditUserName   = disuser == null ? "" : disuser.TrueName;
                    AuditDate       = orderreturn.AuditDate.ToString("yyyy-MM-dd");
                    AuditRemark     = orderreturn.AuditRemark;
                    A_btn.InnerHtml = "<a href=\"#\" onclick=\"returnLog();\" class=\"btnBl\"><i class=\"dailyIcon\"></i>日志</a><a href=\"ReturnOrderList.aspx\" class=\"btnBl\"><i class=\"returnIcon\"></i>返回</a>";
                    break;
                }
                CreateDate    = orderreturn.CreateDate.ToString("yyyy-MM-dd");
                ReturnContent = orderreturn.ReturnContent;
                BindGoods();
            }
            else
            {
                Response.Redirect("orderlist.aspx");
            }
        }
        if (!string.IsNullOrEmpty(Request["OffIcon"]) && Request["OffIcon"].ToString() == "true")
        {
            A_OffIcon(null, null);
        }
        if (!string.IsNullOrEmpty(Request["editIcon"]) && Request["editIcon"].ToString() == "true")
        {
            A_EditIcon(null, null);
        }
        //}
    }
示例#3
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        string type = Request.QueryString["type"] + "";

        if (KeyID != 0)
        {
            if (!Common.PageCompOperable("ReturnOrder", KeyID, CompID))
            {
                Response.Redirect("../../NoOperable.aspx");
                return;
            }

            Hi.Model.DIS_OrderReturn OrderReturnModel = OrderReturnBll.GetModel(KeyID);

            if (OrderReturnModel != null)
            {
                this.lblDisName.InnerText = Common.GetDis(OrderReturnModel.DisID, "DisName");
                this.hidDisId.Value       = OrderReturnModel.DisID.ToString();
                DisId   = OrderReturnModel.DisID;
                OrderId = OrderReturnModel.OrderID;

                Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(OrderId);

                this.lblReceiptNo.InnerText = OrderReturnModel.ReceiptNo;

                this.lblReturnDate.InnerText = OrderReturnModel.ReturnDate == DateTime.MinValue ? "" : OrderReturnModel.ReturnDate.ToString("yyyy-MM-dd");

                this.lblReturnUserID.InnerText = Common.GetUserName(OrderReturnModel.ReturnUserID.ToString().ToInt(0));
                this.lblReturnState.InnerText  = OrderInfoType.ReturnState(OrderReturnModel.ReturnState);
                //this.lblExpress.InnerText = OrderReturnModel.Express;
                //this.lblExpressNo.InnerText = OrderReturnModel.ExpressNo;
                this.lblReturnContent.InnerText = OrderReturnModel.ReturnContent;

                ProID    = OrderInfoType.getOrderExt(OrderReturnModel.OrderID, "ProID");
                ProPrice = OrderInfoType.getOrderExt(OrderReturnModel.OrderID, "ProAmount");
                ProIDD   = OrderInfoType.getOrderExt(OrderReturnModel.OrderID, "ProDID");
                ProType  = OrderInfoType.getOrderExt(OrderReturnModel.OrderID, "Protype");

                //订单信息
                this.lblOState.InnerText   = OrderInfoType.OState(OrderModel.ID);
                this.lblPayState.InnerHtml = OrderInfoType.PayState(OrderModel.PayState);
                if (OrderModel.PayState == (int)Enums.PayState.未支付)
                {
                    this.lblPayState.Attributes.Add("style", "Color:Red");
                }
                else
                {
                    this.lblPayState.Attributes.Add("style", "Color:green");
                }

                this.lblAddType.InnerText = OrderInfoType.AddType(OrderModel.AddType);
                this.lblOtype.InnerText   = OrderInfoType.OType(OrderModel.Otype);
                //订单总价
                this.lblTotalPrice.InnerText = OrderInfoType.getOrder(OrderReturnModel.OrderID, "AuditAmount");


                if (OrderReturnModel.AuditUserID == 0)
                {
                    this.trAuditUser.Attributes.Add("style", "display:none;");
                    this.trAuditRemark.Attributes.Add("style", "display:none;");
                }
                else
                {
                    this.trAuditUser.Attributes.Add("style", "");
                    this.trAuditRemark.Attributes.Add("style", "");
                }
                this.lblAuditUser.InnerText   = Common.GetUserName(OrderReturnModel.AuditUserID);
                this.lblAuditDate.InnerText   = OrderReturnModel.AuditDate == DateTime.MinValue ? "" : OrderReturnModel.AuditDate.ToString("yyyy-MM-dd");
                this.lblAuditRemark.InnerText = OrderReturnModel.AuditRemark;

                if (this.Erptype != 0)
                {
                    //U8、U9等用户  不能对订单进行操作
                    this.Audit.Visible       = false;
                    this.ReturnMoney.Visible = false;
                }
                else
                {
                    //非U8、U9等用户  可以对订单进行操作
                    #region
                    if (OrderReturnModel.ReturnState < (int)Enums.AuditState.提交)
                    {
                        //this.Audit.Attributes.Add("style", "display:none;");
                        //this.ReturnMoney.Attributes.Add("style", "display:none;");

                        this.Audit.Visible       = false;
                        this.ReturnMoney.Visible = false;
                    }
                    else if (OrderReturnModel.ReturnState == (int)Enums.AuditState.提交)
                    {
                        this.Audit.Visible       = true;
                        this.ReturnMoney.Visible = false;

                        //this.Audit.Attributes.Add("style", "display:inline-block;");
                        //this.ReturnMoney.Attributes.Add("style", "display:none;");
                    }
                    else if (OrderReturnModel.ReturnState == (int)Enums.AuditState.已审)
                    {
                        this.Audit.Visible = false;
                        //this.Audit.Attributes.Add("style", "display:none;");
                        if (OrderModel != null)
                        {
                            if (OrderModel.Otype != (int)Enums.OType.赊销订单)
                            {
                                if (type == "")
                                {
                                    this.ReturnMoney.Visible = false;
                                    //this.ReturnMoney.Attributes.Add("style", "display:none;");
                                }
                                else
                                {
                                    this.ReturnMoney.Visible = true;
                                    //this.ReturnMoney.Attributes.Add("style", "display:inline-block;");
                                }
                            }
                            else
                            {
                                if (OrderModel.PayState == (int)Enums.PayState.已支付)
                                {
                                    if (type == "")
                                    {
                                        this.ReturnMoney.Visible = false;
                                        //this.ReturnMoney.Attributes.Add("style", "display:none;");
                                    }
                                    else
                                    {
                                        this.ReturnMoney.Visible = true;
                                        //this.ReturnMoney.Attributes.Add("style", "display:inline-block;");
                                    }
                                }
                                else
                                {
                                    this.ReturnMoney.Visible = false;
                                    //this.ReturnMoney.Attributes.Add("style", "display:none;");
                                }
                            }
                        }
                    }
                    else if (OrderReturnModel.ReturnState == (int)Enums.AuditState.已完结)
                    {
                        this.Audit.Visible       = false;
                        this.ReturnMoney.Visible = false;
                        //this.Audit.Attributes.Add("style", "display:none;");
                        //this.ReturnMoney.Attributes.Add("style", "display:none;");
                    }
                    #endregion
                }
                BindOrderDetail(OrderReturnModel.OrderID, OrderReturnModel.DisID);
            }
        }
        else
        {
            Response.Write("数据错误!");
            Response.End();
        }
    }
示例#4
0
文件: MsgSend.cs 项目: kkwkk/ybyzt
    /// <summary>
    /// 获取推送类型
    /// </summary>
    /// <returns></returns>
    public static string GetWXType(string sendType, string userID, string orderID)
    {
        string  res       = string.Empty;
        decimal num       = 0;
        string  orderInfo = string.Empty;
        string  orderOut  = String.Empty;

        Hi.Model.DIS_OrderOut         outModel    = null;
        Hi.Model.DIS_OrderReturn      returnModel = null;
        List <Hi.Model.DIS_Logistics> list_log    = null;

        Hi.Model.DIS_Logistics log     = null;
        Hi.BLL.DIS_Logistics   bll_log = new Hi.BLL.DIS_Logistics();

        Hi.Model.SYS_Users user = new Hi.BLL.SYS_Users().GetModel(int.Parse(userID));
        if (user == null || string.IsNullOrEmpty(user.OpenID))
        {
            return("");
        }
        Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(int.Parse(orderID));
        if (order == null)
        {
            return("");
        }
        List <Hi.Model.DIS_OrderDetail> orderList = new Hi.BLL.DIS_OrderDetail().GetList("",
                                                                                         " orderID=" + int.Parse(orderID), "");

        if (orderList == null || orderList.Count == 0)
        {
            return("");
        }
        foreach (Hi.Model.DIS_OrderDetail detail in orderList)
        {
            Hi.Model.BD_GoodsInfo goodsInfo = new Hi.BLL.BD_GoodsInfo().GetModel(detail.GoodsinfoID);
            if (goodsInfo != null)
            {
                Hi.Model.BD_Goods goods = new Hi.BLL.BD_Goods().GetModel(goodsInfo.GoodsID);
                orderInfo += " " + goods.GoodsName + "*" + detail.GoodsNum;
            }
            num += detail.GoodsNum;
        }
        Hi.Model.BD_DisAddr addr = new Hi.BLL.BD_DisAddr().GetModel(order.AddrID);
        if (addr != null)
        {
            if (addr.Phone != "")
            {
                orderOut += addr.Principal + ":" + addr.Phone + " ";
            }
            else
            {
                orderOut += addr.Principal + ":" + addr.Tel + " ";
            }
        }
        List <Hi.Model.DIS_OrderOut> orderout = new Hi.BLL.DIS_OrderOut().GetList("",
                                                                                  " orderID=" + int.Parse(orderID), "");

        if (orderout != null && orderout.Count != 0)
        {
            foreach (Hi.Model.DIS_OrderOut detail in orderout)
            {
                list_log = bll_log.GetList("", "OrderOutID = " + detail.ID + " and isnull(dr,0) == 0", "");
                if (list_log != null && list_log.Count >= 0)
                {
                    log = list_log[0];
                    //orderOut += log.ExpressPerson + ":" + log.ExpressTel + " ";
                }

                outModel = detail;
            }
        }
        List <Hi.Model.DIS_OrderReturn> returnlist = new Hi.BLL.DIS_OrderReturn().GetList("",
                                                                                          " orderID=" + int.Parse(orderID), "");

        if (returnlist != null && returnlist.Count != 0)
        {
            foreach (Hi.Model.DIS_OrderReturn detail in returnlist)
            {
                returnModel = detail;
            }
        }
        //string sqlstr = string.Format("select * from dis_order where receiptno like ('%{0}%') and dr=0", ReceiptNo);

        switch (sendType)
        {
        case "1":     //下单通知
            StringBuilder strSql = new StringBuilder();
            strSql.Append("{\"type\":\"ORDERADD\",\"openid\":\"");
            strSql.Append(user.OpenID);
            strSql.Append("\",\"msg\":[{\"title\":\"尊敬的");
            strSql.Append(user.TrueName);
            strSql.Append(",您好\",\"orderno\":\"");
            strSql.Append(order.ReceiptNo);
            strSql.Append("\",\"orderamount\":\"");
            strSql.Append(order.TotalAmount.ToString("N"));
            strSql.Append("元\",\"extra1\":\"状态:待付款\",\"extra2\":\"数量:");
            strSql.Append(num.ToString("0.00"));
            strSql.Append("\",\"remark\":\"");
            strSql.Append(order.Remark);
            strSql.Append("\"}]}");
            res = strSql.ToString();
            break;

        case "2":     //订单支付通知
            StringBuilder str = new StringBuilder();
            str.Append("{\"type\":\"ORDERPAY\",\"openid\":\"");
            str.Append(user.OpenID);
            str.Append("\",\"msg\":[{\"title\":\"尊敬的");
            str.Append(user.TrueName);
            str.Append(",您好\",\"orderpay\":\"");
            str.Append(order.TotalAmount.ToString("N"));
            str.Append("元\",\"orderinfo\":\"");
            str.Append(orderInfo);
            str.Append("\",\"receiveinfo\":\"");
            str.Append(orderOut);
            str.Append("\",\"orderno\":\"");
            str.Append(order.ReceiptNo);
            str.Append("\",\"remark\":\"");
            str.Append("\"}]}");
            res = str.ToString();
            break;

        case "3":     //42、签收提醒
            StringBuilder SIGN = new StringBuilder();
            SIGN.Append("{\"type\":\"SIGN\",\"openid\":\"");
            SIGN.Append(user.OpenID);
            SIGN.Append("\",\"msg\":[{\"title\":\"您好,您的订单");
            SIGN.Append(order.ReceiptNo);
            SIGN.Append("已签收\",\"orderno\":\"");
            SIGN.Append(order.ReceiptNo);
            SIGN.Append("\",\"qianshouren\":\"");
            SIGN.Append(outModel.SignUser);
            SIGN.Append("\",\"qianshoushijian\":\"");
            SIGN.Append(outModel.SignDate);
            SIGN.Append("\",\"remark\":\"");
            SIGN.Append(order.Remark);
            SIGN.Append("\"}]}");
            res = SIGN.ToString();
            break;

        case "4":     //退货申请
            StringBuilder RETGOODS = new StringBuilder();
            RETGOODS.Append("{\"type\":\"RETGOODS\",\"openid\":\"");
            RETGOODS.Append(user.OpenID);
            RETGOODS.Append("\",\"msg\":[{\"title\":\"买家申请退货");
            RETGOODS.Append("\",\"orderno\":\"");
            RETGOODS.Append(order.ReceiptNo);
            RETGOODS.Append("\",\"shangpinxinxi\":\"");
            RETGOODS.Append(orderInfo);
            RETGOODS.Append("\",\"orderjine\":\"");
            RETGOODS.Append(order.TotalAmount.ToString("N"));
            RETGOODS.Append("元\",\"remark\":\"");
            RETGOODS.Append(order.Remark);
            RETGOODS.Append("\"}]}");
            res = RETGOODS.ToString();
            break;

        case "41":     //代人下单通知
            StringBuilder ORDERADD = new StringBuilder();
            ORDERADD.Append("{\"type\":\"ORDERADD\",\"openid\":\"");
            ORDERADD.Append(user.OpenID);
            ORDERADD.Append("\",\"msg\":[{\"title\":\"尊敬的");
            ORDERADD.Append(user.TrueName);
            ORDERADD.Append(",您好\",\"orderno\":\"");
            ORDERADD.Append(order.ReceiptNo);
            ORDERADD.Append("\",\"orderamount\":\"");
            ORDERADD.Append(order.TotalAmount.ToString("N"));
            ORDERADD.Append("元\",\"extra1\":\"状态:待付款\",\"extra2\":\"数量:");
            ORDERADD.Append(num.ToString());
            ORDERADD.Append("\",\"remark\":\"");
            ORDERADD.Append(order.Remark);
            ORDERADD.Append("\"}]}");
            res = ORDERADD.ToString();
            break;

        case "42":     //订单审批
            StringBuilder sql = new StringBuilder();
            sql.Append("{\"type\":\"ORDERSTATUS\",\"openid\":\"");
            sql.Append(user.OpenID);
            sql.Append("\",\"msg\":[{\"title\":\"尊敬的");
            sql.Append(user.TrueName);
            sql.Append(",您好\",\"orderno\":\"");
            sql.Append(order.ReceiptNo);
            if (order.OState.ToString() == "-1")
            {
                sql.Append("\",\"orderstatus\":\"订单退回\",\"remark\":\"");
            }
            else
            {
                sql.Append("\",\"orderstatus\":\"待发货、审批通过\",\"remark\":\"");
            }
            sql.Append(order.Remark);
            sql.Append("\"}]}");
            res = sql.ToString();
            break;

        case "43":     //订单发货
            StringBuilder sqlSend = new StringBuilder();
            sqlSend.Append("{\"type\":\"ORDERSEND\",\"openid\":\"");
            sqlSend.Append(user.OpenID);
            sqlSend.Append("\",\"msg\":[{\"title\":\"尊敬的");
            sqlSend.Append(user.TrueName);
            sqlSend.Append(",您好\",\"orderno\":\"");
            sqlSend.Append(order.ReceiptNo);
            sqlSend.Append("\",\"wuliuname\":\"");
            sqlSend.Append(log.ComPName);
            sqlSend.Append("\",\"wuliucode\":\"");
            sqlSend.Append(log.LogisticsNo);
            sqlSend.Append("\",\"remark\":\"");
            sqlSend.Append(outModel.Remark);
            sqlSend.Append("\"}]}");
            res = sqlSend.ToString();
            break;

        case "44":     //6、退货审核
            StringBuilder RETAUDIT = new StringBuilder();
            RETAUDIT.Append("{\"type\":\"RETAUDIT\",\"openid\":\"");
            RETAUDIT.Append(user.OpenID);
            RETAUDIT.Append("\",\"msg\":[{\"title\":\"您好,您的退货审核");
            if (returnModel.ReturnState == -1)
            {
                RETAUDIT.Append("已退回");
            }
            else
            {
                RETAUDIT.Append("已审核");
            }
            RETAUDIT.Append("\",\"shenhejieguo\":\"");
            if (returnModel.ReturnState == -1)
            {
                RETAUDIT.Append("已退回");
            }
            else
            {
                RETAUDIT.Append("已审核");
            }
            RETAUDIT.Append("\",\"shangpinxinxi\":\"");
            RETAUDIT.Append(orderInfo);
            RETAUDIT.Append("\",\"tuihuojine\":\"");
            RETAUDIT.Append(order.PayedAmount.ToString("N"));
            RETAUDIT.Append("元\",\"shenheshuoming\":\"");
            RETAUDIT.Append(returnModel.AuditRemark);
            RETAUDIT.Append("\",\"shenheshijian\":\"");
            RETAUDIT.Append(returnModel.AuditDate);
            RETAUDIT.Append("\",\"orderno\":\"");
            RETAUDIT.Append(order.ReceiptNo);
            RETAUDIT.Append("\",\"remark\":\"");
            RETAUDIT.Append("\"}]}");
            res = RETAUDIT.ToString();
            break;

        case "45":     //5、退款
            StringBuilder REFUND = new StringBuilder();
            REFUND.Append("{\"type\":\"REFUND\",\"openid\":\"");
            REFUND.Append(user.OpenID);
            REFUND.Append("\",\"msg\":[{\"title\":\"您好,您的订单");
            REFUND.Append(order.ReceiptNo);
            REFUND.Append(",已退款。\",\"reason\":\"");
            REFUND.Append(returnModel.ReturnContent);
            REFUND.Append("\",\"refund\":\"");
            REFUND.Append(order.PayedAmount.ToString("N"));
            REFUND.Append("元\",\"orderno\":\"");
            REFUND.Append(order.ReceiptNo);
            REFUND.Append("\",\"remark\":\"");
            REFUND.Append("\"}]}");
            res = REFUND.ToString();
            break;
        }
        return(res);
    }
示例#5
0
    /// <summary>
    /// 确认退款
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReturnMoney_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_OrderReturn OrderReturnModel = OrderReturnBll.GetModel(KeyID);

        if (OrderReturnModel != null)
        {
            if (OrderReturnModel.ReturnState == (int)Enums.AuditState.已审)
            {
                Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(OrderReturnModel.OrderID);

                if (OrderModel == null)
                {
                    JScript.AlertMsgOne(this, "订单信息有误!", JScript.IconOption.错误, 2500);
                    return;
                }
                if (OrderModel.OState == (int)Enums.OrderState.退货处理 && OrderModel.ReturnState == (int)Enums.ReturnState.申请退货)
                {
                    OrderModel.OState      = (int)Enums.OrderState.已退货;
                    OrderModel.PayState    = (int)Enums.PayState.已退款;
                    OrderModel.ReturnState = (int)Enums.ReturnState.退货退款;
                    OrderModel.ts          = DateTime.Now;
                    OrderModel.modifyuser  = this.UserID;

                    //OrderReturnModel.ReturnState = (int)Enums.AuditState.已完结;
                    //OrderReturnModel.ts = DateTime.Now;
                    //OrderReturnModel.modifyuser = this.UserID;
                    //退货审确认退款
                    //if (OrderInfoType.ReturnOrderUpdate(OrderReturnModel, OrderModel) > 0)
                    //{

                    #region   把退款金额变为代理商的企业钱包金额
                    int           order  = 0;
                    int           prepay = 0;
                    SqlConnection con    = new SqlConnection(LocalSqlServer);
                    con.Open();
                    SqlTransaction sqlTrans = con.BeginTransaction();

                    Hi.Model.PAY_PrePayment PrepayModel = new Hi.Model.PAY_PrePayment();
                    Hi.BLL.PAY_PrePayment   PrepayBLL   = new Hi.BLL.PAY_PrePayment();
                    PrepayModel.CompID    = OrderModel.CompID;
                    PrepayModel.DisID     = OrderModel.DisID;
                    PrepayModel.OrderID   = OrderModel.ID;
                    PrepayModel.Start     = 1;
                    PrepayModel.PreType   = 4;
                    PrepayModel.price     = OrderModel.PayedAmount; //已支付金额
                    PrepayModel.Paytime   = DateTime.Now;
                    PrepayModel.CrateUser = this.UserID;
                    PrepayModel.CreatDate = DateTime.Now;
                    PrepayModel.OldId     = 0;

                    PrepayModel.AuditState = 2;
                    PrepayModel.IsEnabled  = 1;
                    PrepayModel.AuditUser  = this.UserID;
                    PrepayModel.dr         = 0;
                    PrepayModel.ts         = DateTime.Now;

                    try
                    {
                        order  = new Hi.BLL.DIS_Order().UpdateOrderByggh(con, OrderModel, sqlTrans, KeyID, (int)Enums.AuditState.已完结);
                        prepay = new Hi.BLL.PAY_PrePayment().InsertPrepay(con, PrepayModel, sqlTrans);
                        sqlTrans.Commit();
                    }
                    catch
                    {
                        order  = 0;
                        prepay = 0;
                        sqlTrans.Rollback();
                    }
                    finally
                    {
                        con.Close();
                    }
                    #endregion

                    if (prepay > 0 && order > 0)
                    {
                        //代理商手机号
                        string Phone = Common.GetDis(OrderModel.DisID, "Phone");
                        string msg   = "您的订单:" + OrderModel.ReceiptNo + "退货金额已退回您的企业钱包账户,请查收![ " + Common.GetCompValue(CompID, "CompName") + "]";
                        //退款向代理商推送信息提示
                        Common.GetPhone(Phone, msg);

                        Utils.AddSysBusinessLog(this.CompID, "Order", OrderReturnModel.OrderID.ToString(), "退货退款确认", "");
                    }
                    string type = Request.QueryString["type"] + "";
                    Response.Redirect("OrderReturnInfo.aspx?KeyID=" + Common.DesEncrypt(this.KeyID.ToString(), Common.EncryptKey) + "&go=2&type=" + type);

                    //Bind();
                    //Response.Write("<script language=\"javascript\">window.parent.AuditReturn(" + KeyID + ");</script>");
                    //}
                }
                else
                {
                    JScript.AlertMsgOne(this, "订单信息有误!", JScript.IconOption.错误, 2500);
                    return;
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "订单状态有误!", JScript.IconOption.错误, 2500);
                return;
            }
        }
    }
示例#6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.DIS_OrderReturn model)
 {
     return(dal.Update(model));
 }
示例#7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.DIS_OrderReturn model)
 {
     return(dal.Add(model));
 }
示例#8
0
    /// <summary>
    /// 审核通过
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_OrderReturn OrderReturnModel = OrderReturnBll.GetModel(KeyID);

        string AuditUserID = string.Empty;
        string AuditDate   = string.Empty;
        string AuditRemark = string.Empty;
        int    pay         = 0;

        if (!string.IsNullOrEmpty(this.hidAuditUserID.Value))
        {
            AuditUserID = this.hidAuditUserID.Value.Trim().ToString();
        }
        //if (!string.IsNullOrEmpty(this.txtArriveDate.Value.Trim().ToString()))
        //{
        //    AuditDate = this.txtArriveDate.Value.Trim().ToString();
        //}
        if (!string.IsNullOrEmpty(this.lblArriveDate.InnerText.Trim().ToString()))
        {
            AuditDate = this.lblArriveDate.InnerText.Trim().ToString();
        }
        if (!string.IsNullOrEmpty(this.txtRemark.Value.Trim().ToString()))
        {
            AuditRemark = this.txtRemark.Value.Trim().ToString();
        }

        if (OrderReturnModel != null)
        {
            //判断退货单状态是否正确
            if (OrderReturnModel.ReturnState == (int)Enums.AuditState.提交)
            {
                Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(OrderReturnModel.OrderID);

                if (OrderModel == null)
                {
                    JScript.AlertMsgOne(this, "订单信息有误!不能通过审核", JScript.IconOption.错误, 2500);
                    return;
                }
                int    State       = 0;
                string StateRemark = string.Empty;
                string LogRemark   = string.Empty;

                StateRemark = "退货审核通过";

                //订单支付状态
                pay       = OrderModel.PayState;
                LogRemark = "退货退款:" + OrderModel.PayedAmount.ToString("N");

                //判断订单状态是否正确
                if ((OrderModel.OState == (int)Enums.OrderState.已发货 || OrderModel.OState == (int)Enums.OrderState.已到货) && OrderModel.ReturnState == (int)Enums.ReturnState.申请退货)
                {
                    if (OrderModel.PayState == (int)Enums.PayState.已支付 || pay == (int)Enums.PayState.部分支付)
                    {
                        //订单已支付退货退款
                        //State = (int)Enums.AuditState.已审;
                        State                  = (int)Enums.AuditState.已完结;
                        OrderModel.OState      = (int)Enums.OrderState.已退货;
                        OrderModel.PayState    = (int)Enums.PayState.已退款;
                        OrderModel.ReturnState = (int)Enums.ReturnState.退货退款;
                    }
                    else
                    {
                        //订单未支付退货
                        OrderModel.OState = (int)Enums.OrderState.已退货;
                        State             = (int)Enums.AuditState.已完结;
                    }

                    #region
                    //if (OrderModel.Otype == (int)Enums.OType.赊销订单)
                    //{
                    //if (OrderModel.PayState == (int)Enums.PayState.已支付 || pay == (int)Enums.PayState.部分支付 || OrderModel.PayState == (int)Enums.PayState.已结算)
                    //{
                    //    //订单已支付退货退款
                    //    //State = (int)Enums.AuditState.已审;
                    //    State = (int)Enums.AuditState.已完结;
                    //    OrderModel.OState = (int)Enums.OrderState.已退货;
                    //    OrderModel.PayState = (int)Enums.PayState.已退款;
                    //    OrderModel.ReturnState = (int)Enums.ReturnState.退货退款;
                    //}
                    //else
                    //{
                    //    //订单未支付退货
                    //    OrderModel.OState = (int)Enums.OrderState.已退货;
                    //    State = (int)Enums.AuditState.已审;
                    //}
                    //}
                    //else
                    //{
                    //    //OrderModel.OState = (int)Enums.OrderState.退货处理;
                    //    //State = (int)Enums.AuditState.已审;
                    //    if (OrderModel.PayState == (int)Enums.PayState.已支付 || pay == (int)Enums.PayState.部分支付 || OrderModel.PayState == (int)Enums.PayState.已结算)
                    //    {
                    //        OrderModel.OState = (int)Enums.OrderState.已退货;
                    //        OrderModel.PayState = (int)Enums.PayState.已退款;
                    //        OrderModel.ReturnState = (int)Enums.ReturnState.退货退款;

                    //        State = (int)Enums.AuditState.已完结;
                    //    }
                    //    else
                    //    {
                    //        OrderModel.OState = (int)Enums.OrderState.已退货;
                    //        State = (int)Enums.AuditState.已审;
                    //    }
                    //}
                    #endregion
                    OrderModel.ts         = DateTime.Now;
                    OrderModel.modifyuser = this.UserID;

                    OrderReturnModel.AuditUserID = AuditUserID.ToInt(0);
                    OrderReturnModel.AuditDate   = AuditDate.ToDateTime();
                    OrderReturnModel.AuditRemark = AuditRemark;
                    OrderReturnModel.ReturnState = State;
                    OrderReturnModel.ts          = DateTime.Now;
                    OrderReturnModel.modifyuser  = this.UserID;


                    #region   把退款金额变为代理商的企业钱包金额
                    int           order  = 0;
                    int           prepay = 0;
                    SqlConnection con    = new SqlConnection(LocalSqlServer);
                    con.Open();
                    SqlTransaction sqlTrans = con.BeginTransaction();

                    Hi.Model.PAY_PrePayment PrepayModel = new Hi.Model.PAY_PrePayment();
                    Hi.BLL.PAY_PrePayment   PrepayBLL   = new Hi.BLL.PAY_PrePayment();
                    PrepayModel.CompID    = OrderModel.CompID;
                    PrepayModel.DisID     = OrderModel.DisID;
                    PrepayModel.OrderID   = OrderModel.ID;
                    PrepayModel.Start     = 1;
                    PrepayModel.PreType   = 4;
                    PrepayModel.price     = OrderModel.PayedAmount; //已支付金额
                    PrepayModel.Paytime   = DateTime.Now;
                    PrepayModel.CrateUser = this.UserID;
                    PrepayModel.CreatDate = DateTime.Now;
                    PrepayModel.OldId     = 0;

                    PrepayModel.AuditState = 2;
                    PrepayModel.IsEnabled  = 1;
                    PrepayModel.AuditUser  = this.UserID;
                    PrepayModel.dr         = 0;
                    PrepayModel.ts         = DateTime.Now;
                    PrepayModel.guid       = Common.Number_repeat("");

                    try
                    {
                        //order = new Hi.BLL.DIS_Order().UpdateOrderByggh(con, OrderModel, sqlTrans, KeyID, (int)Enums.AuditState.已完结);
                        order = OrderInfoType.ReturnOrderUpdate(con, sqlTrans, OrderReturnModel, OrderModel);

                        //if (OrderModel.Otype == (int)Enums.OType.赊销订单)
                        //{
                        //    //支付的订单 生成企业钱包
                        //    if (pay == (int)Enums.PayState.已支付||pay == (int)Enums.PayState.部分支付|| pay == (int)Enums.PayState.已结算)
                        //    {
                        //        prepay = new Hi.BLL.PAY_PrePayment().InsertPrepay(con, PrepayModel, sqlTrans);
                        //    }
                        //    else
                        //    {
                        //        //未支付的订单 不生成企业钱包
                        //        prepay = 1;
                        //    }
                        //}
                        //else
                        //{
                        if (pay == (int)Enums.PayState.已支付 || pay == (int)Enums.PayState.部分支付)
                        {
                            //支付的订单 生成企业钱包
                            prepay = new Hi.BLL.PAY_PrePayment().InsertPrepay(con, PrepayModel, sqlTrans);

                            //退款减积分
                            OrderInfoType.AddIntegral(CompID, OrderModel.DisID, "1", 2, OrderModel.ID, OrderModel.PayedAmount, "订单退款", "", this.UserID);
                        }
                        else
                        {
                            //未支付的订单 不生成企业钱包
                            prepay = 1;
                        }
                        //}

                        sqlTrans.Commit();
                    }
                    catch
                    {
                        order  = 0;
                        prepay = 0;
                        sqlTrans.Rollback();
                    }
                    finally
                    {
                        con.Close();
                    }
                    #endregion

                    if (prepay > 0 && order > 0)
                    {
                        if (OrderInfoType.rdoOrderAudit("订单下单数量是否取整", this.CompID) == "0")
                        {
                            //退货审核通过,返还商品库存
                            string sql = new Hi.BLL.DIS_Order().GetSqlAddInve(OrderModel.ID, null, 0);
                            new Hi.BLL.DIS_Order().UpdateOrderState(sql);
                        }

                        if (pay == (int)Enums.PayState.未支付)
                        {
                            // type : "4":订单发货通知;"3":订单状态变更通知(待发货、审批通过);"2":订单支付通知;"1":下单通知
                            new Common().GetWxService("44", OrderReturnModel.OrderID.ToString(), "0");

                            //代理商手机号
                            string Phone = Common.GetDis(OrderModel.DisID, "Phone");
                            string msg   = "您的订单:" + OrderModel.ReceiptNo + "退货申请已通过!";
                            //退款向代理商推送信息提示
                            Common.GetPhone(Phone, msg);
                        }
                        else
                        {
                            //type : "4":订单发货通知;"3":订单状态变更通知(待发货、审批通过);"2":订单支付通知;"1":下单通知
                            new Common().GetWxService("44", OrderReturnModel.OrderID.ToString(), "0");
                            new Common().GetWxService("45", OrderReturnModel.OrderID.ToString(), "0");

                            //代理商手机号
                            string Phone = Common.GetDis(OrderModel.DisID, "Phone");
                            string msg   = "您的订单:" + OrderModel.ReceiptNo + "退货金额已退回您的企业钱包账户,请查收!";
                            //退款向代理商推送信息提示
                            Common.GetPhone(Phone, msg);
                        }

                        Utils.AddSysBusinessLog(this.CompID, "Order", OrderReturnModel.OrderID.ToString(), StateRemark, LogRemark);

                        Response.Write("<script language=\"javascript\">window.parent.AuditReturn('" + Common.DesEncrypt(this.KeyID.ToString(), Common.EncryptKey) + "');</script>");
                    }
                }
                else
                {
                    JScript.AlertMsgOne(this, "订单信息有误!不能通过审核!", JScript.IconOption.错误, 2500);
                    return;
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "数据状态不正确,不能进行审核!", JScript.IconOption.错误, 2500);
            }
        }
        else
        {
            JScript.AlertMsgOne(this, "数据不存在!", JScript.IconOption.错误, 2500);
        }
    }
示例#9
0
    /// <summary>
    /// 退回
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReturn_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_OrderReturn OrderReturnModel = OrderReturnBll.GetModel(KeyID);

        string AuditUserID = string.Empty;
        string AuditDate   = string.Empty;
        string AuditRemark = string.Empty;

        if (!string.IsNullOrEmpty(this.hidAuditUserID.Value))
        {
            AuditUserID = this.hidAuditUserID.Value.Trim().ToString();
        }
        if (!string.IsNullOrEmpty(this.lblArriveDate.InnerText.Trim().ToString()))
        {
            AuditDate = this.lblArriveDate.InnerText.Trim().ToString();
        }
        if (!string.IsNullOrEmpty(this.txtRemark.Value.Trim().ToString()))
        {
            AuditRemark = this.txtRemark.Value.Trim().ToString();
        }

        if (OrderReturnModel != null)
        {
            if (OrderReturnModel.ReturnState == (int)Enums.AuditState.提交)
            {
                Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(OrderReturnModel.OrderID);

                if (OrderModel == null)
                {
                    JScript.AlertMsgOne(this, "订单信息有误!", JScript.IconOption.错误, 2500);
                    return;
                }
                OrderModel.ReturnState = (int)Enums.ReturnState.拒绝退货;
                OrderModel.modifyuser  = this.UserID;

                int    State       = 0;
                string StateRemark = string.Empty;

                State       = (int)Enums.AuditState.退回;
                StateRemark = "退货审核退回";

                OrderReturnModel.AuditUserID = AuditUserID.ToInt(0);
                OrderReturnModel.AuditDate   = AuditDate.ToDateTime();
                OrderReturnModel.AuditRemark = AuditRemark;
                OrderReturnModel.ReturnState = State;
                OrderReturnModel.ts          = DateTime.Now;
                OrderReturnModel.modifyuser  = this.UserID;

                //退货审核通过时  修改订单退货状态:0
                if (OrderInfoType.ReturnOrderUpdate(OrderReturnModel, OrderModel) > 0)
                {
                    Utils.AddSysBusinessLog(this.CompID, "Order", OrderReturnModel.OrderID.ToString(), StateRemark, AuditRemark);

                    //type : "4":订单发货通知;"3":订单状态变更通知(待发货、审批通过);"2":订单支付通知;"1":下单通知
                    //string JSon="{"type":"1","userID":"1027","orderID":"1030"}";
                    new Common().GetWxService("44", OrderReturnModel.OrderID.ToString(), "0");

                    Response.Write("<script language=\"javascript\">window.parent.AuditReturn('" + Common.DesEncrypt(this.KeyID.ToString(), Common.EncryptKey) + "');</script>");
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "数据状态不正确,不能进行审核!", JScript.IconOption.错误, 2500);
            }
        }
        else
        {
            JScript.AlertMsgOne(this, "数据不存在!", JScript.IconOption.错误, 2500);
        }
    }