コード例 #1
0
    protected void BtnPay_Click(object sender, EventArgs e)
    {
        modelod.orderID = int.Parse(((LinkButton)sender).CommandArgument);
        modelod         = ob.getorders(modelod);

        Response.Redirect("shopordersubmitted.aspx?oid=" + modelod.orderID + "&price=" + modelod.examBill, true);
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["oid"] != null && Request.QueryString["price"] != null)
        {
            ViewState["shoporderid"]    = Request.QueryString["oid"];
            ViewState["shoporderprice"] = Request.QueryString["price"];
            Session["shoporderid"]      = ViewState["shoporderid"];
            Session["shoporderprice"]   = ViewState["shoporderprice"];
        }
        else
        {
            if (Session["shoporderid"] != null && Session["shoporderprice"] != null)
            {
                ViewState["shoporderid"]    = Session["shoporderid"];
                ViewState["shoporderprice"] = Session["shoporderprice"];
            }
        }

        order.orderID                = int.Parse(ViewState["shoporderid"].ToString());
        order                        = ob.getorders(order);
        modelCu.customerID           = order.customerID;
        modelCu                      = Cb.getCustomer(modelCu);
        this.Label2.Text             = ViewState["shoporderprice"].ToString();
        this.HyperLink3.NavigateUrl += ViewState["shoporderid"];
    }
コード例 #3
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);
    }
コード例 #4
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        modelod.orderID = int.Parse(((LinkButton)sender).CommandArgument);
        modelod         = ob.getorders(modelod);

        //ob.Delete(modelod.orderID);
        modelod.orderStatus = "已取消";
        ob.Update(modelod);
        //Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "message", " <script>alert('" + (string)GetGlobalResourceObject("GResource", "alertcancelordersucc") + "'); </script>");
        this.GridView12.DataBind();
    }
コード例 #5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string paytype = Request.Form["paytype"].ToString();

        orders.orderID = Convert.ToInt32(ViewState["orderid"]);
        orders         = ob.getorders(orders);

        if (orders.orderStatus == "待付款")
        {
            goalipay(orders.orderID.ToString(), orders.examBill.ToString(), paytype);
        }
    }
コード例 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request["ordersshopid"] != null && Request["ordersshopid"].ToString() != "")
     {
         ViewState["ordersshopid"] = Request["ordersshopid"];
         orders.orderID            = int.Parse(ViewState["ordersshopid"].ToString());
         orders            = ob.getorders(orders);
         modeCu.customerID = orders.customerID;
         modeCu            = cb.getCustomer(modeCu);
     }
     if (!IsPostBack)
     {
         init();
     }
 }
コード例 #7
0
ファイル: PublicClass.cs プロジェクト: lyxzhl/EshineASPNet
    public Model.tab_orders doshop_eticket(Model.tab_orders orders)
    {
        Model.tab_eticket  Modeticket;
        Model.tab_products product = new Model.tab_products();

        string items = orders.ReportContent;

        string[]      ts = items.Split(';');
        StringBuilder sb = new StringBuilder();
        string        s;
        int           index;

        for (int i = 0; i < ts.Length; i++)
        {
            sb.Append(ts[i]);
            index = ts[i].IndexOf('*');
            s     = ts[i].Substring(0, index);

            product.productID = int.Parse(s);
            product           = pb.getproducts(product);

            if (product.uplimit == "电子码")
            {
                string eticket = mketicket("MP" + s, product.productID * 10 + i);

                Modeticket              = new Model.tab_eticket();
                Modeticket.orderID      = orders.orderID;
                Modeticket.customerName = orders.customerName;
                Modeticket.productName  = product.productName;
                Modeticket.productID    = product.productID;
                Modeticket.itemnum      = ts[i].Substring(index + 1);
                Modeticket.eticket      = eticket;
                Modeticket.time         = DateTime.Now;
                eb.Add(Modeticket);

                sb.Append("|" + eticket);
            }
            sb.Append(";");
        }
        sb.Remove(sb.Length - 1, 1);

        orders.ReportContent = sb.ToString();
        return(orders);
    }
コード例 #8
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 = "支付失败,支付宝无返回参数!";
        }
    }
コード例 #9
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("无通知参数");
        }
    }