?? checkout.aspx.cs
字號(hào):
///中國(guó)工商網(wǎng).電子商務(wù)購(gòu)物中心系統(tǒng).EMall
///演示地址:http://emall.skysea.info
///演示界面:http://cs.12986.com/photos/sample/picture150.aspx
///中國(guó)工商網(wǎng) - http://www.12986.com
///Copyright (c) 1998-2005
///作者: Dili J.F. Senders
///技術(shù)支持:如果任何技術(shù)問(wèn)題,請(qǐng)登錄中國(guó)工商網(wǎng)技術(shù)支持網(wǎng)站咨詢:http://cs.12986.com/
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace EMall
{
/// <summary>
/// CheckOut 的摘要說(shuō)明。
/// </summary>
public class CheckOut : System.Web.UI.Page
{
protected Pub pub = new Pub();
protected System.Web.UI.WebControls.Label lbMsg;
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.Label lbTotal;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Panel Panel1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此處放置用戶代碼以初始化頁(yè)面
// 其實(shí), 一開始的頁(yè)面處理還是跟ShoppingCart.aspx一樣的
// 另外, 此時(shí)的用戶安全認(rèn)證, 由Web.Config文件已經(jīng)進(jìn)行定義
ShoppingCartList();
}
/// <summary>
/// 顯示當(dāng)前用戶(不論是已經(jīng)登錄用戶還是訪客)的購(gòu)物清單
/// </summary>
private void ShoppingCartList()
{
// 獲取當(dāng)前用戶的ShoppingCardID
String CartID = pub.GetShoppingCartID();
DataGrid1.DataSource = pub.spShoppingCartList(CartID);
DataGrid1.DataBind();
DispInfo(CartID);
}
private void DispInfo(String CartID)
{
lbTotal.Text = String.Format("{0:c}", pub.spShoppingCartTotal(CartID));
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:該調(diào)用是 ASP.NET Web 窗體設(shè)計(jì)器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內(nèi)容。
/// </summary>
private void InitializeComponent()
{
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
// 最終確認(rèn)用戶的購(gòu)物車ID
String CartID = pub.GetShoppingCartID();
// 最終確認(rèn)用戶唯一標(biāo)識(shí)
String CustomerId = User.Identity.Name;
if (((CartID != null) && (CustomerId != null)) || ((CartID != "") && (CustomerId != "")))
{
// 此時(shí)將購(gòu)物車轉(zhuǎn)入客戶訂單之中
int OrderId = pub.spOrdersInsert(Int32.Parse(CustomerId), CartID, TextBox1.Text.Trim());
lbMsg.Text="系統(tǒng)提示: 祝賀您, 您的訂單已經(jīng)成功發(fā)送, 我們的工作人員正在處理您的訂單,請(qǐng)稍候......!";
lbMsg.Text = "<br><b>請(qǐng)記下您的訂單號(hào): </b>" + OrderId;
ImageButton1.Visible = false;
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -