• 大小: 1.35MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-13
  • 语言: C#
  • 标签:

资源简介

ASP.NET+sql数码购物网站全套代码 课程设计或者毕业设计使用

资源截图

代码片段和文件信息

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;

public partial class DDList : System.Web.UI.Page
{
    protected void Page_Load(object sender EventArgs e)
    {
        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            DataTable tmpda = new DataTable();
            tmpda = Database.Get_Table(“select * from gwcxxspxx  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() + “‘“);


            //从数据库中计算出购物车中当前人员的总数量和总金额
            tmpda = Database.Get_Table(“select sum(gwcxx.sl)sum(gwcxx.sl * spxx.spjg) from gwcxxspxx  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.Attributes.Add(“onclick“ “return confirm(‘订单生成以后只能等待确认您不能再继续操作是否确认生成订单?‘);“);
        }
    }
    protected void linkButton1_Click(object sender EventArgs e)
    {
        Response.Redirect(“GwcList.aspx“);
    }
    protected void linkButton2_Click(object sender EventArgs e)
    {

        if (this.GridView1.Rows.Count > 0)
        {
            //循环保存购物车中的记录到订单明细表中
            for (int i = 0; i < this.GridView1.Rows.Count; i++)
            {
                string aa = “insert into hyddmx(ddbhspbhslje) values(‘“ + this.TextBox1.Text + “‘“ + Convert.ToInt32(this.GridView1.Rows[i].Cells[1].Text) + ““ + Convert.ToDecimal(this.GridView1.Rows[i].Cells[4].Text) + ““ + Convert.ToDecimal(this.GridView1.Rows[i].Cells[3].Text) * Convert.ToDecimal(this.GridView1.Rows[i].Cells[4].Text) + “)“;
                Database.ExecSql(“insert into hyddmx(ddbhspbhslje) values(‘“ + this.TextBox1.Text + “‘“ + Convert.ToInt32(this.GridView1.Rows[i].Cells[1].Text) + ““ + Convert.ToDecimal(this.GridView1.Rows[i].Cells[4].Text) + ““ + Convert.ToDecimal(this.GridView1.Rows[i].Cells[3].Text) * Convert.ToDecimal(this.GridView1.Rows[i].Cells[4].Text) + “)“);
            }
            //保存订单主表信息
            Database.ExecSql(“insert into hyddhz(ddbhhydlmzslzjeddrq) values(‘“ + this.TextBox1.Text + “‘‘“ + Session[“UserID“].ToString() + “‘“ + Convert.ToDecimal(t

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    1179648  2011-04-25 18:50  XSWZ_Data.MDF

     文件    1048576  2011-04-25 18:50  XSWZ_Log.LDF

----------- ---------  ---------- -----  ----

              2228224                    2


评论

共有 条评论

相关资源