Ejemplo n.º 1
0
    /// <summary>
    /// 保存
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

        try
        {
            string BillNo = this.txtBillNo.Value.Trim();
            string IsBill = this.rdoIsBillOk.Checked ? "1" : "0";

            if (OrderModel != null)
            {
                //if (OrderModel.IsBill == 0)
                //{
                //    OrderModel.BillNo = BillNo;
                //    OrderModel.IsBill = IsBill.ToInt(0);

                //    if (OrderBll.Update(OrderModel))
                //    {
                //        Response.Write("<script language=\"javascript\">window.parent.Audit('" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey) + "');</script>");
                //    }
                //}
                //else
                //    JScript.AlertMsgOne(this, "发票信息已完成,不能再保存!", JScript.IconOption.错误, 2500);
            }
            else
            {
                JScript.AlertMsgOne(this, "数据不存在!", JScript.IconOption.错误, 2500);
            }
        }
        catch (Exception ex)
        {
            JScript.AlertMsgOne(this, "保存失败!", JScript.IconOption.错误, 2500);
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 签收
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSing_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

        if (OrderModel.OState == (int)Enums.OrderState.已发货 && OrderModel.ReturnState == (int)Enums.ReturnState.未退货)
        {
            Hi.Model.DIS_OrderOut OutModel = new Hi.BLL.DIS_OrderOut().GetOutModel(KeyID);

            OutModel.SignDate   = DateTime.Now;
            OutModel.SignRemark = "";
            OutModel.SignUser   = Common.GetUserName(this.UserID);
            OutModel.SignUserId = this.UserID;
            OutModel.IsSign     = 1;
            OutModel.ts         = DateTime.Now;
            OutModel.modifyuser = this.UserID;

            if (OrderInfoType.SignOrder(OutModel, OrderModel) > 0)
            {
                Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单签收", "");
                new Common().GetWxService("3", KeyID.ToString(), "1");
                if (!string.IsNullOrEmpty(Request["type1"]) && Request["type1"].ToString() == "ReceivingList")
                {
                    Response.Redirect("receivinglist.aspx");
                }
                Response.Redirect("neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
                //Bind();
            }
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 退回
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReturn_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Id"] != null)
        {
            Id = Convert.ToInt32(Request.QueryString["Id"]);
        }

        Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(Id);

        if (OrderInfoModel != null)
        {
            if (OrderInfoModel.OState > (int)Enums.OrderState.未提交)
            {
                string sql = " update [DIS_Order] set [OState]=" + (int)Enums.OrderState.退回 + " where ID=" + Id;

                if (OrderInfoBll.UpdateOrderState(sql))
                {
                    //Utils.AddSysBusinessLog(this.CompID, "Order", Id.ToString(), "退回", "");
                    Bind();
                }
            }
        }
        else
        {
            JScript.ShowAlert(this, "数据不存在!");
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 审核
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAudit_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(KeyID);

        if (OrderInfoModel != null)
        {
            if (OrderInfoModel.OState == (int)Enums.OrderState.待审核)
            {
                string sql = " update [DIS_Order] set [OState]=" + (int)Enums.OrderState.已审 + " where ID=" + KeyID;
                if (OrderInfoBll.UpdateOrderState(sql))
                {
                    Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "审核通过", "");
                    Bind();
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "数据状态不正确,不能进行审核!", JScript.IconOption.错误, 2500);
            }
        }
        else
        {
            JScript.AlertMsgOne(this, "数据不存在", JScript.IconOption.错误, 2500);
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 签收
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public void btnSing_Click(int KeyID)
    {
        Hi.BLL.DIS_Order   OrderBll   = new Hi.BLL.DIS_Order();
        Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

        if (OrderModel.OState == (int)Enums.OrderState.已发货 && OrderModel.ReturnState == (int)Enums.ReturnState.未退货)
        {
            Hi.Model.DIS_OrderOut OutModel = new Hi.BLL.DIS_OrderOut().GetOutModel(KeyID);

            OutModel.SignDate   = DateTime.Now;
            OutModel.SignRemark = "";
            OutModel.SignUser   = this.UserName;
            OutModel.SignUserId = this.UserID;
            OutModel.IsSign     = 1;
            OutModel.ts         = DateTime.Now;
            OutModel.modifyuser = this.UserID;

            if (OrderInfoType.SignOrder(OutModel, OrderModel) > 0)
            {
                Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单签收", "");
                new Common().GetWxService("3", KeyID.ToString(), "1");
                string str = "\"str\":true";
                str = "{" + str + "}";
                Response.Write(str);
                Response.End();
                //Bind();
            }
        }
    }
Ejemplo n.º 6
0
    protected void rptOrder_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string type = e.CommandName;

        Id = Convert.ToInt32(e.CommandArgument);

        if (type == "del")
        {
            Hi.Model.DIS_Order OrderInfoModel = OrderInfoBLL.GetModel(Id);

            if (OrderInfoModel != null)
            {
                if (OrderInfoModel.OState == (int)Enums.OrderState.退回 || OrderInfoModel.OState == (int)Enums.OrderState.未提交)
                {
                    OrderInfoModel.dr = 1;
                    bool falg = OrderInfoBLL.OrderDel(OrderInfoModel);
                    if (falg)
                    {
                        //JScript.ShowAlert(this, "");
                        Bind();
                    }
                }
                else
                {
                    JScript.AlertMsgOne(this, "订单处理中,不能删除!", JScript.IconOption.错误);
                }
            }
        }
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hid_start.Value = Request.QueryString["start"] + "";
            int state = Convert.ToInt32(Request.QueryString["start"]);
            if (state == 2 || state == 0)
            {
                btnSave.Text = "发货";
            }
            else if (state == 1)
            {
                btnSave.Text = "销账";
            }

            Hi.Model.DIS_Order OrdModel = new Hi.Model.DIS_Order();
            OrdModel = new Hi.BLL.DIS_Order().GetModel(KeyID);

            this.txtdisname.InnerText         = new Hi.BLL.BD_Distributor().GetModel(OrdModel.DisID).DisName;
            this.hidDisId.Value               = OrdModel.DisID.ToString();
            this.txtordercode.InnerText       = OrdModel.ReceiptNo;
            this.hidordid.Value               = OrdModel.ID.ToString();
            this.txtPayCorrectPrice.InnerText = (OrdModel.AuditAmount - OrdModel.PayedAmount).ToString("0.00");
            this.hidCompId.Value              = this.CompID.ToString();

            //Bind();
        }
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["KeyID"] == "")
        {
            KeyID = 0;
        }
        else
        {
            KeyID = Common.DesDecrypt(Request.QueryString["KeyID"], Common.EncryptKey).ToInt(0);
        }

        Cmpid = this.CompID;


        if (!Common.PageDisOperable("Order", KeyID, this.DisID))
        {
            Response.Redirect("../../NoOperable.aspx", true);
            return;
        }
        if (!IsPostBack)
        {
            Bind();                             //绑定
            orderModel = new Hi.BLL.DIS_Order().GetModel(KeyID);
            BindPaySettings(orderModel.CompID); //给页面隐藏域赋值
        }
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

            if (OrderModel != null)
            {
                //this.txtBillNo.Value = OrderModel.BillNo;
                //if (OrderModel.IsBill == 1)
                //{
                //    this.txtBillNo.Attributes["readonly"] = "readonly";
                //    this.rdoIsBillNo.Attributes["disabled"] = "true";
                //    this.rdoIsBillOk.Attributes["disabled"] = "true";

                //    this.rdoIsBillOk.Checked = true;
                //    this.rdoIsBillNo.Checked = false;
                //    this.Save.Visible = false;
                //}
                //else
                //{
                //    this.rdoIsBillOk.Checked = false;
                //    this.rdoIsBillNo.Checked = true;
                //}
            }
        }
    }
Ejemplo n.º 10
0
    protected void Bind()
    {
        this.txtDisUser.InnerText = Common.GetUserName(this.UserID);
        this.hidDisUserId.Value   = this.UserID.ToString();
        if (KeyID != 0)
        {
            if (!Common.PageCompOperable("Order", KeyID, CompID))
            {
                Response.Redirect("../../NoOperable.aspx");
                return;
            }

            Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(KeyID);

            if (OrderInfoModel != null)
            {
                string js = "<script language=javascript>history.go(-1);</script>";
                //编辑订单时 判断订单状态
                if (OrderInfoModel.AddType == (int)Enums.AddType.企业补单 || OrderInfoModel.AddType == (int)Enums.AddType.App企业补单)
                {
                    //企业补单
                    if (OrderInfoModel.OState >= (int)Enums.OrderState.已审 && OrderInfoModel.PayState != (int)Enums.PayState.未支付)
                    {
                        HttpContext.Current.Response.Write(string.Format(js));
                    }
                }
                else
                {
                    //App下单 网页下单
                    if (OrderInfoModel.OState >= (int)Enums.OrderState.待审核)
                    {
                        HttpContext.Current.Response.Write(string.Format(js));
                    }
                }

                this.lblReceiptNo.InnerText = OrderInfoModel.ReceiptNo;

                DisId = OrderInfoModel.DisID;
                this.hidTotalAmount.Value = OrderInfoModel.TotalAmount.ToString("N");
                this.txtArriveDate.Value  = OrderInfoModel.ArriveDate == DateTime.MinValue ? "" : OrderInfoModel.ArriveDate.ToString("yyyy-MM-dd");
                this.txtDisUser.InnerText = Common.GetUserName(OrderInfoModel.DisUserID);
                this.hidDisUserId.Value   = OrderInfoModel.DisUserID.ToString();


                this.txtRemark.Value = OrderInfoModel.Remark;
            }
        }
        else
        {
            //清除商品数据
            SelectGoods.Clear();
        }
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 菜单操作
    /// </summary>
    /// <param name="Oid"></param>
    /// <param name="PageIndex"></param>
    /// <returns></returns>
    public string OrderMeau(string Oid)
    {
        string Str_Meau = "";

        Oid = Server.UrlDecode(Oid);
        string id = Common.DesDecrypt(Oid, Common.EncryptKey);

        if (id == "")
        {
            return("");
        }

        Hi.Model.DIS_Order OrderModel = OrderInfoBLL.GetModel(id.ToString().ToInt(0));

        if (OrderModel != null)
        {
            if (this.Erptype == 0)
            {
                //非U8、U9等用户  可以对订单进行操作
                if (OrderModel.OState == (int)Enums.OrderState.待审核)
                {
                    //if (Common.HasRight(this.CompID,this.UserID, "1012"))
                    //Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' onclick='return RegionAudit(\"" + Server.UrlEncode(Oid) + "\")'>审核</a>";
                    Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' href='../newOrder/orderdetail.aspx?top=1&KeyID=" + Server.UrlEncode(Oid) + "'>详情</a>";
                }
                //else if (OrderModel.OState == (int)Enums.OrderState.已发货){ }
                else if (OrderModel.OState == (int)Enums.OrderState.已审 && (OrderModel.PayState == (int)Enums.PayState.已支付 || OrderModel.PayState == (int)Enums.PayState.部分支付 || OrderModel.Otype == (int)Enums.OType.赊销订单) && OrderModel.ReturnState == (int)Enums.ReturnState.未退货)
                {
                    //if (Common.HasRight(this.CompID,this.UserID, "1013"))
                    //Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' onclick='return ship(\"" + Server.UrlEncode(Oid) + "\"," + OrderInfoType.JuOrder(id.ToInt(0)) + ")'>发货</a>";
                    Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' href='../newOrder/orderdetail.aspx?top=1&KeyID=" + Server.UrlEncode(Oid) + "'>详情</a>";
                }
                else if ((OrderModel.OState == (int)Enums.OrderState.已审) && (OrderModel.Otype != (int)Enums.OType.赊销订单 || OrderModel.PayState == (int)Enums.PayState.未支付) && OrderModel.ReturnState == (int)Enums.ReturnState.未退货)
                {
                    Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' href='../newOrder/orderdetail.aspx?top=1&KeyID=" + Server.UrlEncode(Oid) + "'>详情</a>";
                }
                else
                {
                    Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' href='../newOrder/orderdetail.aspx?top=1&KeyID=" + Server.UrlEncode(Oid) + "'>详情</a>";
                }
            }
            else
            {
                //U8、U9等用户  不能对订单进行操作
                Str_Meau += "<a class='tablelinkQx' style='cursor: pointer;' href='../newOrder/orderdetail.aspx?top=1&KeyID=" + Server.UrlEncode(Oid) + "'>详情</a>";
            }
        }

        return(Str_Meau);
    }
Ejemplo n.º 12
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    public void Bind()
    {
        if (KeyID != 0)
        {
            if (!Common.PageCompOperable("Order", KeyID, CompID))
            {
                Response.Redirect("../../NoOperable.aspx");
                return;
            }

            Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

            if (OrderModel != null)
            {
                DisID = OrderModel.DisID;

                this.PrintDate.InnerText    = DateTime.Now.ToString("yyyy年MM月dd日");
                this.lblReceiptNo.InnerText = OrderModel.ReceiptNo;
                this.lblDisName.InnerText   = Common.GetDis(OrderModel.DisID, "DisName");

                this.lblCreateDate.InnerText = OrderModel.CreateDate == DateTime.MinValue ? "" : OrderModel.CreateDate.ToString("yyyy-MM-dd");
                this.lblDisUser.InnerText    = Common.GetUserName(OrderModel.DisUserID);

                this.lblOtype.InnerText      = OrderInfoType.OType(OrderModel.Otype);
                this.lblTotalPrice.InnerText = OrderModel.AuditAmount.ToString("N");

                this.lblPayState.InnerText = OrderInfoType.PayState(OrderModel.PayState);
                this.lblPayPrice.InnerText = OrderModel.PayedAmount.ToString("N");
                if (OrderModel.PayState == (int)Enums.PayState.未支付)
                {
                    this.lblPayState.Attributes.Add("style", "Color:Red");
                }
                else
                {
                    this.lblPayState.Attributes.Add("style", "Color:green");
                }


                this.lblAddr.InnerText   = Common.GetAddr(OrderModel.AddrID);
                this.lblRemark.InnerText = OrderModel.Remark;

                BindOrderDetail(DisID);
            }
        }
    }
Ejemplo n.º 13
0
    public static string Edit(string KeyID, string type, string remark)
    {
        remark = Common.NoHTML(remark);
        Common.ResultMessage Msg = new Common.ResultMessage();

        if (type == "0")
        {
            Hi.BLL.DIS_Order OrderBll = new Hi.BLL.DIS_Order();
            int oID = Common.DesDecrypt(KeyID, Common.EncryptKey).ToInt(0);
            Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(oID);
            if (OrderModel != null)
            {
                OrderModel.Remark = Common.NoHTML(remark);
                OrderModel.ts     = DateTime.Now;
                if (OrderBll.Update(OrderModel))
                {
                    Msg.result = true;
                    Msg.code   = OrderModel.ts.ToString("yyyy-MM-dd HH:mm");
                }
            }
            else
            {
                Msg.code = "未查找到数据";
            }
        }
        else if (type == "1")
        {
            Hi.BLL.DIS_OrderDetail   OrderBllDetail   = new Hi.BLL.DIS_OrderDetail();
            Hi.Model.DIS_OrderDetail OrderModelDetail = OrderBllDetail.GetModel(KeyID.ToInt(0));
            if (OrderModelDetail != null)
            {
                OrderModelDetail.Remark = Common.NoHTML(remark);
                OrderModelDetail.ts     = DateTime.Now;
                if (OrderBllDetail.Update(OrderModelDetail))
                {
                    Msg.result = true;
                }
            }
        }
        else
        {
            Msg.result = true;
        }
        return(new JavaScriptSerializer().Serialize(Msg));
    }
Ejemplo n.º 14
0
    public static string Edit(string KeyID, string type, string tip)
    {
        Common.ResultMessage Msg        = new Common.ResultMessage();
        Hi.BLL.DIS_Order     OrderBll   = new Hi.BLL.DIS_Order();
        Hi.Model.DIS_Order   OrderModel = OrderBll.GetModel(Common.DesDecrypt(KeyID, Common.EncryptKey).ToInt(0));
        if (OrderModel != null)
        {
            if (OrderModel.OState == -1 || OrderModel.OState == 0 || OrderModel.OState == 1 || OrderModel.OState == 2)
            {
                if (type == "0")
                {
                    if (tip != "")
                    {
                        OrderModel.ArriveDate = tip.ToDateTime();
                    }
                    else
                    {
                        OrderModel.ArriveDate = DateTime.MinValue;
                    }
                    OrderModel.ts = DateTime.Now;
                    if (OrderBll.Update(OrderModel))
                    {
                        Msg.result = true;
                    }
                }

                else
                {
                    OrderModel.GiveMode = tip;
                    OrderModel.ts       = DateTime.Now;
                    if (OrderBll.Update(OrderModel))
                    {
                        Msg.result = true;
                    }
                }
            }
        }
        else
        {
            Msg.code = "未查找到数据";
        }
        return(new JavaScriptSerializer().Serialize(Msg));
    }
Ejemplo n.º 15
0
 public void rptOrder_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
     {
         Hi.Model.DIS_Order drv = (Hi.Model.DIS_Order)e.Item.DataItem;
         ta += Convert.ToDecimal(drv.AuditAmount);
         tb += Convert.ToDecimal(drv.PayedAmount);
     }
     if (e.Item.ItemType == ListItemType.Footer)
     {
         if (e.Item.FindControl("total1") != null)
         {
             Label tol1 = (Label)e.Item.FindControl("total1");
             tol1.Text = string.Format("{0}", ta.ToString("N"));
         }
         if (e.Item.FindControl("total2") != null)
         {
             Label tol2 = (Label)e.Item.FindControl("total2");
             tol2.Text = string.Format("{0}", tb.ToString("N"));
         }
     }
 }
