Ejemplo n.º 1
0
 /// <summary>
 /// 提交订单
 /// </summary>
 public void present(string ReceiptNo)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(ReceiptNo);
     if (order != null)
     {
         if (order.IsAudit == 1)
         {
             order.OState    = (int)Enums.OrderState.已审;
             order.AuditDate = DateTime.Now;
         }
         else
         {
             order.OState = (int)Enums.OrderState.待审核;
         }
         order.ts         = DateTime.Now;
         order.modifyuser = this.UserID;
         if (new Hi.BLL.DIS_Order().Update(order))
         {
             Utils.AddSysBusinessLog(dis.CompID, "Order", orderid.ToString(), "提交订单", "");
             string str = "\"str\":true";
             str = "{" + str + "}";
             Response.Write(str);
             Response.End();
         }
     }
 }
Ejemplo n.º 2
0
    private void Bind()
    {
        if (KeyID != 0)
        {
            string sql = "SELECT * FROM [dbo].[CompCollection_view] where  CompID=" + this.CompID + " and ID=" + KeyID;

            DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];

            if (ds != null && ds.Rows.Count > 0)
            {
                int orderid = Convert.ToInt32(ds.Rows[0]["orderID"]);
                Hi.Model.DIS_Order orderModel = new Hi.BLL.DIS_Order().GetModel(orderid);

                this.lblReceiptNo.InnerText  = orderModel.ReceiptNo.ToString();
                this.lblOState.InnerText     = OrderInfoType.OState(orderid);
                this.lblPayState.InnerText   = OrderInfoType.PayState(orderModel.PayState);
                this.lblTotalPrice.InnerText = orderModel.AuditAmount.ToString("N");
                this.lblPayedPrice.InnerText = ds.Rows[0]["Price"].ToString().ToDecimal(0).ToString("N");
                this.lblPayAuomet.InnerText  = orderModel.PayedAmount.ToString("N");
                if (ds.Rows[0]["Date"] != null && ds.Rows[0]["Date"].ToString() != "")
                {
                    this.lblArriveDate.InnerText = Convert.ToDateTime(ds.Rows[0]["Date"]).ToString("yyyy-MM-dd");
                }
                this.lblDisUser.InnerText    = Common.GetUserName(orderModel.DisUserID);
                this.lblCreateDate.InnerText = Convert.ToDateTime(orderModel.CreateDate).ToString("yyyy-MM-dd");

                this.lblPaySource.InnerText = ds.Rows[0]["Source"].ToString();
            }
        }
    }
