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.Data.SqlClient;

namespace free.bbs
{
	/// <summary>
	/// Summary description for fatiepaihang.
	/// </summary>
	public class fatiepaihang : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label shijian;
		protected System.Web.UI.WebControls.Label time;
		
		
		DateTime now=DateTime.Now;
		protected System.Web.UI.WebControls.DataGrid mydatagrid;
		DateTime now2=DateTime.Now;
		DateTime now3=DateTime.Today;
		protected System.Data.SqlClient.SqlConnection myconn;	
		protected System.Data.SqlClient.SqlCommand mycomm;

		private void bangding()
		{
			
			DataSet mydataset=new DataSet();
			string mysql="SELECT top 30 yonghuming,dengji,fatieshu,qq,email  FROM huiyuan  WHERE fatieshu!=0  order by fatieshu desc";
			myconn=new SqlConnection(Session["str_connection"].ToString());
			myconn.Open();
			SqlDataAdapter myadapter=new SqlDataAdapter(mysql,myconn);
			myadapter.Fill(mydataset,"huiyuan");
			mydatagrid.DataSource = mydataset.Tables["huiyuan"].DefaultView;
			mydatagrid.DataBind();
			myconn.Close();
		}
		public void ChangePage(Object sender,DataGridPageChangedEventArgs e)
		{
			mydatagrid.CurrentPageIndex = e.NewPageIndex;
			bangding();
		}
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			shijian.Text=now.ToString("yyyy-MM-dd");
			time.Text=now2.ToString("hh:mm");
			bangding();
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion
	}
}