Ejemplo n.º 16
0
    /// <summary>
    /// 取消订单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnOff_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order OrderModel = OrderBll.GetModel(KeyID);

        if (OrderModel != null)
        {
            if ((OrderModel.OState == (int)Enums.OrderState.已审 || OrderModel.OState == (int)Enums.OrderState.待审核) && OrderModel.PayState == (int)Enums.PayState.未支付)
            {
                string sql = " update [DIS_Order] set [OState]=" + (int)Enums.OrderState.已作废 + " where ID=" + KeyID;

                if (OrderBll.UpdateOrderState(sql))
                {
                    Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单作废", "");
                    //Bind();
                    Response.Redirect("neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "数据状态不正确,无法取消!", JScript.IconOption.错误);
            }
        }
    }
Ejemplo n.º 17
0
    /// <summary>
    /// 提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Id"] != null)
        {
            Id = Convert.ToInt32(Request.QueryString["Id"]);
        }

        Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(Id);

        if (OrderInfoModel != null)
        {
            if (OrderInfoModel.OState == (int)Enums.OrderState.未提交 || OrderInfoModel.OState == (int)Enums.OrderState.退回)
            {
                int OState = 1;
                if (OrderInfoModel.IsAudit == 1)
                {
                    //无需审核
                    OState = (int)Enums.OrderState.已审;
                }
                string sql = " update [DIS_Order] set [OState]=" + OState + " where ID=" + Id;

                if (OrderInfoBll.UpdateOrderState(sql))
                {
                    //Utils.AddSysBusinessLog(this.CompID, "Order", Id.ToString(), "提交", "");
                    Bind();
                }
            }
            else
            {
                JScript.ShowAlert(this, "数据状态不正确,不能进行审核!");
            }
        }
        else
        {
            JScript.ShowAlert(this, "数据不存在!");
        }
    }
Ejemplo n.º 18
0
    /// <summary>
    /// 删除
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDel_Click(object sender, EventArgs e)
    {
        Hi.Model.DIS_Order OrderInfoModel = OrderBll.GetModel(KeyID);

        if (OrderInfoModel != null)
        {
            bool del = false;
            //if (OrderInfoModel.AddType == (int)Enums.AddType.企业补单)
            //{
            //    if (OrderInfoModel.OState == (int)Enums.OrderState.已提交)
            //        del = true;
            //}
            //else
            //{
            //}
            //判断订单状态是否能删除
            if (OrderInfoModel.OState == (int)Enums.OrderState.退回 || OrderInfoModel.OState == (int)Enums.OrderState.已作废 || OrderInfoModel.OState == (int)Enums.OrderState.未提交)
            {
                del = true;
            }
            if (del)
            {
                OrderInfoModel.dr = 1;
                bool falg = OrderBll.OrderDel(OrderInfoModel);
                if (falg)
                {
                    Utils.AddSysBusinessLog(this.CompID, "Order", KeyID.ToString(), "订单删除", "");
                    //JScript.AlertMsg(this, "订单删除成功!", "OrderList.aspx");
                    ClientScript.RegisterStartupScript(this.GetType(), "del", "<script>window.location.href = 'OrderList.aspx'</script>");
                }
            }
            else
            {
                JScript.AlertMsgOne(this, "订单处理中,不能删除!", JScript.IconOption.错误);
            }
        }
    }
Ejemplo n.º 19
0
    /// <summary>
    /// 获取推送用户的别名
    /// </summary>
    /// <param name="order"></param>
    /// <param name="userType">0:推送给经销商 1:推送给企业</param>
    /// <returns></returns>
    public string[] GetUserAlias(Hi.Model.DIS_Order order, string userType)
    {
        List <Hi.Model.SYS_CompUser> userList = new List <Hi.Model.SYS_CompUser>();

        switch (userType.Trim())
        {
        case "0":
            userList = new Hi.BLL.SYS_CompUser().GetList("",
                                                         " compID='" + order.CompID + "' and IsAudit = 2 and disID='" + order.DisID + "' and dr=0 and IsEnabled=1 and (Utype=1 or Utype =5)", "");
            break;

        case "1":
            userList = new Hi.BLL.SYS_CompUser().GetList("",
                                                         " compID='" + order.CompID + "' and IsAudit = 2 and dr=0 and IsEnabled=1 and Utype between 3 and 4", "");
            break;

        case "2":
            userList = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and IsAudit = 2 and IsEnabled=1 and Utype in (1,3,4,5)", "");
            break;

        default:
            return(null);
        }

        if (userList == null || userList.Count == 0)
        {
            return(null);
        }

        string[] arr = new String[userList.Count];
        for (int i = 0; i < userList.Count; i++)
        {
            arr[i] = AESHelper.Encrypt_MD5(userList[i].ID.ToString());
        }
        return(arr);
    }
Ejemplo n.º 20
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.哭脸);
            }
        }
    }