Ejemplo n.º 3
0
    private void Bind()
    {
        Hi.Model.DIS_Order orderModel = new Hi.BLL.DIS_Order().GetModel(orderid);

        string sql = string.Empty;

        if (paymentid > 0)
        {
            sql = "SELECT * FROM [dbo].[CompCollection_view] where PreType=" + PreType + " and paymentid=" + paymentid;
        }

        DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];

        if (ds != null && ds.Rows.Count > 0 && orderModel != null)
        {
            this.lblReceiptNo.InnerText = orderModel.ReceiptNo.ToString();


            this.lblOState.InnerText   = OrderInfoType.OState(orderModel.ID);
            this.lblPayState.InnerText = OrderInfoType.PayState(orderModel.PayState);



            this.lblTotalPrice.InnerText = orderModel.AuditAmount.ToString("N");
            this.lblPayedPrice.InnerText = ds.Rows[0]["Price"].ToString().ToDecimal(0).ToString("N");
            this.lblPayAuomet.InnerText  = orderModel.PayedAmount.ToString("N");
            this.lblArriveDate.InnerText = Convert.ToDateTime(ds.Rows[0]["Date"]).ToString("yyyy-MM-dd");
            this.lblDisUser.InnerText    = Common.GetUserName(orderModel.DisUserID);
            this.lblCreateDate.InnerText = Convert.ToDateTime(orderModel.CreateDate).ToString("yyyy-MM-dd");

            this.lblPaySource.InnerText = ds.Rows[0]["Source"].ToString();

            ViewState["paymentID"] = ds.Rows[0]["paymentID"].ToString().ToInt(0);
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 绑定事件
    /// </summary>
    public void Bind()
    {
        Hi.Model.DIS_Order orderModel = new Hi.BLL.DIS_Order().GetModel(KeyID);

        this.hidUserName.Value = this.UserName;
        string strWhere = string.Empty;

        if (this.DisID != 0)
        {
            strWhere += " DisID = '" + this.DisID + "' ";
        }
        else
        {
            JScript.AlertMsgOne(this, "操作员没有对应的代理商!", JScript.IconOption.错误, 2500);
        }
        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();
        SumNumber = fastList.ToArray().Length;
        List <Hi.Model.PAY_BankInfo> BankL = new Hi.BLL.PAY_BankInfo().GetList("", " vdef1=0", "");

        this.rptOtherBank.DataSource = BankL;
        this.rptOtherBank.DataBind();
    }
Ejemplo n.º 5
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.º 6
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.º 7
0
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        strwhere += "and Otype!=9 and isnull(dr,0)=0 and ReturnState <>0 and disid=" + this.DisID;

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length < 4)
            {
                Pager.PageSize = int.Parse(this.txtPager.Value.Trim());
            }
            else
            {
                this.txtPager.Value = "100";
                Pager.PageSize      = 100;
            }
        }

        List <Hi.Model.DIS_Order> orders = new Hi.BLL.DIS_Order().GetList(Pager.PageSize, Pager.CurrentPageIndex, "ReturnMoneyDate", true, strwhere, out pageCount, out Counts);

        this.rptOrder.DataSource = orders;
        this.rptOrder.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        int    pageCount = 0;
        int    Counts    = 0;
        string strwhere  = string.Empty;

        if (Request["type"] == "1")
        {
            strwhere += " and OState in (2,4,5)  and PayState in(0,1)  and DisID='" + KeyID + "' and isnull(dr,0)=0 and Otype!=9 and compid=" + CompID;
        }
        if (Request["type"] == "2")
        {
            strwhere        += " and OState in (2,4,5)  and PayState in(0,1)  and DisID='" + KeyID + "' and isnull(dr,0)=0 and Otype=9 and compid=" + CompID;
            num.InnerText    = "账单编号";
            date.InnerText   = "账单日期";
            amount.InnerText = "账单金额";
            state.InnerText  = "账单状态";
        }
        if (Request["Sdate"].ToString() != "")
        {
            strwhere += " and CreateDate>='" + Convert.ToDateTime(Request["Sdate"].ToString()) + "'";
        }
        if (Request["Edate"].ToString() != "")
        {
            strwhere += " and CreateDate<'" + Convert.ToDateTime(Request["Edate"].ToString()).AddDays(1) + "'";
        }
        List <Hi.Model.DIS_Order> l = new Hi.BLL.DIS_Order().GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", false, strwhere, out pageCount, out Counts);

        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 同时推送微信和安卓
    /// </summary>
    /// <param name="sendType">发送类型</param>
    /// <param name="orderID">操作订单</param>
    /// <param name="userType">当前用户</param>
    public void GetWxService(string sendType, string orderID, string userType, decimal money = 0)
    {
        try
        {
            //Common.WriteLog(@"D:\u8\sql.txt", sendType + orderID + userType);

            Type      = sendType.Trim();
            OrderID   = orderID.Trim();
            UserType  = userType.Trim();
            money_all = money;

            Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(int.Parse(orderID));
            if (order == null)
            {
                return;
            }
            if (userType != "0" && userType != "1")
            {
                return;
            }
            if (sendType != "1" && sendType != "2" && sendType != "3" && sendType != "4" && sendType != "5" && sendType != "41" &&
                sendType != "42" && sendType != "43" && sendType != "44" && sendType != "45" && sendType != "46")
            {
                return;
            }

            //Hi.Model.BD_CompAccessControl compControl = Common.GetCompControl(order.CompID);

            //微信推送线程
            //this.thread = new Thread(new ThreadStart(WechatThread));

            //if (sendType == "1" || sendType == "2" || sendType == "3" || sendType == "4")
            //{
            //    if (compControl == null)
            //        this.threadAndroid = new Thread(new ThreadStart(AndroidThread));
            //    else if (compControl.IsRecApp == 1)
            //        this.threadAndroid = new Thread(new ThreadStart(AndroidThread));
            //}
            //else
            //{
            //    this.threadAndroid = new Thread(new ThreadStart(AndroidThread));
            //}


            AndroidThread();

            //this.threadAndroid = new Thread(new ThreadStart(AndroidThread));
            //this.threadTimer = new Thread(new ThreadStart(ThreadTimeOut));

            //thread.Start();
            //threadAndroid.Start();
            //threadTimer.Start();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
Ejemplo n.º 10
0
 public string GetOrderdatetime(int orderid)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(orderid);
     if (order != null)
     {
         return(order.CreateDate.ToString("yyyy-MM-dd HH:mm"));
     }
     return("");
 }
Ejemplo n.º 11
0
 public decimal GetOrderdatemy(int orderid)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(orderid);
     if (order != null)
     {
         return(Math.Round(order.AuditAmount, 2));
     }
     return(0);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取订单号
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public string OrderNO(object obj)
 {
     Hi.Model.DIS_Order ordermodel = new Hi.BLL.DIS_Order().GetModel(Convert.ToInt32(obj));
     if (ordermodel != null)
     {
         return(ordermodel.ReceiptNo);
     }
     return("");
 }
Ejemplo n.º 13
0
 public string GetOrderID(int orderid)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(orderid);
     if (order != null)
     {
         return(order.ReceiptNo);
     }
     return("");
 }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request["type"]))
            {
                type = Request["type"].ToString().ToInt(0);
            }

            this.hidDisId.Value = DisID.ToString();
            this.hidType.Value  = type.ToString();

            if (type == 0)
            {
                KeyID = Common.DesDecrypt((Request["KeyID"] + ""), Common.EncryptKey).ToInt(0);
            }
            else
            {
                KeyID = (Request["KeyID"] + "").ToInt(0);
            }
            this.hidGoodsInfo.Value = KeyID.ToString();
            this.hidIndex.Value     = Request["index"] != null ? Request["index"].ToString() : "";

            if (type == 0)
            {
                Hi.Model.DIS_Order o = new Hi.BLL.DIS_Order().GetModel(KeyID);
                this.txtremark.Value = o.Remark;
                txtremark.Attributes.Add("placeholder", "选填:对本次交易的说明(限200字)。");
                txtremark.Attributes.Add("maxlength", "400");
            }
            else if (type == 1)
            {
                Hi.Model.DIS_OrderDetail od = new Hi.BLL.DIS_OrderDetail().GetModel(KeyID);
                this.txtremark.Value = od.Remark;
                txtremark.Attributes.Add("placeholder", "选填:对本次交易商品的说明(限150字)。");
                txtremark.Attributes.Add("maxlength", "150");
            }
            else
            {
                //DataTable dt = HttpContext.Current.Session["GoodsInfo"] as DataTable;
                txtremark.Attributes.Add("placeholder", "选填:对本次交易商品的说明(限150字)。");
                txtremark.Attributes.Add("maxlength", "150");
                ClientScript.RegisterStartupScript(this.GetType(), "121", "<script>type3();</script>");

                //if (dt != null && dt.Rows.Count > 0)
                //{
                //    DataRow[] dr = dt.Select(" GoodsInfoID=" + KeyID);
                //    if (dr.Length > 0)
                //    {
                //        this.txtremark.Value = dr[0]["Remark"].ToString();
                //    }
                //}
                //this.txtremark.Value = Request["remark"] != null ? Request["remark"].ToString() : "";
            }
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["type"]))
        {
            type = Request["type"].ToString().ToInt(0);
        }

        copetotal.Visible = false;
        PostFee.Visible   = false;
        if (!string.IsNullOrEmpty(Request["t"]))
        {
            t = (Request["t"] + "").ToDecimal(0);
        }

        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            KeyID = Common.DesDecrypt(Request["KeyID"] + "", Common.EncryptKey).ToInt(0);
        }

        if (type == 0)
        {
            copetotal.Visible = true;
            title             = "应付总额";
            txttotal.Value    = t.ToString("0.00");

            Hi.Model.DIS_Order ordermodel = new Hi.BLL.DIS_Order().GetModel(KeyID);
            if (ordermodel != null)
            {
                hidts.Value = ordermodel.ts.ToString();
            }
        }
        else if (type == 1)
        {
            PostFee.Visible  = true;
            title            = "修改运费";
            txtPostFee.Value = t.ToString("0.00");

            Hi.Model.DIS_Order ordermodel = new Hi.BLL.DIS_Order().GetModel(KeyID);
            if (ordermodel != null)
            {
                hidts.Value = ordermodel.ts.ToString();
            }
        }
        else if (type == 2)
        {
            PostFee.Visible  = true;
            title            = "修改运费";
            txtPostFee.Value = t.ToString("0.00");
        }

        this.hidOrderID.Value = (Request["KeyID"] + "").ToString();
        this.hidType.Value    = type.ToString();
        this.hidT.Value       = t.ToString();
    }
