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

📄 houselist.aspx.cs

📁 本系统是二手房交易系统 采用asp.net技术 开发环境是vs2003+sqlServer2000
💻 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.Configuration;
using HouseSystem.Components;

namespace HouseSystem
{
	/// <summary>
	/// HouseList 的摘要说明。
	/// </summary>
	public class HouseList : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Repeater Repeater1;
		protected System.Web.UI.WebControls.Label lblPageInfo;
		protected System.Web.UI.WebControls.HyperLink lnkFirst;
		protected System.Web.UI.WebControls.HyperLink lnkPrev;
		protected System.Web.UI.WebControls.HyperLink lnkNext;
		protected System.Web.UI.WebControls.HyperLink lnkLast;
		protected string strType;
		protected string WebName;
		protected byte bType;
		protected string strTips;

	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			this.WebName = ConfigurationSettings.AppSettings["My_WebName"];
			if (!this.Page.IsPostBack)
			{
				byte num1 = Tools.GetPerPageSize();
				if ((base.Request.QueryString["type"] == null) || (base.Request.QueryString["type"] == ""))
				{
					this.Page.RegisterClientScriptBlock("AlertUrlError", "<script>alert('错误,请尝试从正确的链接进入系统!');</script>");
				}
				else
				{
					int num2;
					string[] textArray1;
					this.bType = byte.Parse(base.Request.QueryString["type"]);
					if (this.bType == 1)
					{
						this.strType = "出租";
					}
					else
					{
						this.strType = "出售";
					}
					DataTable table1 = RentSell.GetHouseList(this.bType);
					PagedDataSource source1 = new PagedDataSource();
					source1.DataSource = table1.DefaultView;
					source1.AllowPaging = true;
					source1.PageSize = num1;
					if (base.Request.QueryString["Page"] != null)
					{
						num2 = Convert.ToInt32(base.Request.QueryString["Page"]);
					}
					else
					{
						num2 = 1;
					}
					source1.CurrentPageIndex = num2 - 1;
					object[] objArray1 = new object[4] { "页次:", num2.ToString(), "/", source1.PageCount } ;
					this.lblPageInfo.Text = string.Concat(objArray1);
					if (source1.IsFirstPage)
					{
						this.lnkFirst.Enabled = false;
						this.lnkPrev.Enabled = false;
					}
					else
					{
						this.lnkFirst.Enabled = true;
						this.lnkPrev.Enabled = true;
						this.lnkFirst.NavigateUrl = base.Request.CurrentExecutionFilePath + "?Page=1&type=" + this.bType.ToString();
						textArray1 = new string[5] { base.Request.CurrentExecutionFilePath, "?Page=", Convert.ToString((int) (num2 - 1)), "&type=", this.bType.ToString() } ;
						this.lnkPrev.NavigateUrl = string.Concat(textArray1);
					}
					if (source1.IsLastPage)
					{
						this.lnkNext.Enabled = false;
						this.lnkLast.Enabled = false;
					}
					else
					{
						this.lnkNext.Enabled = true;
						this.lnkLast.Enabled = true;
						textArray1 = new string[5] { base.Request.CurrentExecutionFilePath, "?Page=", Convert.ToString((int) (num2 + 1)), "&type=", this.bType.ToString() } ;
						this.lnkNext.NavigateUrl = string.Concat(textArray1);
						textArray1 = new string[5] { base.Request.CurrentExecutionFilePath, "?Page=", Convert.ToString(source1.PageCount), "&type=", this.bType.ToString() } ;
						this.lnkLast.NavigateUrl = string.Concat(textArray1);
					}
					this.Repeater1.DataSource = source1;
					this.Repeater1.DataBind();
				}
			}

		}
		public string GetAreaName(int Area_ID)
		{
			return Area.GetAreaNameByID(Area_ID);
		}
 
		public string GetHouseType(int Ht_ID)
		{
			return HouseType.GetHouseTypeByID(Ht_ID);
		}
 
		public string GetPriceUnit(int price, byte type)
		{
			if (price == 0)
			{
				return "面议";
			}
			if (type == 1)
			{
				return (price + "元");
			}
			return (price + "万元");
		}
 

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

		}
		#endregion
	}
}

⌨️ 快捷键说明

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