ASP.NET在线购物网站的设计(11)

来源:xiaoniu168.com 作者:本站原创 添加时间:2011-12-14 点击数:28139

计算机毕业设计用户订单功能介绍:

5.6  用户订单
此模块是用户将购物车里面的商品生成订单给管理员,等待确认操作,如果当前预付金比购买的金额少,则不能购买。

以下是引用片段:

核心代码如下:
    protected void Page_Load(object sender, EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            DataTable tmpda = new DataTable();
            tmpda = DataBase.Get_Table("select * from gwcxx,spxx  where gwcxx.spbh=spxx.spbh and gwcxx.hydlm='" + Session["UserID"].ToString() + "'");
            this.GridView1.DataSource = tmpda;
            this.GridView1.DataBind();
            this.GridView1.Columns[1].Visible = false;
            tmpda = DataBase.Get_Table("select * from hyxx where hydlm='" + Session["UserID"].ToString() + "'");
            if (tmpda.Rows.Count > 0)
            {
                this.TextBox5.Text = tmpda.Rows[0]["ljycj"].ToString();
            }

            //从数据库中计算出购物车中当前人员的总数量和总金额
            tmpda = DataBase.Get_Table("select sum(gwcxx.sl),sum(gwcxx.sl * spxx.spjg) from gwcxx,spxx  where gwcxx.spbh=spxx.spbh and gwcxx.hydlm='" + Session["UserID"].ToString() + "'");
            if (tmpda.Rows.Count > 0)
            {
                this.TextBox3.Text = tmpda.Rows[0][0].ToString();
                this.TextBox4.Text = tmpda.Rows[0][1].ToString();
            }
            //初始化显示控件内容
            this.TextBox1.Text = Guid.NewGuid().ToString();
            this.TextBox2.Text = Session["UserID"].ToString();
            this.TextBox6.Text = DateTime.Now.Date.ToShortDateString();
            this.LinkButton2.confirm('订单生成以后只能等待确认,您不能再继续操作,是否确认生成订单?');");
        }
    }

<责任编辑:计算机毕业设计网(http://www.xiaoniu168.com)>

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网