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 WebClassOne;

namespace Asp600.AboutAdmin.AdminCounter
{
	/// <summary>
	/// admin_counter_ip 的摘要说明。
	/// </summary>
	public class admin_counter_ip : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.HyperLink HyperLink2;
		protected System.Web.UI.WebControls.Repeater Repeater1;
		protected Wuqi.Webdiyer.AspNetPager AspNetPager1;
		public AboutCounter counterabout=new AboutCounter();
		public int allcount;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
		
			if(!Page.IsPostBack)
			{
				DataBindChannel();
			}				
			AspNetPager1.RecordCount=counterabout.CountListCount("Count_Visitor");
			allcount=AspNetPager1.RecordCount;
			DataBindChannel();
		}
		public void DataBindChannel()
		{  		
			DataSet newslist=new DataSet();
			int repeatestr1=AspNetPager1.PageSize*(AspNetPager1.CurrentPageIndex-1);
			int repeatestr2=AspNetPager1.PageSize;
			newslist=counterabout.CountList("Count_Visitor",repeatestr1,repeatestr2);
			Repeater1.DataSource=newslist.Tables["Count_Visitor"];
			Repeater1.DataBind();	

			//动态设置用户自定义文本内容
			AspNetPager1.CustomInfoText="记录总数：<b>"+AspNetPager1.RecordCount.ToString()+"</b>";
			AspNetPager1.CustomInfoText+=" 总页数：<b>"+AspNetPager1.PageCount.ToString()+"</b>";
			AspNetPager1.CustomInfoText+=" 当前页：<font color=\"red\"><b>"+AspNetPager1.CurrentPageIndex.ToString()+"</b></font>";
		}
		private void AspNetPager1_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
		{
			AspNetPager1.CurrentPageIndex=e.NewPageIndex;
			DataBindChannel();
		}


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

		}
		#endregion
	}
}