Ejemplo n.º 16
0
    public void DataBinds()
    {
        int pageCount = 0;
        int Counts    = 0;
        List <Hi.Model.DIS_Order> LDis = new Hi.BLL.DIS_Order().GetList(Pager.PageSize, Pager.CurrentPageIndex, "Createdate", false, SearchWhere(), out pageCount, out Counts);

        this.Rpt_Dis.DataSource = LDis;
        this.Rpt_Dis.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Ejemplo n.º 17
0
 public string GetOrderNo(int OrderID)
 {
     Hi.Model.DIS_Order OModel = new Hi.BLL.DIS_Order().GetModel(OrderID);
     if (OModel == null)
     {
         return("");
     }
     else
     {
         return("<a href=\"javascript:void(0);\" onclick='Goinfo(\"" + Common.DesEncrypt(OModel.ID.ToString(), Common.EncryptKey) + "\")'>" + OModel.ReceiptNo + "</a>");
     }
 }
Ejemplo n.º 18
0
    public string GetOrderID(string Num)
    {
        List <Hi.Model.DIS_Order> order = new Hi.BLL.DIS_Order().GetList("", "ISNULL(dr,0)=0 and compid=" + CompID + " and ReceiptNo='" + Common.NoHTML(Num) + "'", "");

        if (order.Count > 0)
        {
            return(order[0].ID.ToString());
        }
        else
        {
            return("");
        }
    }
Ejemplo n.º 19
0
    //public void rptOrder_ItemDataBound(object sender, RepeaterItemEventArgs e)
    //{
    //    if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
    //    {
    //        DataRowView drv = (DataRowView)e.Item.DataItem;
    //        ta += Convert.ToDecimal(drv["Price"]);
    //    }
    //    if (e.Item.ItemType == ListItemType.Footer)
    //    {
    //        if (e.Item.FindControl("total") != null)
    //        {
    //            Label tol = (Label)e.Item.FindControl("total");
    //            tol.Text = string.Format("{0}", ta.ToString("N"));
    //        }
    //    }
    //}
    public string GetOrderID(string Num)
    {
        List <Hi.Model.DIS_Order> order = new Hi.BLL.DIS_Order().GetList("", "ISNULL(dr,0)=0 and DisID=" + this.DisID + " and ReceiptNo='" + Num + "'", "");

        if (order.Count > 0)
        {
            return(order[0].ID.ToString());
        }
        else
        {
            return("");
        }
    }
Ejemplo n.º 20
0
    public void A_Seek(object sender, EventArgs e)
    {
        string strwhere = string.Empty;

        if (!string.IsNullOrEmpty(txtorderReceiptNo.Value.Trim()))
        {
            DataSet order = new Hi.BLL.DIS_Order().GetData(txtorderReceiptNo.Value.Trim());
            if (order.Tables[0].Rows.Count > 0)
            {
                string str = "";
                //for (int i = 0; i < order.Tables[0].Rows.Count; i++)
                //{
                //    str += order.Tables[0].Rows[i]["id"] + ",";
                //}
                // strwhere += " and OrderID in (" + str.TrimEnd(',') + ")";
                strwhere += " and orderid in(select id from dis_order where receiptno like '%" + Common.NoHTML(txtorderReceiptNo.Value.Trim().Replace("'", "''")) + "%' and dr=0)";
            }
            else
            {
                strwhere += " and OrderID=0";
            }
        }
        //if (!string.IsNullOrEmpty(txtname.Value.Trim()))
        //{
        //    strwhere += " and SignUser like '%" + txtname.Value.Trim() + "%'";
        //}
        //if (txtArriveDate.Value.Trim() != "")
        //{
        //    strwhere += " and orderid in(select id from dis_order where createDate >= '" + txtArriveDate.Value.Trim() + "' and dr=0)";
        //}
        //if (txtArriveDate1.Value.Trim() != "")
        //{
        //    strwhere += " and orderid in(select id from dis_order where createDate < '" + Convert.ToDateTime(txtArriveDate1.Value.Trim()).AddDays(1) + "' and dr=0)";
        //}

        if (txtArriveDate.Value.Trim() != "")
        {
            strwhere += " and  SignDate>= '" + txtArriveDate.Value.Trim() + "'";
        }
        if (txtArriveDate1.Value.Trim() != "")
        {
            strwhere += " and SignDate < '" + Convert.ToDateTime(txtArriveDate1.Value.Trim()).AddDays(1) + "'";
        }

        //if (IsSign.Value != "-1")
        //{
        //    strwhere += " and IsSign=" + IsSign.Value.Trim();
        //}
        ViewState["strwhere"] = strwhere;
        Bind();
    }
Ejemplo n.º 21
0
    public int Fanli  = 0; //是否启用返利
    protected void Page_Load(object sender, EventArgs e)
    {
        object obj = Request["action"];

        if (obj != null)
        {
            if (obj.ToString() == "dislist")
            {
                string compid = Request["compId"] + "";
                string disid  = Request["disId"] + "";
                Response.Write(disBing(compid, disid));
                Response.End();
            }
        }
        if (!IsPostBack)
        {
            DataTable dt = Common.BindDisList(this.CompID.ToString());//代理商绑定
            if (dt != null)
            {
                this.rptDisList.DataSource = dt;
                this.rptDisList.DataBind();
            }
            this.hidType2.Value  = Request.QueryString["type"] + "";//2 再次购买
            this.hidKeyId.Value  = KeyID.ToString();
            this.hidCompId.Value = this.CompID.ToString();
            Fanli = OrderInfoType.rdoOrderAudit("订单支付返利是否启用", CompID).ToInt(0);
            this.hidFanl.Value = Fanli.ToString();                                         //是否启用返利
            IsInve             = OrderInfoType.rdoOrderAudit("商品是否启用库存", CompID).ToInt(0); //是否启用库存
            //代理商列表
            List <Hi.Model.BD_Distributor> list = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compid=" + this.CompID, "");
            this.divDisList.InnerText = ConvertJson.ToJson(Common.FillDataTable(list));
            if (KeyID != 0)
            {
                if (Request.QueryString["type"] + "" != "2")
                {
                    Hi.Model.DIS_Order model = new Hi.BLL.DIS_Order().GetModel(KeyID);
                    //判断订单是否可以修改  企业下单订单已审未支付,代理商下单企业不能修改
                    if (model.OState > (int)Enums.OrderState.待审核)
                    {
                        JScript.AlertAndRedirect("订单已被其他人修改,请刷新后再重新操作!", "orderdetail.aspx?top=1&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
                        return;
                    }
                }
                else
                {
                    this.hidType.Value = Request.QueryString["type"] + "";
                }
                Bind();
            }
        }
    }
Ejemplo n.º 22
0
    public void GetUrl(string oid, decimal payprice)
    {
        Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(Convert.ToInt32(oid));
        this.lblOrderNO.InnerText = OrderModel.ReceiptNo.Trim().ToString();
        this.fee.InnerText        = this.CompName;//收款方

        string[] json = Tx1401.tx1401("20", oid, payprice);
        //生成成功
        //if (Convert.ToBoolean(json[0]))
        Image.ImageUrl     = "WxPay.aspx?data=" + HttpUtility.UrlEncode(Common.DesDecrypt(json[1], Common.EncryptKey));
        this.hidguid.Value = json[2];//支付交易流水号
        // else
        //    ErrMessage(json[1], oid);
    }
Ejemplo n.º 23
0
 public void Del(string oid)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(int.Parse(oid));
     order.OState     = (int)Enums.OrderState.已作废;
     order.ts         = DateTime.Now;
     order.modifyuser = this.UserID;
     if (new Hi.BLL.DIS_Order().Update(order))
     {
         Utils.AddSysBusinessLog(dis.CompID, "Order", order.ID.ToString(), "取消订单", "");
         string str = "\"str\":true";
         str = "{" + str + "}";
         Response.Write(str);
         Response.End();
     }
 }
Ejemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(orderid))
         {
             object value = new Hi.BLL.DIS_Order().GetModel(Convert.ToInt32(orderid)).ReceiptNo;
             if (value != null)
             {
                 this.txt_OrderCoder.Value = value.ToString();
                 this.hid_OrderID.Value    = Orderid;
             }
         }
     }
 }
