資源簡介
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?????????????{
????????????????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
- 上一篇:基于C#的書店管理系統
- 下一篇:C#股票K線走勢加技術指標源碼
評論
共有 條評論