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_browser 的摘要说明。
	/// </summary>
	public class admin_counter_browser : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.HyperLink HyperLink2;
        public AboutCounter counterabout=new AboutCounter();
		protected System.Web.UI.WebControls.Repeater Repeater1;
		public int pcount1;
		public DataSet dsadmin;
		public DataSet dsadmin1;
		public int SumCount;
		public int MaxCount;
		public int LeftPx;
		public int getlength(int o)
		{
			if (MaxCount ==0) 
			{
				LeftPx = 0;
			}
			else
			{
				LeftPx = Convert.ToInt32((250*o)/MaxCount);
			}
			return 1+LeftPx;
		}
		public int getlength1(int o)
		{
			if (MaxCount ==0) 
			{
				LeftPx = 0;
			}
			else
			{
				LeftPx = Convert.ToInt32((250*o)/MaxCount);
			}
			return 250-LeftPx;
		}
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			pcount1=(int)counterabout.SelectCountBOL("Count_Browser");
			if (pcount1!=0)
			{
				dsadmin=new DataSet();			
				dsadmin=counterabout.CountBOLList("Count_Browser");			
				MaxCount=(int)counterabout.SelectMaxCountBOL("Count_Browser");				
				dsadmin1=counterabout.SelectSumCountBOL("Count_Browser");
	            SumCount=Convert.ToInt32(dsadmin1.Tables["Count_Browser"].Rows[0][0].ToString());
				Repeater1.DataSource=dsadmin.Tables["Count_Browser"];
				Repeater1.DataBind();	
			}	
		}

		#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
	}
}