Ejemplo n.º 25
0
    //public void OTypeBind()
    //{
    //    ddlOtype.Items.Add(new ListItem("全部", "-1"));
    //    foreach (Enums.OType a in Enum.GetValues(typeof(Enums.OType)))
    //    {
    //        ddlOtype.Items.Add(new ListItem(a.ToString(), ((int)a).ToString()));
    //    }
    //}

    /// <summary>
    /// 绑定销售订单信息列表
    /// </summary>
    public void Bind()
    {
        price = new Hi.BLL.PAY_PrePayment().sums(this.DisID, this.CompID).ToString("0.00");
        int pageCount = 0;
        int Counts    = 0;
        //string ordStatr=this.ddrPayState.Value;//订单状态
        string strwhere = string.Empty;

        if (ViewState["strwhere"] != null)
        {
            strwhere += ViewState["strwhere"].ToString();
        }
        //if (ordStatr!="-1")
        //{
        //    strwhere += " and PayState="+ordStatr;
        //}


        int disid = this.DisID;

        if (this.ddrComp.Value != "")
        {
            strwhere += " and CompID=" + this.ddrComp.Value; //add by hgh
        }
        //该代理商的,没有删除标准的订单
        strwhere += " and (( Otype=1 and OState not in (-1,0,1)  and PayState in (0,1) ) or( Otype<>1 and Otype<>9 and OState in(2,4,5)   and PayState in (0,1) )) and OState<>6   and DisID='" + disid + "' and ReturnState in(0,1) and Otype!=9 and isnull(dr,0)=0"; //IsDel=1  订单已删除

        if (this.txtPager.Value.Trim().ToString() != "")
        {
            if (this.txtPager.Value.Trim().Length >= 5)
            {
                Pager.PageSize      = 100;
                this.txtPager.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPager.Value.Trim().ToInt(0);
            }
        }

        List <Hi.Model.DIS_Order> l = new Hi.BLL.DIS_Order().GetList(Pager.PageSize, Pager.CurrentPageIndex, "CreateDate", true, strwhere, out pageCount, out Counts);

        this.rptOrder.DataSource = l;
        this.rptOrder.DataBind();

        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Ejemplo n.º 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["KeyID"] != null)
         {
             int compID = Convert.ToInt32(Common.DesDecrypt(Request.QueryString["KeyID"].ToString(), Common.EncryptKey));
             Hi.Model.DIS_Order OrderModel = new Hi.BLL.DIS_Order().GetModel(compID);
             if (OrderModel != null)
             {
                 SignDay = GetDay(OrderModel.CompID, "订单自动签收");
                 PayDay  = GetDay(OrderModel.CompID, "超时未付款自动作废订单");
             }
         }
     }
 }