Ejemplo n.º 21
0
    /// <summary>
    /// 获取推送内容
    /// </summary>
    /// <param name="user"></param>
    /// <param name="order"></param>
    /// <param name="sendType"></param>
    /// <returns></returns>
    public string GetAlertContent(Hi.Model.DIS_Order order, string sendType)
    {
        string res = string.Empty;

        switch (sendType)
        {
        case "1":     //下单通知
            StringBuilder strSql = new StringBuilder();
            strSql.Append("您有一条新的订单消息。");


            //strSql.Append("您好,您有一条新的订单(");
            //strSql.Append(order.ReceiptNo);
            //strSql.Append(")。");
            res = strSql.ToString();
            break;

        case "2":     //订单支付通知
            StringBuilder str = new StringBuilder();
            if (order.Otype == 9)
            {
                str.Append("您收到一笔账单付款。");
            }
            else
            {
                str.Append("您收到一笔订单付款。");
            }

            //str.Append("您好,您有一条订单(");
            //str.Append(order.ReceiptNo);
            //str.Append(")已支付。");
            res = str.ToString();
            break;

        case "3":     //签收提醒
            StringBuilder SIGN = new StringBuilder();
            //SIGN.Append("您好,您有一条订单(");
            //SIGN.Append(order.ReceiptNo);
            //SIGN.Append(")已签收。");
            SIGN.Append("您有一张订单已签收。");
            res = SIGN.ToString();
            break;

        case "4":     //退货申请
            StringBuilder RETGOODS = new StringBuilder();
            //RETGOODS.Append("您好,您有一条订单(");
            //RETGOODS.Append(order.ReceiptNo);
            //RETGOODS.Append(")申请退货。");
            RETGOODS.Append("您有一张订单申请退货。");
            res = RETGOODS.ToString();
            break;

        case "5":    //经销商修改订单
            StringBuilder UPDATEORDER = new StringBuilder();
            UPDATEORDER.Append("您有一张订单已更新。");
            res = UPDATEORDER.ToString();
            break;

        case "41":     //代人下单通知
            StringBuilder ORDERADD = new StringBuilder();
            //ORDERADD.Append("您好,您有一条新的订单(");
            //ORDERADD.Append(order.ReceiptNo);
            //ORDERADD.Append(")。");
            ORDERADD.Append("核心企业代您生成一条新的订单。");
            res = ORDERADD.ToString();
            break;

        case "42":     //订单审批
            StringBuilder sql = new StringBuilder();
            //sql.Append("您好,您有一条订单(");
            //sql.Append(order.ReceiptNo);
            //sql.Append(")已审批。");
            sql.Append("您有一张订单已审核。");
            res = sql.ToString();
            break;

        case "43":     //订单发货
            StringBuilder sqlSend = new StringBuilder();
            //sqlSend.Append("您好,您有一条订单(");
            //sqlSend.Append(order.ReceiptNo);
            //sqlSend.Append(")已发货。");
            sqlSend.Append("您有一张订单已发货。");
            res = sqlSend.ToString();
            break;

        case "44":     //退货审核
            StringBuilder RETAUDIT = new StringBuilder();
            //RETAUDIT.Append("您好,您有一条退货订单(");
            //RETAUDIT.Append(order.ReceiptNo);
            //RETAUDIT.Append(")已审核。");
            RETAUDIT.Append("您的退货申请已审核");
            res = RETAUDIT.ToString();
            break;

        case "45":     //退款
            StringBuilder REFUND = new StringBuilder();
            //REFUND.Append("您好,您有一条订单(");
            StringBuilder COMUPDATEORDER = new StringBuilder();
            COMUPDATEORDER.Append("您有一张订单已更新。");
            res = COMUPDATEORDER.ToString();
            break;

        case "46":    //经销商修改订单
            StringBuilder UPDATEORDER_comp = new StringBuilder();
            UPDATEORDER_comp.Append("您有一张订单已更新。");
            res = UPDATEORDER_comp.ToString();
            break;
        }
        return(res);
    }
