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

📄 controlstaticaddress.ascx.cs

📁 PetShop实现的是一个网上购物的系统功能
💻 CS
字号:
namespace PetShop.Web.Inc 
{
	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Diagnostics;
	using System.Collections;

	/// <summary>
	///	Display static (can't edit) address information.
	///	Props:
	///	 UseBilling - true to display billing address, otherwise display shipping address.
	///	 ShowName - true to display the address name, otherwise name is not displayed.
	/// </summary>
	public partial  class ControlStaticAddress : System.Web.UI.UserControl {

		// use billing if true, otherwise use shipping
		public bool UseBilling = true;
		protected System.Web.UI.HtmlControls.HtmlTable TABLE1;
		protected System.Web.UI.HtmlControls.HtmlTable TABLE2;
		public bool ShowName = true;


		/// <summary>
		public ControlStaticAddress() {
			this.Init += new System.EventHandler(Page_Init);
		}

		protected void Page_Load(object sender, System.EventArgs e) {
			if (!IsPostBack) {
				// get address info
				Hashtable adr = (Hashtable)Session["ShoppingAddressSession"];
				Debug.Assert(adr != null);			

				// decide what type of address to display, either billing or shipping
				string prefix = UseBilling ? "Bill" : "Ship";				

				// update fields with info
				lblFirstName.Text = (string)adr[prefix + "_FirstName"];
				lblLastName.Text = (string)adr[prefix + "_LastName"];
				lblAdr1.Text = (string)adr[prefix + "_Address1"];
				lblAdr2.Text = (string)adr[prefix + "_Address2"];
				lblCity.Text = (string)adr[prefix + "_City"];
				lblState.Text = (string)adr[prefix + "_State"];
				lblPostalCode.Text = (string)adr[prefix + "_PostalCode"];
				if(prefix=="Ship")
				{
					ControlDeliveryAddress();
				}
			}
		}

		protected void Page_Init(object sender, EventArgs e) {
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
		}
		private void ControlDeliveryAddress()
		{
			Hashtable adr = (Hashtable)Session["ShoppingAddressSession"];
			int id=Convert.ToInt32(adr["DeliveryMethodID"]);
			bool showdeliveryaddress=new PetShop.Components.DeliveryMethod().GetDeliveryMethodShowDeliveryAddress(id);
			this.tblAddress.Visible=showdeliveryaddress;
		}

		#region Web Form Designer generated code
		///		Required method for Designer support - do not modify
		///		the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{

		}
		#endregion
	}
}

⌨️ 快捷键说明

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