Ejemplo n.º 27
0
    /// <summary>
    /// 获取推送用户,返回推送类
    /// </summary>
    /// <param name="userType">0 (当前用户类型是企业,即推送至经销商) 1 (当前用户类型是经销商,即推送至企业) 2 全部 </param>
    /// <param name="sendType">类型同微信推送</param>
    /// <returns></returns>
    public PushPayload GetSendUserModel(string userType, string orderID, string sendType, decimal money)
    {
        Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(int.Parse(orderID));
        if (order == null)
        {
            return(null);
        }

        //推送设置
        PushPayload payload = new PushPayload();

        payload.platform = Platform.android_ios();//推送平台
        string str = "{\"OrderType\":\"" + sendType + "\",\"ReceiptNo\":\"" + order.ReceiptNo + "\",\"Date\":\"" + DateTime.Now.ToString("yyyy年MM月dd日") + "\",\"Money\":\"" + money.ToString("F2") + "\",\"AllDate\":\"" + DateTime.Now.ToString() + "\"}";
        // SendType 0:推送给经销商 1:推送给企业
        string sendStr = "{\"SendType\":\"" + userType + "\",\"DisID\":\"" + order.DisID + "\",\"CompID\":\"" + order.CompID + "\"}";

        //推送通知
        //AndroidNotification android = new AndroidNotification();
        //android.setAlert(GetAlertContent(order, sendType));//推送内容
        //payload.notification = new Notification().setAndroid(android);//推送内容
        payload.notification = new Notification().setAlert(GetAlertContent(order, sendType))
                               .setAndroid(new AndroidNotification()
                                           .AddExtra("Type", "1")
                                           .AddExtra("CheckUser", AESHelper.Encrypt_android(sendStr))
                                           .AddExtra("Json", AESHelper.Encrypt_android(str)))
                               .setIos(new IosNotification()              //设置IOS的notification
                                       .setAlert(GetAlertContent(order, sendType))
                                       .autoBadge()
                                       .AddExtra("Type", "1")
                                       .AddExtra("CheckUser", AESHelper.Encrypt_android(sendStr))
                                       .AddExtra("Json", AESHelper.Encrypt_android(str)));
        //推送消息
        payload.message = Message.content(GetAlertContent(order, sendType))
                          .AddExtras("Type", "1")
                          .AddExtras("CheckUser", AESHelper.Encrypt_android(sendStr))
                          .AddExtras("Json", AESHelper.Encrypt_android(str));
        //推送用户,0:推送给经销商 1:推送给企业
        //payload.audience = Audience.all();
        payload.audience = Audience.s_alias(GetUserAlias(order, userType));
        Options op = new Options();

        op.apns_production = false;
        payload.options    = op;


        return(payload);
    }
