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 temp.Admin
{
	/// <summary>
	/// UserDetail 的摘要说明。
	/// </summary>
	public partial class UserAdvDetail : System.Web.UI.Page
	{
	
		protected void Page_Load(object sender, System.EventArgs e)
		{
			if(!Page.IsPostBack)
			{
				if(this.Session["USERNAME"]==null||this.Session["USERNAME"].ToString()=="")
				{
					Response.Redirect("login.aspx");
				}
				else
				{
			
					Bindlist();
				}
					
			}
			



				// 在此处放置用户代码以初始化页面
		}
		
			private void Bindlist()
			{
				
				SB.ADOHelper help=new SB.ADOHelper();
				SqlDataReader rd=help.getReader("select * from AdvHost where UserName='"+Request.Params["name"].ToString()+"'");
				if(rd.Read())
				{
					this.Label1.Text=rd["UserName"].ToString();
					this.Label2.Text=Convert.ToInt32(rd["Appearance"].ToString())==1? "正常":Convert.ToInt32(rd["Appearance"].ToString())==2? "禁用":"待审";
					this.Label3.Text=Convert.ToInt32(rd["UserType"].ToString())==1? "个人":"单位";
					this.Label4.Text=rd["Name"].ToString();
					this.Label21.Text=rd["fax"].ToString();
					this.Label6.Text=rd["Tel"].ToString();	
					this.Label7.Text=rd["Email"].ToString();
					this.Label8.Text=rd["Address"].ToString();
					this.Label9.Text=rd["Postal"].ToString();
					this.Label10.Text=rd["qq"].ToString();
					this.Label11.Text=rd["Company"].ToString();
					this.Label12.Text=rd["url"].ToString();
					this.Label13.Text=rd["Money"].ToString();
					this.Label14.Text=rd["Commission"].ToString();
					this.Label15.Text=rd["RegDate"].ToString();
					this.Label16.Text=rd["Regip"].ToString();
					this.Label17.Text=rd["Register"].ToString();
					this.Label18.Text=rd["RegisterIp"].ToString();
					this.Label19.Text=rd["Remarks"].ToString();
					this.Label20.Text=rd["agent"].ToString();
					this.Label22.Text=rd["CompanyExplain"].ToString();
					rd.Close();
				}
				else
				{
					SB.ADOHelper.alertmsg("用户不存在！","UserSearchadv.aspx");
				}
				
		

			}

		

		
		

		

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

		}
		#endregion

		
	}
}
