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

📄 prodetails.aspx.cs

📁 源码实现Internet购物的数据库设计代码以及相应的操作界面。通过本程序可以了解数据库的存储过程内容和WEB程序的设计。
💻 CS
字号:
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;
using System.Web.Security;


namespace StoreOnline
{
	/// <summary>
	/// ProDetail 的摘要说明。
	/// </summary>
	public partial class ProDetail : System.Web.UI.Page
	{
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			int ProID = Int32.Parse(Request.Params["ProID"]);

			//获取商品的详细信息
			StoreOnline.StoreDBO ProDetail = new StoreOnline.StoreDBO();
			StoreOnline.ProDetails myProDetails = ProDetail.GetProDetails(ProID);

			// 根据上面获取的商品详细信息更新页面控件的显示内容
			Dec.Text = myProDetails.Description;
			ProPrice.Text = String.Format("{0:c}", myProDetails.ProPrice);
			ProName.Text = myProDetails.ProName;
			MarketPrice.Text =String.Format("{0:c}", myProDetails.ProMarketPrice);
			ProImage.ImageUrl = "ProImages/thumbs/" + myProDetails.ProPicture;
			addToCart.NavigateUrl = "AddToCart.aspx?ProID=" + ProID;

			//获取当前ASP.NET请求的HttpContext
			System.Web.HttpContext thecontext = System.Web.HttpContext.Current;
			
			if (thecontext.User.Identity.Name != "") 
			{
				welcome.Text=thecontext.Request.Cookies["Store_UserName"].Value + "欢迎您";
				welcome.Visible=true;
			}
			else
			{
				welcome.Visible=false;
			}

		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    

		}
		#endregion
	}
}

⌨️ 快捷键说明

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