Ejemplo n.º 28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["KeyId"] != null)
            {
                int payid = Convert.ToInt32(Common.DesDecrypt(Request["KeyId"].ToString(), Common.EncryptKey));
                Hi.Model.PAY_Payment payment = payservice.GetModel(payid);
                if (payment != null)
                {
                    //订单编号
                    Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(payment.OrderID);

                    if (payment.vdef4 != null)
                    {
                        lblNo.Text = payment.guid.Trim();
                    }
                    lblPayDate.Text = Convert.ToDateTime(payment.PayDate).ToString("yyyy-MM-dd HH:mm");
                    //付款方
                    Hi.Model.BD_Distributor dis = new Hi.BLL.BD_Distributor().GetModel(payment.DisID);
                    lblDisName.Text = payment.PayUser;

                    //收款方
                    Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(order.CompID);
                    lblCompName.Text = comp.CompName;
                    List <Hi.Model.PAY_PaymentBank> LBank = new Hi.BLL.PAY_PaymentBank().GetList(" top 1 accountName,bankCode ", " CompID=" + dis.CompID + " and dr=0 ", " Isno desc ");
                    if (LBank.Count > 0)
                    {
                        Hi.Model.PAY_PaymentBank bank = LBank[0];
                        lblBank2.Text = "(" + bank.AccountName + " &nbsp; " + bank.bankcode + ")";
                    }
                    //资金
                    lblPayPrice.Text   = Convert.ToDecimal(payment.PayPrice).ToString("N");
                    lblPayPriceDX.Text = CmycurD(payment.PayPrice);
                    if (!string.IsNullOrEmpty(payment.vdef5))
                    {
                        lblSXFPrice.Text = Convert.ToDecimal(payment.vdef5).ToString("N");
                    }


                    lblOrderNo.Text = order.ReceiptNo;
                }
            }
        }
    }
