Пример #1
0
    protected void addorderbt_Click(object sender, EventArgs e)
    {
        DateTime ordertime  = DateTime.Now;
        string   orderid    = ordertime.ToString("yyyyMMddhhmmss");
        double   orderprice = double.Parse(Session["price"].ToString());
        int      ordercount = int.Parse(Session["count"].ToString());
        order    ord        = new order();

        if (ord.createorder(orderid, user.getUserID(), this.acceptnametb.Text.Trim(),
                            this.addresstb.Text.Trim(), this.postalcodetb.Text.Trim(), this.phonetb.Text.Trim(),
                            this.deliverylist.SelectedItem.Text, this.paymentlist.SelectedItem.Text, 1, ordertime, orderprice, ordercount) == 1)
        {
            cart mycart = new cart();
            mycart.updatecartstate();
            this.Response.Redirect("success.aspx");
        }
        else
        {
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "<script>alert('订单出错!')</script>", false);
        }
    }