Web/checkout.aspx.cs

(完整代码) 1KB

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace ClothesShop.Web
{
    public partial class checkout : BasePage
    {
        ClothesShop.BLL.userinfo user = new ClothesShop.BLL.userinfo();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (user.IsLogin() == false)
            {
                this.Response.Redirect("login_1.aspx");
            }
        }

        /// <summary>
        /// 填写订单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void addorderbt_Click(object sender, EventArgs e)
        {
            DateTime ordertime = DateTime.Now;
            string orderid = ordertime.ToString("yyyymmddhhmmss");
            string productid = Session["productids"].ToString();
            double orderprice = double.Parse(Session["price"].ToString()); 

            ClothesShop.BLL.order ord = new ClothesShop.BLL.order();

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

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。