⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkout.aspx.cs

📁 中国工商网电子商务购物中心系统EMall 软件介绍: 完全公开源代码,并无任何许可限制,特别基于大型电子商务网站的系统开发 Microsoft SQL Server 2000后台数据库
💻 CS
字号:
///中国工商网.电子商务购物中心系统.EMall
///演示地址:http://emall.skysea.info
///演示界面:http://cs.12986.com/photos/sample/picture150.aspx

///中国工商网 -  http://www.12986.com
///Copyright (c) 1998-2005
///作者: Dili J.F. Senders

///技术支持:如果任何技术问题,请登录中国工商网技术支持网站咨询: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 的摘要说明。
	/// </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)
		{
			// 在此处放置用户代码以初始化页面
			// 其实, 一开始的页面处理还是跟ShoppingCart.aspx一样的
			// 另外, 此时的用户安全认证, 由Web.Config文件已经进行定义
			ShoppingCartList();
		}

		/// <summary>
		/// 显示当前用户(不论是已经登录用户还是访客)的购物清单
		/// </summary>
		private void ShoppingCartList()
		{
			// 获取当前用户的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:该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </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)
		{
			// 最终确认用户的购物车ID
			String CartID = pub.GetShoppingCartID();
			// 最终确认用户唯一标识
			String CustomerId = User.Identity.Name;
			if (((CartID != null) && (CustomerId != null)) || ((CartID != "") && (CustomerId != ""))) 
			{
				// 此时将购物车转入客户订单之中
				int OrderId = pub.spOrdersInsert(Int32.Parse(CustomerId), CartID, TextBox1.Text.Trim());

				lbMsg.Text="系统提示: 祝贺您, 您的订单已经成功发送, 我们的工作人员正在处理您的订单,请稍候......!";
				lbMsg.Text = "<br><b>请记下您的订单号: </b>" + OrderId;
				ImageButton1.Visible = false;
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -