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;

namespace DTable_App.DTableBBS
{
	/// <summary>
	/// showuser 的摘要说明。
	/// </summary>
	public class showuser : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label L_bbsname;
		protected System.Web.UI.WebControls.Label L_user;
		protected System.Web.UI.WebControls.Label L_hideinput;
		protected System.Web.UI.WebControls.Label L_info;
		protected System.Web.UI.WebControls.Label L_link;
		protected System.Web.UI.WebControls.Label L_frame;
		protected dtable.dTable DTable1;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
			L_bbsname.Text =sharecode.strBBSName;
			DTable1.TableName="DTable_User";
			DTable1.ConnStr =sharecode.ConnStr;
			DTable1.Page_Pos=1; 
			string strusername=sharecode.GetQueryStringValue("username");
			string strorderby=sharecode.GetQueryStringValue("orderby");
			if(strorderby!="")//发帖排行
			{
DTable1.List_SQL="select a.id,a.用户名 as 用户,a.性别,a.邮箱,a.门派,a.登录次数,(select count(*) from DTable_BBS b where b.发布人=a.用户名) as 发贴数 from DTable_User a order by 7 desc";
			}
			else if(strusername!="")//查询
			{
				DTable1.List_SQL="select id,用户名 as 用户,性别,邮箱,门派,登录次数,(select count(*) from DTable_BBS b where b.发布人=用户名) as 发帖数 from DTable_User where 用户名 like '%" + strusername + "%' order by id desc";
			}
			else
			{
				DTable1.List_SQL="select id,用户名 as 用户,性别,邮箱,门派,登录次数,(select count(*) from DTable_BBS b where b.发布人=用户名) as 发贴数 from DTable_User order by id desc";
			}
		
			DTable1.List_FieldFormat="2||boolean|男|女|||";
			
			DTable1.List_Sty_Title="align=center style='color:#FFFFFF;background-image:url(img_bbs/bg1.gif)'"; 
			DTable1.List_Sty_Table=" width='100%' border=\"1\" cellpadding=\"3\" cellspacing='0' bordercolor='#111111' bordercolorlight='#666688' bordercolordark='#666688' style='border-collapse: collapse' align='center'"; 
		     DTable1.Show_FieldList="id,用户名,性别,邮箱,个人爱好,头像,签名,手机号码,积分,门派,登录次数,最后一次登录,注册时间"; 
			DTable1.Show_FieldFormat="2||boolean|男|女||||^5||urlimage|./img_face/||||"; 
			DTable1.Show_Sty=true;
			string strid=sharecode.GetQueryStringValue("mviewid");
			if(strid!="")
			{
				L_frame.Text="用户帖子列表:<hr height=1><IFRAME id=\"showUserRcd\" name=\"showimg\" hspace=\"0\" vspace=\"0\" src=\"showUserRcd.aspx?User_ID=" + strid + "\" frameBorder=\"0\" width=\"100%\" scrolling=\"auto\" height=\"100%\"></IFRAME>";
			}
			
		}

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