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 yn165.admin
{
	/// <summary>
	/// ad_viewuser 的摘要说明。
	/// </summary>
	public class ad_viewuser : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label accout;
		protected System.Web.UI.WebControls.Label pass;
		protected System.Web.UI.WebControls.Label question;
		protected System.Web.UI.WebControls.Label reply;
		protected System.Web.UI.WebControls.Label name;
		protected System.Web.UI.WebControls.Label ename;
		protected System.Web.UI.WebControls.Label unit;
		protected System.Web.UI.WebControls.Label eunit;
		protected System.Web.UI.WebControls.Label unit_py;
		protected System.Web.UI.WebControls.Label unit_abr;
		protected System.Web.UI.WebControls.Label sex;
		protected System.Web.UI.WebControls.Label province;
		protected System.Web.UI.WebControls.Label city;
		protected System.Web.UI.WebControls.Label ecity;
		protected System.Web.UI.WebControls.Label address;
		protected System.Web.UI.WebControls.Label eaddress;
		protected System.Web.UI.WebControls.Label mobile;
		protected System.Web.UI.WebControls.Label tel;
		protected System.Web.UI.WebControls.Label fax;
		protected System.Web.UI.WebControls.Label email;
		protected System.Web.UI.WebControls.Label slevel;
		protected System.Web.UI.WebControls.Label post;
		protected System.Web.UI.WebControls.Label reg_date;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			SqlConnection conn = new SqlConnection("server=211.155.254.117;database=yn165;uid=yn165;pwd=159753");
			conn.Open();
			string sql ="select * from user_reg where account like '" + Request["account"].ToString() + "%'";
			SqlCommand cmd = new SqlCommand(sql,conn);
			SqlDataReader reader = cmd.ExecuteReader();
			if(reader.Read())
			{
				this.accout.Text=reader.GetValue(1).ToString();
				this.pass.Text=reader.GetValue(2).ToString();
				this.question.Text=reader.GetValue(3).ToString();
				this.reply.Text=reader.GetValue(4).ToString();
				this.name.Text=reader.GetValue(5).ToString();
				this.ename.Text=reader.GetValue(6).ToString();
				this.unit.Text=reader.GetValue(7).ToString();
				this.eunit.Text=reader.GetValue(8).ToString();
				this.unit_py.Text=reader.GetValue(9).ToString();
				this.unit_abr.Text=reader.GetValue(10).ToString();
				this.sex.Text=reader.GetValue(11).ToString();
				this.province.Text=reader.GetValue(12).ToString();
				this.city.Text=reader.GetValue(13).ToString();
				this.ecity.Text=reader.GetValue(14).ToString();
				this.address.Text=reader.GetValue(15).ToString();
				this.eaddress.Text=reader.GetValue(16).ToString();
				this.post.Text=reader.GetValue(17).ToString();
				this.tel.Text=reader.GetValue(18).ToString();
				this.mobile.Text=reader.GetValue(19).ToString();
				this.fax.Text=reader.GetValue(20).ToString();
				this.email.Text=reader.GetValue(21).ToString();
				this.slevel.Text=reader.GetValue(22).ToString();
				this.reg_date.Text=reader.GetValue(23).ToString();		
			}
			reader.Close();
			cmd.Dispose();
			conn.Close();
			
			// 在此处放置用户代码以初始化页面
		}

		#region Web Form Designer generated code
		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
	}
}