Ejemplo n.º 22
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.DIS_Order model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 23
0
    /// <summary>
    /// 生成订单
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string  ReceiptNo   = string.Empty;
        string  Otype       = string.Empty;
        string  ArriveDate  = string.Empty;
        decimal TotalAmount = 0;
        decimal OtherAmount = 0;
        string  DisUser     = string.Empty;
        string  DisUserId   = string.Empty;
        string  LogRemark   = string.Empty; //日志备注

        string Remark = string.Empty;
        string str    = string.Empty;

        if (this.DisListID.Disid == "")
        {
            str += " - 代理商不能为空。\\r\\n";
        }
        if (this.txtunit.Value == "")
        {
            str += " - 费用名称不能为空。\\r\\n";
        }
        if (this.txtOtherAmount.Value.ToDecimal(0) <= 0)
        {
            str += " - 账单金额不能为0。\\r\\n";
        }

        if (this.txtRemark.Value != "")
        {
            Remark = Common.NoHTML(this.txtRemark.Value.Trim().ToString());
            if (Remark.Length > 400)
            {
                str += " - 账单备注不能大于400个字符。\\r\\n";
            }
        }

        if (str != "")
        {
            JScript.AlertMsgOne(this, str, JScript.IconOption.错误, 2500);
            return;
        }

        try
        {
            Hi.Model.DIS_Order OrderInfoModel = null;
            DisId = Convert.ToInt32(this.DisListID.Disid);

            decimal Amount = Convert.ToDecimal(this.txtOtherAmount.Value);
            TotalAmount = Amount;

            if (this.txtArriveDate.Value.Trim() != "")
            {
                ArriveDate = Common.NoHTML(this.txtArriveDate.Value.Trim().ToString());
            }
            else
            {
                ArriveDate = DateTime.MinValue.ToString();
            }
            DisUser   = Common.NoHTML(this.txtDisUser.InnerText.Trim().ToString());
            DisUserId = Common.NoHTML(this.hidDisUserId.Value.Trim().ToString());

            OrderInfoModel = OrderInfoBll.GetModel(KeyID);

            LogRemark += " 账单总价:" + Amount.ToString("N");



            #region 新增订单

            //新增订单
            String guid = Guid.NewGuid().ToString().Replace("-", "");

            ReceiptNo = SysCode.GetZD_NewCode("账单", 1);

            OrderInfoModel = new Hi.Model.DIS_Order();

            OrderInfoModel.GUID      = guid;
            OrderInfoModel.CompID    = this.CompID;
            OrderInfoModel.DisID     = DisId;
            OrderInfoModel.ReceiptNo = ReceiptNo;


            int OState = 1;

            //无需审核
            OState = (int)Enums.OrderState.已审;
            OrderInfoModel.IsAudit = 1;

            OrderInfoModel.OState       = OState;
            OrderInfoModel.Remark       = Remark;
            OrderInfoModel.CreateUserID = this.UserID;
            OrderInfoModel.CreateDate   = DateTime.Now;

            //总价
            OrderInfoModel.TotalAmount = TotalAmount;
            OrderInfoModel.AuditAmount = TotalAmount;
            OrderInfoModel.OtherAmount = OtherAmount;

            OrderInfoModel.ArriveDate = ArriveDate.ToDateTime();
            OrderInfoModel.DisUserID  = DisUserId.ToInt(0);

            OrderInfoModel.Otype   = (int)Enums.OType.推送账单;
            OrderInfoModel.AddType = (int)Enums.AddType.网页下单;

            OrderInfoModel.ts = DateTime.Now;
            //OrderInfoModel.vdef9 = "0";

            OrderInfoModel.vdef2 = this.txtunit.Value.Trim();//费用科目



            int OrderId = new Hi.BLL.DIS_Order().Add(OrderInfoModel);

            if (OrderId > 0)
            {
                Utils.AddSysBusinessLog(this.CompID, "Order", OrderId.ToString(), "账单新增", LogRemark);

                //代理商手机号
                string Phone = Common.GetDis(DisId, "Phone");
                string msg   = "您的账单:" + ReceiptNo + "已经生成," + this.txtunit.Value.Trim() + ":" + TotalAmount + "元,请尽快完成付款![ " + Common.GetCompValue(CompID, "CompName") + " ]";

                //账单推送向代理商推送信息提示
                Common.GetPhone(Phone, msg);

                string Id = Common.DesEncrypt(OrderId.ToString(), Common.EncryptKey);

                ClientScript.RegisterStartupScript(this.GetType(), "add", "<script>window.location.href ='OrderZdtsInfo.aspx?KeyID=" + Id + "';</script>");
            }

            #endregion
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Ejemplo n.º 24
0
    /// <summary>
    /// 新增订单
    /// </summary>
    /// <param name="OrderInfoModel"></param>
    /// <param name="OrderDetailList"></param>
    /// <returns></returns>
    public static int TansOrder(Hi.Model.DIS_Order OrderInfoModel, Hi.Model.DIS_OrderExt OrderExt, List <Hi.Model.DIS_OrderDetail> OrderDetailList)
    {
        int OrderId    = 0;
        int OrderExtId = 0;

        System.Text.StringBuilder sqlInven = new System.Text.StringBuilder();
        int IsInve = rdoOrderAudit("商品是否启用库存", OrderInfoModel.CompID).ToInt(0);

        SqlTransaction sqlTrans = DBUtility.SqlHelper.CreateStoreTranSaction();

        //可以做循环
        try
        {
            OrderId = OrderBll.AddOrder(sqlTrans.Connection, OrderInfoModel, sqlTrans);
            if (OrderId == 0)
            {
                OrderId = 0;
                sqlTrans.Rollback();
                return(OrderId);
            }
            OrderExt.OrderID = OrderId;
            OrderExtId       = OrderExtBll.Add(sqlTrans.Connection, OrderExt, sqlTrans);
            if (OrderExtId == 0)
            {
                OrderId = 0;
                sqlTrans.Rollback();
                return(OrderId);
            }
            if (OrderDetailList.Count <= 0)
            {
                OrderId = 0;
                sqlTrans.Rollback();
            }
            else
            {
                foreach (Hi.Model.DIS_OrderDetail item in OrderDetailList)
                {
                    item.OrderID = OrderId;
                    int count = OrderDetailBll.AddOrderDetail(sqlTrans.Connection, item, sqlTrans);
                    if (count == 0)
                    {
                        OrderId = 0;
                        sqlTrans.Rollback();
                    }
                }
                if (IsInve == 0)
                {
                    //新增订单,减商品库存
                    sqlInven.AppendFormat(new Hi.BLL.DIS_Order().GetSqlInventory("", OrderDetailList));
                    if (new Hi.BLL.DIS_OrderDetail().GetUpdateInventory(sqlInven.ToString(), sqlTrans.Connection, sqlTrans) <= 0)
                    {
                        OrderId = 0;
                        //sqlTrans.Rollback();
                    }
                }

                if (rdoOrderAudit("订单支付返利是否启用", OrderInfoModel.CompID) == "1")
                {
                    //订单支付返利启用
                    if (OrderInfoModel.bateAmount > 0)
                    {
                        //使用返利大于0;
                        if (bate.TransRebate(OrderInfoModel.DisID, OrderInfoModel.bateAmount, OrderId, OrderInfoModel.CreateUserID, sqlTrans))
                        {
                            sqlTrans.Commit();
                            return(OrderId);
                        }
                        else
                        {
                            sqlTrans.Rollback();
                            OrderId = 0;
                            return(OrderId);
                        }
                    }
                }
                sqlTrans.Commit();
            }
        }
        catch
        {
            OrderId = 0;
            sqlTrans.Rollback();
        }
        finally
        {
            //sqlTrans.Connection.Close();
        }

        return(OrderId);
    }
Ejemplo n.º 25
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.DIS_Order model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (KeyID != 0)
        {
            if (!Common.PageDisOperable("Order", KeyID, this.DisID))
            {
                Response.Redirect("../NoOperable.aspx");
                return;
            }

            order = OrderBll.GetModel(KeyID);
            if (order != null)
            {
                //receiptno = order.ReceiptNo;
                //DisID = order.DisID;
                //Otype = OrderInfoType.OType(order.Otype);
                //if (user != null)
                //{
                //    //UserID = user.ID;
                //    //CompID = user.CompID;
                //    //DisID = user.DisID;

                //    //DisUser = new Hi.BLL.SYS_Users().GetModel(order.DisUserID);
                //    //if (DisUser != null)
                //    //{
                //    //    truename = DisUser.UserName;
                //    //    BindGoods();
                //    //}

                //}
                //else
                //{
                //    Response.Redirect("orderlist.aspx");
                //}
            }
            else
            {
                Response.Redirect("orderlist.aspx");
            }
            //    if (Request["KeyID"] != null)
            //    {
            //        KeyID = int.Parse(Request["KeyID"]);
            //    }
            //    if (KeyID != 0)
            //    {
            //        order = OrderBll.GetModel(KeyID);
            //        if (order != null)
            //        {
            //            Otype = OrderInfoType.OType(order.Otype);

            //            if (user != null)
            //            {
            //                truename = user.TrueName;
            //                BindGoods();
            //            }

            //        }
            //        else
            //        {
            //            Response.Redirect("orderlist.aspx");
            //        }
            //    }
            //    else
            //    {
            //        Response.Redirect("orderlist.aspx");
            //    }
        }
    }
Ejemplo n.º 27
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);
        }
        //}
    }
