Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["out_trade_no"] != null && Request.QueryString["returncode"] != null && Request.QueryString["total_fee"] != null && Request.QueryString["sign"] != null)
            {
                string out_trade_no = Request.QueryString["out_trade_no"];//订单号.
                string returncode   = Request.QueryString["returncode"];
                string total_fee    = Request.QueryString["total_fee"];
                string sign         = Request.QueryString["sign"];
                string key          = ConfigurationManager.AppSettings["key"].ToString();
                string mysign       = common.WebComm.CreateMd5(out_trade_no + returncode + total_fee + key).ToLower(); //数字签名

                if (mysign == sign)                                                                                    //对数字签名进行比较
                {
                    if (returncode == "ok")
                    {
                        BLL.OrdersManager bll   = new BookShop.BLL.OrdersManager();
                        Model.Orders      model = bll.GetModel(out_trade_no);
                        if (model != null)
                        {
                            model.State = 1;//如果订单存在,修改该订单的状态,1:表示已付款未发货.
                            bll.Update(model);
                            Response.Redirect("/showinfo.aspx?msg=" + Server.UrlEncode("支付成功,等待发货!") + "&url=OrderDetail.aspx?orderId=" + out_trade_no + "&txt=" + Server.UrlEncode("查看订单信息!"));
                        }
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["orderId"]))
            {
                BLL.OrdersManager orderBll = new BookShop.BLL.OrdersManager();
                orderModel = orderBll.GetModel(Request.QueryString["orderId"]);
                if (orderModel != null)//判断该订单是否存在
                {
                    BLL.OrderBookManager   orderBookBll = new BookShop.BLL.OrderBookManager();
                    List <Model.OrderBook> list         = orderBookBll.GetModelList("OrderID='" + Request.QueryString["orderId"] + "'");//根据订单号获取订单的详细信息;注意 给接收到的订单号加上  '  ' (单引号)

                    this.rptDetails.DataSource = list;
                    this.rptDetails.DataBind();
                }
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["orderid"]))
            {
                BLL.OrdersManager bll   = new BookShop.BLL.OrdersManager();
                Model.Orders      model = bll.GetModel(Request.QueryString["orderid"]);
                if (model != null)
                {
                    if (model.State == 1)
                    {
                        Response.Write("以付款,无需重新付款");
                    }
                    else
                    {
                        PayGet.PayProcess process = new BookShop.Web.PayGet.PayProcess("图书", "网上书城", Request.QueryString["orderid"], model.TotalPrice.ToString());

                        string url = process.GoPayPage();
                        Response.Redirect(url);//向支付宝发出请求.
                    }
                }
            }
        }