Ejemplo n.º 1
0
 void initpanel()
 {
     Bll.OrdersBll ob = new Bll.OrdersBll();
     //this.LinkButton3.Text = "";
     //this.HyperLink1.Text = (String)GetLocalResourceObject("LinkButton3Resource1.Text") + "(" + ob.getordernum(Convert.ToInt32(Session["id"])) + ")";
     //this.HyperLink2.Text = (String)GetLocalResourceObject("LinkButton4Resource1.Text") + "(" + mb.getunread(Convert.ToInt32(Session["id"])) + ")";
 }
Ejemplo n.º 2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Bll.OrdersBll    ob     = new Bll.OrdersBll();
        Model.tab_orders orders = new Model.tab_orders();
        StringBuilder    sb     = new StringBuilder();

        DataTable dt = (DataTable)Session["cartitems"];

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            sb.Append(dt.Rows[i][0] + "*" + dt.Rows[i][1] + ";");
        }

        if (sb.Length > 0)
        {
            sb.Remove(sb.Length - 1, 1);
        }
        orders.customerName  = modelCu.customerName;
        orders.personMobile  = modelCu.customerMobile;
        orders.ReportContent = sb.ToString();
        orders.ReportType    = "商城";
        double price = double.Parse(this.TextBox1.Text);

        orders.examBill      = price;
        orders.orderDate     = DateTime.Now;
        orders.personAddress = this.TextBoxPA.Text;
        orders.customerID    = modelCu.customerID;
        orders.orderStatus   = "待付款";
        int ordernum = ob.Add(orders);

        Session["cartitems"] = null;
        Response.Redirect("shopordersubmitted.aspx?oid=" + ordernum + "&price=" + orders.examBill);
        //goalipay(ordernum);
    }
Ejemplo n.º 3
0
    void initpanel()
    {
        Bll.OrdersBll  ob    = new Bll.OrdersBll();
        Bll.messageBll mb    = new Bll.messageBll();
        int            cusid = Convert.ToInt32(Session["id"]);

        this.HyperLink2.Text  = (String)GetLocalResourceObject("LinkButton4Resource1.Text") + "(" + mb.getunread(cusid) + ")";
        this.HyperLink13.Text = (String)GetLocalResourceObject("myorder") + "(" + ob.getshopordernum(cusid) + ")";
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary <string, string> sPara = GetRequestGet();

        Bll.OrdersBll    ob     = new Bll.OrdersBll();
        Model.tab_orders orders = new Model.tab_orders();
        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify    = new Notify();
            bool   verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]);

            if (verifyResult)//验证成功
            {
                orders.orderID = int.Parse(Request.QueryString["out_trade_no"]);
                orders         = ob.getorders(orders);
                //商户订单号
                //string out_trade_no = Request.QueryString["out_trade_no"];

                if (orders != null)
                {
                    orders.payRefNum = Request.QueryString["trade_no"];
                    //支付宝交易号
                    //string trade_no = Request.QueryString["trade_no"];

                    orders.payNote = Request.QueryString["trade_status"];
                    //交易状态
                    //string trade_status = Request.QueryString["trade_status"];



                    if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序
                        if (orders.ReportType == "商城")
                        {
                            if (orders.orderStatus != "付款完成")
                            {
                                orders.orderStatus = "付款完成";
                                PublicClass pc = new PublicClass();
                                orders = pc.doshop_eticket(orders);
                            }
                        }
                        else
                        {
                            if (orders.Msg.Contains("预约成功"))
                            {
                                orders.orderStatus = "约检成功";
                            }
                            else
                            {
                                orders.orderStatus = "待确认";
                                orders.Msg        += "已付款。";
                            }
                        }
                        this.Label1.Text = (string)GetGlobalResourceObject("GResource", "paysucceed");
                    }
                    else
                    {
                        this.Label1.Text = (string)GetGlobalResourceObject("GResource", "payerrortry");
                    }
                    ob.Update(orders);
                }
                else
                {
                    this.Label1.Text = (string)GetGlobalResourceObject("GResource", "alertcantfindorder");
                }
            }
            else//验证失败
            {
                this.Label1.Text = (string)GetGlobalResourceObject("GResource", "alertalipayfailed");
            }
        }
        else
        {
            this.Label1.Text = "支付失败,支付宝无返回参数!";
        }
    }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        SortedDictionary <string, string> sPara = GetRequestPost();

        Bll.OrdersBll    ob     = new Bll.OrdersBll();
        Model.tab_orders orders = new Model.tab_orders();
        if (sPara.Count > 0)//判断是否有带返回参数
        {
            Notify aliNotify    = new Notify();
            bool   verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]);

            if (verifyResult)//验证成功
            {
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //请在这里加上商户的业务逻辑程序代码
                orders.orderID = int.Parse(Request.QueryString["out_trade_no"]);
                orders         = ob.getorders(orders);

                //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
                //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表

                if (orders != null)
                {
                    orders.payRefNum = Request.QueryString["trade_no"];
                    //支付宝交易号
                    //string trade_no = Request.QueryString["trade_no"];

                    orders.payNote = Request.QueryString["trade_status"];
                    //交易状态
                    //string trade_status = Request.QueryString["trade_status"];


                    if (Request.Form["trade_status"] == "TRADE_FINISHED")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //该种交易状态只在两种情况下出现
                        //1、开通了普通即时到账,买家付款成功后。
                        //2、开通了高级即时到账,从该笔交易成功时间算起,过了签约时的可退款时限(如:三个月以内可退款、一年以内可退款等)后。
                        if (orders.ReportType == "商城")
                        {
                            if (orders.orderStatus != "付款完成")
                            {
                                orders.orderStatus = "付款完成";
                                PublicClass pc = new PublicClass();
                                orders = pc.doshop_eticket(orders);
                            }
                        }
                        else
                        {
                            if (orders.Msg.Contains("预约成功"))
                            {
                                orders.orderStatus = "约检成功";
                            }
                            else
                            {
                                orders.orderStatus = "待确认";
                                orders.Msg        += "已付款。";
                            }
                        }
                    }
                    else if (Request.Form["trade_status"] == "TRADE_SUCCESS")
                    {
                        //判断该笔订单是否在商户网站中已经做过处理
                        //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
                        //如果有做过处理,不执行商户的业务程序

                        //注意:
                        //该种交易状态只在一种情况下出现——开通了高级即时到账,买家付款成功后。
                        orders.orderStatus = "约检成功";
                    }
                    ob.Update(orders);
                }
                //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——

                Response.Write("success");  //请不要修改或删除

                /////////////////////////////////////////////////////////////////////////////////////////////////////////////
            }
            else//验证失败
            {
                Response.Write("fail");
            }
        }
        else
        {
            Response.Write("无通知参数");
        }
    }