Ejemplo n.º 28
0
    /// <summary>
    /// 订单支付
    /// </summary>
    /// <param name="orderid">订单ID</param>
    /// <param name="txtPayOrder">支付金额</param>
    /// <param name="price">企业钱包金额</param>
    /// <param name="yfk">预付款</param>
    /// <param name="payPas"></param>
    public Wxpay_Url PayOrder(int orderid, decimal txtPayOrder, decimal price, int yfk, string payPas)
    {
        //使用企业钱包

        OrderModel = new Hi.BLL.DIS_Order().GetModel(orderid);
        disModel   = new Hi.BLL.BD_Distributor().GetModel(OrderModel.DisID);



        #region  界面上显示
        this.lblOrderNO.InnerText = OrderModel.ReceiptNo.Trim().ToString();
        this.fee.InnerText        = this.CompName;//收款方
        // this.lblOrderNO.HRef = "../neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(orderid.ToString(), Common.EncryptKey);
        #endregion 界面上显示


        #region 企业钱包支付 begin

        if (disModel == null)
        {
            ErrMessage("数据异常,代理商有误", orderid.ToString());
        }

        decimal sumPrice = new Hi.BLL.PAY_PrePayment().sums(disModel.ID, disModel.CompID); //剩余企业钱包
        int     disid    = OrderModel.DisID;                                               //代理商ID
        string  password = disModel.Paypwd;

        if (yfk == 1)
        {
            if (payPas == null || payPas.Trim().ToString() == "")
            {
                ErrMessage("企业钱包密码不能为空", orderid.ToString());
            }
            payPas = payPas.Trim().ToString();
            if (password == Util.md5("123456"))
            {
                ErrMessage("请先修改企业钱包支付密码", orderid.ToString());
            }
            else
            {
                if (payPas == "")
                {
                    ErrMessage("密码不能为空", orderid.ToString());
                }
            }
        }

        decimal payPrice = 0;//支付金额
        if (txtPayOrder == 0)
        {
            ErrMessage("支付金额不能为0", orderid.ToString());
        }
        if (yfk == 1 && txtPayOrder < price)
        {
            ErrMessage("使用企业钱包大于支付金额!", orderid.ToString());
        }
        if (yfk == 1)
        {
            payPrice = txtPayOrder - price;
        }
        else
        {
            payPrice = txtPayOrder;
        }


        if (txtPayOrder > OrderModel.AuditAmount + OrderModel.OtherAmount - OrderModel.PayedAmount)
        {
            ErrMessage("支付金额大于未支付金额,不能支付!", orderid.ToString());
        }
        if (!((
                  (OrderModel.Otype == (int)Enums.OType.赊销订单 && (OrderModel.OState != (int)Enums.OrderState.退回 && OrderModel.OState != (int)Enums.OrderState.未提交 && OrderModel.OState != (int)Enums.OrderState.待审核) && (OrderModel.PayState == (int)Enums.PayState.未支付 || OrderModel.PayState == (int)Enums.PayState.部分支付)) ||
                  (OrderModel.Otype != (int)Enums.OType.赊销订单 && OrderModel.Otype != (int)Enums.OType.推送账单 && (OrderModel.OState == (int)Enums.OrderState.已审 || OrderModel.OState == (int)Enums.OrderState.已发货 || OrderModel.OState == (int)Enums.OrderState.已到货) && (OrderModel.PayState == (int)Enums.PayState.未支付 || OrderModel.PayState == (int)Enums.PayState.部分支付)) ||
                  (OrderModel.Otype == (int)Enums.OType.推送账单 && OrderModel.OState == (int)Enums.OrderState.已审 && (OrderModel.PayState == (int)Enums.PayState.部分支付 || OrderModel.PayState == (int)Enums.PayState.未支付))
                  ) &&
              OrderModel.OState != (int)Enums.OrderState.已作废))
        {
            if (OrderModel.Otype == (int)Enums.OType.推送账单)
            {
                ErrMessage("账单异常,不能支付", orderid.ToString());
            }
            else
            {
                ErrMessage("订单异常,不能支付", orderid.ToString());
            }
        }

        if (yfk == 1 && price > 0)
        {
            //企业钱包处理
            if (sumPrice < price)
            {
                ErrMessage("企业钱包余额不足", orderid.ToString());
            }
            if (disModel.Paypwd != Util.md5(payPas))
            {
                ErrMessage("支付密码不正确", orderid.ToString());
            }
            Hi.Model.PAY_PrePayment prepayModel = new Hi.Model.PAY_PrePayment();
            prepayModel.CompID     = disModel.CompID;
            prepayModel.DisID      = disModel.ID;
            prepayModel.OrderID    = OrderModel.ID;
            prepayModel.Start      = 2;
            prepayModel.PreType    = 5;
            prepayModel.price      = price * -1;
            prepayModel.Paytime    = DateTime.Now;
            prepayModel.CreatDate  = DateTime.Now;
            prepayModel.CrateUser  = this.UserID;
            prepayModel.AuditState = 2;
            prepayModel.IsEnabled  = 1;
            prepayModel.ts         = DateTime.Now;
            prepayModel.modifyuser = this.UserID;
            prepayModel.guid       = Common.Number_repeat(Guid.NewGuid().ToString().Replace("-", ""));
            // prepayModel.vdef1 = "订单支付";
            prepayid = new Hi.BLL.PAY_PrePayment().Add(prepayModel);
            int prepay = 0;
            int order  = 0;
            if (prepayid > 0 && payPrice == 0)//payPrice(网银支付金额)= 0 ,只用企业钱包支付,修改状态
            {
                SqlConnection con = new SqlConnection(LocalSqlServer);
                con.Open();
                SqlTransaction sqlTrans = con.BeginTransaction();
                try
                {
                    prepay = new Hi.BLL.PAY_PrePayment().updatePrepayState(con, prepayid, sqlTrans);        //修改企业钱包状态
                    order  = new Hi.BLL.DIS_Order().UpdateOrderPstate(con, OrderModel.ID, price, sqlTrans); //修改订单状态
                    if (prepay > 0 && order > 0)
                    {
                        sqlTrans.Commit();
                    }
                    else
                    {
                        sqlTrans.Rollback();
                    }
                }
                catch
                {
                    prepay = 0;
                    order  = 0;
                    sqlTrans.Rollback();
                }
                finally
                {
                    con.Close();
                }
                if (prepay > 0 && order > 0)
                {
                    try
                    {
                        if (OrderModel.Otype == (int)Enums.OType.推送账单)
                        {
                            Utils.AddSysBusinessLog(disModel.CompID, "Order", OrderModel.ID.ToString(), "账单支付", "支付:" + price.ToString("0.00") + "元(企业钱包支付)", this.UserID.ToString());
                        }
                        else
                        {
                            Utils.AddSysBusinessLog(disModel.CompID, "Order", OrderModel.ID.ToString(), "订单支付", "支付:" + price + "元(企业钱包支付)", this.UserID.ToString());
                        }
                        if (OrderModel.Otype != 9)
                        {
                            OrderInfoType.AddIntegral(this.CompID, this.DisID, "1", 1, OrderModel.ID, price, "订单支付", "", this.UserID);
                        }
                        new Common().GetWxService("2", OrderModel.ID.ToString(), "1", price);
                    }
                    catch (Exception ex)
                    {
                        ErrMessage("支付失败", orderid.ToString());
                    }

                    if (OrderModel.Otype == (int)Enums.OType.推送账单)
                    {
                        Response.Redirect("PaySuccess.aspx?type=" + Common.DesEncrypt("2", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(OrderModel.ID.ToString(), Common.EncryptKey) + "&Pid=" + Common.DesEncrypt("0".ToString(), Common.EncryptKey) + "&PPid=" + Common.DesEncrypt(prepayid.ToString(), Common.EncryptKey) + "&IsRef=Y", false);
                    }
                    else
                    {
                        Response.Redirect("PaySuccess.aspx?type=" + Common.DesEncrypt("1", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(OrderModel.ID.ToString(), Common.EncryptKey) + "&Pid=" + Common.DesEncrypt("0".ToString(), Common.EncryptKey) + "&PPid=" + Common.DesEncrypt(prepayid.ToString(), Common.EncryptKey) + "&IsRef=Y", false);
                    }
                }
            }
        }

        #endregion



        #region  插入支付表记录

        Hi.Model.PAY_Payment payModel = new Hi.Model.PAY_Payment();
        string orderNo = WebConfigurationManager.AppSettings["OrgCode"] + DateTime.Now.ToString("yyyyMMdd");//支付订单号前半部分

        string guid = Guid.NewGuid().ToString().Replace("-", "");
        payModel.OrderID      = OrderModel.ID; // orderid;
        payModel.DisID        = this.DisID;
        payModel.Type         = 0;             // isDBPay;
        payModel.PayUser      = disModel.DisName;
        payModel.PayPrice     = payPrice;
        payModel.IsAudit      = 2;
        payModel.guid         = Common.Number_repeat(guid);
        payModel.vdef3        = "1"; //1,订单支付,2,预付款充值、汇款
        payModel.vdef4        = orderNo;
        payModel.CreateDate   = DateTime.Now;
        payModel.CreateUserID = this.UserID;
        payModel.ts           = DateTime.Now;
        payModel.modifyuser   = this.UserID;
        payModel.PrintNum     = 1; //支付宝支付无需结算
        //判断账户类型,判断支付渠道
        payModel.Channel = "7";    //1,快捷支付,2,银联支付 ,3,网银支付,4,B2B网银支付,5,线下支付,6,支付宝支付 7,微信支付
        payModel.State   = 0;      //手续费收取方
        payModel.vdef5   = "0.00"; //支付手续费
        payid            = new Hi.BLL.PAY_Payment().Add(payModel);

        if (prepayid > 0)
        {
            Hi.Model.PAY_PrePayment prepayMent = new Hi.BLL.PAY_PrePayment().GetModel(prepayid);
            prepayMent.vdef4 = payid.ToString();//与企业钱包关联
            new Hi.BLL.PAY_PrePayment().Update(prepayMent);
        }

        Hi.Model.PAY_RegisterLog regModel = new Hi.Model.PAY_RegisterLog();
        regModel.OrderId    = OrderModel.ID;// orderid;
        regModel.Ordercode  = orderNo + payid.ToString();
        regModel.number     = payModel.guid;
        regModel.Price      = payPrice;
        regModel.Payuse     = "订单支付";
        regModel.PayName    = disModel.DisName;
        regModel.DisID      = OrderModel.DisID;
        regModel.PayTime    = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
        regModel.Remark     = OrderModel.Remark;// orderModel.Remark;
        regModel.DisName    = new Hi.BLL.BD_Company().GetModel(disModel.CompID).CompName;
        regModel.BankID     = "支付宝支付";
        regModel.CreateUser = this.UserID;
        regModel.CreateDate = DateTime.Now;
        regModel.LogType    = 1311;
        int regid = new Hi.BLL.PAY_RegisterLog().Add(regModel);
        if (payid <= 0 || regid <= 0)
        {
            Response.Redirect("Error.aspx?type=" + Common.DesEncrypt("3", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(Convert.ToString(KeyID), Common.EncryptKey) + "&msg=" + Common.DesEncrypt("支付失败!", Common.EncryptKey), false);
        }

        //订单所有商品明细


        DataTable l = new Hi.BLL.DIS_OrderDetail().GetOrderDe("", " IsNUll(o.dr,0)=0 and o.OrderId=" + orderid);
        foreach (DataRow dr in l.Rows)
        {
            GoodsName += dr["GoodsName"] + ",";
        }
        GoodsName = GoodsName.Substring(0, GoodsName.Length - 1);//去掉最后一个逗号
        if (GoodsName.Length > 15)
        {
            GoodsName = GoodsName.Substring(0, 10) + "...";
        }



        #endregion


        int amount = Convert.ToInt32(payPrice * 100);//支付金额(单位:分)

        //隐藏域赋值
        this.hidguid.Value  = payModel.guid;
        this.hidprice.Value = payPrice.ToString();
        this.hidordid.Value = payModel.OrderID.ToString();
        this.hidpid.Value   = payid.ToString();
        this.hidppid.Value  = prepayid.ToString();

        // btnWxPay_Click(payModel.guid, orderid.ToString(), amount);

        Wxpay_Url wxpaymodel = new Wxpay_Url();
        wxpaymodel.Guid    = payModel.guid;
        wxpaymodel.OrderID = orderid.ToString();
        wxpaymodel.Amount  = amount;


        wxpaymodel.Hidguid  = payModel.guid;
        wxpaymodel.Hidprice = payModel.PayPrice.ToString();
        wxpaymodel.Hidordid = payModel.OrderID.ToString();
        wxpaymodel.Hidpid   = payid.ToString();
        wxpaymodel.Hidppid  = prepayid.ToString();

        return(wxpaymodel);
    }
Ejemplo n.º 29
0
    /// <summary>
    /// 修改订单
    /// </summary>
    /// <param name="OrderInfoModel"></param>
    /// <param name="OrderDetailList"></param>
    /// <returns></returns>
    public static int UpdateOrder(DateTime dts, Hi.Model.DIS_Order OrderInfoModel, Hi.Model.DIS_OrderExt OrderExt, List <Hi.Model.DIS_OrderDetail> OrderDetailList, string delOrderD)
    {
        //判断订单时间
        if (new Hi.BLL.DIS_Order().Getts("Dis_Order", OrderInfoModel.ID, dts) == 0)
        {
            return(-1);
        }

        int OrderId = 0;

        //返回修改库存的sql
        System.Text.StringBuilder sqlInven = new System.Text.StringBuilder();
        int IsInve = OrderInfoType.rdoOrderAudit("商品是否启用库存", OrderInfoModel.CompID).ToInt(0);

        if (IsInve == 0)
        {
            //修改商品库存,先返还订单明细删除的商品库存
            sqlInven.AppendFormat(new Hi.BLL.DIS_Order().GetSqlInventory(delOrderD, OrderDetailList));
        }

        //SqlConnection con = new SqlConnection(LocalSqlServer);
        //con.Open();
        //System.Data.IsolationLevel.RepeatableRead
        SqlTransaction sqlTrans = DBUtility.SqlHelper.CreateStoreTranSaction();

        //可以做循环

        try
        {
            //private object thislock = OrderInfoModel.ID as object;
            //lock (thislock)
            //{
            OrderId = OrderBll.UpdateOrder(sqlTrans.Connection, OrderInfoModel, sqlTrans);
            if (OrderDetailList.Count <= 0)
            {
                OrderId = 0;
                sqlTrans.Rollback();
            }
            else
            {
                if (OrderExt != null)
                {
                    //修改订单扩展表
                    if (!OrderExtBll.Update(sqlTrans.Connection, OrderExt, sqlTrans))
                    {
                        OrderId = 0;
                        sqlTrans.Rollback();
                    }
                }

                if (!delOrderD.Equals(""))
                {
                    //修改时 删除商品后 清除在数据库中存在的该商品
                    if (OrderDetailBll.GetDel(delOrderD, sqlTrans.Connection, sqlTrans) < 0)
                    {
                        OrderId = 0;
                        sqlTrans.Rollback();
                    }
                }

                foreach (Hi.Model.DIS_OrderDetail item in OrderDetailList)
                {
                    Hi.Model.DIS_OrderDetail OrderDeModel = OrderDetailBll.GetModel(item.ID);
                    int count = 0;
                    if (OrderDeModel != null)
                    {
                        if (IsInve == 0)
                        {
                            //修改订单明细时,先返还商品库存
                            sqlInven.AppendFormat("update BD_GoodsInfo set Inventory+={0} where ID={1};", OrderDeModel.GoodsNum + Convert.ToDecimal(OrderDeModel.ProNum), OrderDeModel.GoodsinfoID);
                        }

                        item.OrderID = OrderInfoModel.ID;
                        //修改订单时,订单明细里存在该商品 修改商品信息
                        count = OrderDetailBll.UpdateOrderDetail(sqlTrans.Connection, item, sqlTrans);
                        if (count == 0)
                        {
                            OrderId = 0;
                            sqlTrans.Rollback();
                        }
                    }
                    else
                    {
                        //修改订单时,订单明细里不存在该商品新增商品信息
                        item.OrderID = OrderInfoModel.ID;
                        count        = OrderDetailBll.AddOrderDetail(sqlTrans.Connection, item, sqlTrans);
                        if (count == 0)
                        {
                            OrderId = 0;
                            sqlTrans.Rollback();
                        }
                    }
                }
                if (IsInve == 0)
                {
                    //修改商品库存,先返还订单明细删除的商品库存
                    //sqlInven.AppendFormat(new Hi.BLL.DIS_Order().GetSqlInventory(delOrderD,  OrderDetailList));
                    if (new Hi.BLL.DIS_OrderDetail().GetUpdateInventory(sqlInven.ToString(), sqlTrans.Connection, sqlTrans) <= 0)
                    {
                        OrderId = 0;
                        sqlTrans.Rollback();
                    }
                }

                if (OrderInfoType.rdoOrderAudit("订单支付返利是否启用", OrderInfoModel.CompID) == "1")
                {
                    //订单支付返利启用
                    if (bate.TransEditRebate(OrderInfoModel.DisID, OrderInfoModel.bateAmount, OrderInfoModel.ID, OrderInfoModel.CreateUserID, sqlTrans))
                    {
                        sqlTrans.Commit();
                        return(OrderId);
                    }
                }
                sqlTrans.Commit();
            }
            //}
        }
        catch
        {
            OrderId = 0;
            sqlTrans.Rollback();
        }
        finally
        {
        }

        return(OrderId);
    }
Ejemplo n.º 30
0
    public void Bind()
    {
        orderModel = new Hi.BLL.DIS_Order().GetModel(KeyID);
        // 订单检查
        if (orderModel == null)
        {
            //if (orderModel.Otype == (int)Enums.OType.推送账单)
            //    JScript.AlertMethod(this, "无效的账单!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderDzfzdList.aspx") + "'); }");
            //else
            JScript.AlertMethod(this, "无效的订单!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderPayList.aspx") + "'); }");
            //this.lblPayError.InnerText = "无效的订单!";
            return;
        }

        // 状态检查
        if (!(
                (
                    (orderModel.Otype == (int)Enums.OType.销售订单 && (orderModel.OState == (int)Enums.OrderState.已审 || orderModel.OState == (int)Enums.OrderState.已发货 || orderModel.OState == (int)Enums.OrderState.已到货) && (orderModel.PayState == (int)Enums.PayState.未支付 || orderModel.PayState == (int)Enums.PayState.部分支付))
                    ||
                    (orderModel.Otype == (int)Enums.OType.推送账单 && orderModel.OState == (int)Enums.OrderState.已审 && (orderModel.PayState == (int)Enums.PayState.部分支付 || orderModel.PayState == (int)Enums.PayState.未支付))
                ) &&
                orderModel.OState != (int)Enums.OrderState.已作废))
        {
            if (orderModel.Otype == (int)Enums.OType.推送账单)
            {
                JScript.AlertMethod(this, "账单异常,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderDzfzdList.aspx") + "'); }");
            }
            else
            {
                JScript.AlertMethod(this, "订单异常,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("orderPayList.aspx") + "'); }");
            }
            return;
        }

        // 审核状态
        if (orderModel.OState < 2)
        {
            JScript.AlertMethod(this, "该订单未审核,不能支付!", JScript.IconOption.错误, "function (){ location.replace('" + ("../neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)) + "'); }");
            return;
        }

        // 支付状态检查
        if (orderModel.PayState != (int)Enums.PayState.未支付 && orderModel.PayState != (int)Enums.PayState.部分支付)
        {
            Response.Redirect("Error.aspx?type=" + Common.DesEncrypt("1", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
            return;
        }

        // 开销户
        List <Hi.Model.PAY_OpenAccount> LOpen = new Hi.BLL.PAY_OpenAccount().GetList("", "DisID=" + this.DisID + " and State=1 and isnull(dr,0)=0", "");
        // 提现户
        List <Hi.Model.PAY_Withdrawals> Lwith = new Hi.BLL.PAY_Withdrawals().GetList("", "DisID=" + this.DisID + " and state=1 and isnull(dr,0)=0", "");

        if (LOpen.Count > 0 && Lwith.Count > 0)
        {
            String msghd_rspcode    = "";
            String msghd_rspmsg     = "";
            String amt_balamt       = "";
            String msghd_rspcode1   = "";
            String msghd_rspmsg1    = "";
            String credit_nousedamt = "";
            String Json             = "";
            String Json1            = "";
            try
            {
                IPubnetwk ipu = new IPubnetwk();
                Json  = ipu.trd13010("{\"msghd_trdt\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"srl_ptnsrl\":\"" + Common.Number_repeat("") + "\",\"cltacc_cltno\":\"" + LOpen[0].AccNumver + "\",\"cltacc_cltnm\":\"" + LOpen[0].AccName + "\",\"bkacc_accno\":\"" + Lwith[0].AccNm + "\",\"bkacc_accnm\":\"" + LOpen[0].AccName + "\"}");
                Json1 = ipu.trd70000("{\"msghd_trdt\":\"" + DateTime.Now.ToString("yyyyMMdd") + "\",\"srl_ptnsrl\":\"" + Common.Number_repeat("") + "\",\"cltacc_cltno\":\"" + LOpen[0].AccNumver + "\",\"cltacc_cltnm\":\"" + LOpen[0].AccName + "\"}");
            }
            catch { }
            try
            {
                JsonData Params = JsonMapper.ToObject(Json);
                msghd_rspcode = Params["msghd_rspcode"].ToString();
                msghd_rspmsg  = Params["msghd_rspmsg"].ToString();
                amt_balamt    = Params["amt_balamt"].ToString();
                this.lblBalance1.InnerHtml = (Convert.ToDecimal(amt_balamt) / 100).ToString("N2");
                JsonData Params1 = JsonMapper.ToObject(Json1);
                msghd_rspcode1             = Params1["msghd_rspcode"].ToString();
                msghd_rspmsg1              = Params1["msghd_rspmsg"].ToString();
                credit_nousedamt           = Params1["credit_nousedamt"].ToString();
                this.lblBalance3.InnerHtml = (Convert.ToDecimal(credit_nousedamt) / 100).ToString("N2");
            }
            catch { }
        }

        // 在线融资记录
        PList = new Hi.BLL.PAY_Financing().GetList("", "DisID=" + this.DisID + " and OrderID=" + KeyID + " and State=3 and isnull(dr,0)=0", "");
        if (PList.Count > 0)
        {
            this.lblBalance5.InnerHtml = PList[0].AclAmt.ToString("0.00");
        }

        decimal payPrice = orderModel.AuditAmount + orderModel.OtherAmount - orderModel.PayedAmount;

        this.lblOrderNO.InnerText = orderModel.ReceiptNo.Trim().ToString();
        //账单支付链接
        if (orderModel.Otype == 9)  // 推送账单
        {
            this.lblOrderNO.HRef = "../OrderZDInfo.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey);
        }
        else
        {
            this.lblOrderNO.HRef = "../neworder/orderdetail.aspx?KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey);
        }

        this.hidOrderid.Value      = KeyID.ToString();
        this.lblPricePay.InnerText = payPrice.ToString("0.00");
        this.hidPricePay.Value     = payPrice.ToString("0.00");
        this.lblPriceO.InnerText   = (orderModel.AuditAmount + orderModel.OtherAmount).ToString("0.00");
        if (this.txtPayOrder.Value == "")
        {
            this.txtPayOrder.Value = payPrice.ToString("0.00");
        }
        else
        {
            this.txtPayOrder.Value = Convert.ToDecimal(this.txtPayOrder.Value).ToString("0.00");
        }

        this.hidUserName.Value = this.UserName;

        decimal sumPrice = new Hi.BLL.PAY_PrePayment().sums(orderModel.DisID, orderModel.CompID);

        this.lblSumPrice.InnerText = sumPrice.ToString("0.00");
        this.hidSumPrice.Value     = sumPrice.ToString("0.00");

        string strWhere = " 1=1 ";

        if (this.DisID != 0)
        {
            strWhere += " and DisID = " + this.DisID;
        }
        strWhere += " and Start = 1 and vdef6 = 0 and isnull(dr,0)=0";
        List <Hi.Model.PAY_FastPayMent> fastList = new Hi.BLL.PAY_FastPayMent().GetList("", strWhere, "");

        this.rptQpay.DataSource = fastList;
        this.rptQpay.DataBind();
        List <Hi.Model.PAY_BankInfo> BankL = new Hi.BLL.PAY_BankInfo().GetList("", " vdef1=0", "");

        this.rptOtherBank.DataSource = BankL;
        this.rptOtherBank.DataBind();
    }