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

📄 orderprocess.aspx.cs

📁 ASP.net网站开发四“酷”全书:新闻、论坛、电子商城、博客_源码
💻 CS
字号:
using BookShop.Model;
using BookShop.BLL;
using BookShop.Web.Controls;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BookShop.Web {
	public class OrderProcess : Page {

		protected StaticAddress statAddrBill;
		protected StaticAddress statAddrShip;
		protected Repeater cart;
		protected NavBar header;
		protected System.Web.UI.WebControls.Label lblOrderDate;
		protected System.Web.UI.WebControls.Label lblUserId;
		protected System.Web.UI.WebControls.Label lblOrderId;
		protected System.Web.UI.WebControls.Label lblCardType;
		protected System.Web.UI.WebControls.Label lblCardExpiration;
		protected System.Web.UI.WebControls.Label lblCardNumber;
		protected System.Web.UI.WebControls.Label lblOrderTotal;

		protected OrderInfo myOrder;

		private void InitializeComponent() {}

		override protected void OnLoad(EventArgs e) {

			ProcessFlow.CartController cartController = new ProcessFlow.CartController();

			OrderInfo newOrder = cartController.PurchaseCart();

			//Display the order info to the user
			lblOrderId.Text = newOrder.OrderId.ToString();
			lblOrderDate.Text = newOrder.Date.ToLongDateString();;
			lblUserId.Text = newOrder.UserId;
			lblCardType.Text = newOrder.CreditCard.CardType;
			lblCardNumber.Text = newOrder.CreditCard.CardNumber;
			lblCardExpiration.Text = newOrder.CreditCard.CardExpiration;
			
			statAddrBill.address = newOrder.BillingAddress;
			statAddrShip.address = newOrder.ShippingAddress;
			
			cart.DataSource = newOrder.LineItems;
			cart.DataBind();

			lblOrderTotal.Text = newOrder.OrderTotal.ToString("c");
		}
	}
}

⌨️ 快捷键说明

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