Ejemplo n.º 29
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.º 30
0
 /// <summary>
 /// 确认到货
 /// </summary>
 public void affirm(string ReceiptNo)
 {
     Hi.Model.DIS_Order order = new Hi.BLL.DIS_Order().GetModel(ReceiptNo);
     if (order.OState == 1 || order.OState == 2 || order.OState == 4)
     {
         order.OState     = (int)Enums.OrderState.已到货;
         order.ts         = DateTime.Now;
         order.modifyuser = this.UserID;
         if (new Hi.BLL.DIS_Order().Update(order))
         {
             Hi.Model.DIS_OrderOut orderout = new Hi.BLL.DIS_OrderOut().GetOutModel(order.ID);
             if (orderout != null)
             {
                 orderout.SignDate   = DateTime.Now;
                 orderout.IsSign     = 1;
                 orderout.SignUserId = this.UserID;
                 orderout.SignUser   = this.UserName;
                 orderout.ts         = DateTime.Now;
                 orderout.modifyuser = this.UserID;
                 if (new Hi.BLL.DIS_OrderOut().Update(orderout))
                 {
                     Utils.AddSysBusinessLog(dis.CompID, "Order", order.ID.ToString(), "签收", "");
                     string str = "\"str\":true";
                     str = "{" + str + "}";
                     Response.Write(str);
                     Response.End();
                 }
             }
             else
             {
                 string str = "\"str\":fales";
                 str = "{" + str + "}";
                 Response.Write(str);
                 Response.End();
             }
         }
     }
     else
     {
         string str = "\"str\":fales";
         str = "{" + str + "}";
         Response.Write(str);
         Response.End();
     }
 }