⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 photolist.aspx.cs

📁 1、用SQL查询器打开install目录下的dooogo.sql运行之后创建数据库dooogo。 2、然后打开web.config修改 <DbProvider type="Club.Fram
💻 CS
字号:
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 Club.Framework;
using Club.Framework.Components;
using Club.Framework.Data;
using Club.Framework.Configuration;
namespace Club.ClubManage
{
	/// <summary>
	/// PhotoList 的摘要说明。
	/// </summary>
	public class PhotoList : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Repeater rptNew;
		protected System.Web.UI.WebControls.Repeater rptHits;
		protected System.Web.UI.WebControls.Repeater rptComment;
		protected int PhotoType
		{
			get
			{
				if(Request.Params["PhotoType"]!=null&&Request.Params["PhotoType"]!=string.Empty)
				{
					return int.Parse(Request.Params["PhotoType"]);
				}
				return 1;
			}
		}

		private void Page_Load(object sender, System.EventArgs e)
		{
			bindNew();
			bindHits();
			bindComment();
		}
		private void bindNew()
		{
			string sql="select top 8 [ID],[PhotoName],[PostDate],[RegisterID],[PhotoType],[ImageName],[Hits],[CommentCount] from c_Photo where PhotoType="+this.PhotoType+" order by postdate desc";
			DataSet ds=Globals.DbProvider.GetDataSet(sql);
			this.rptNew.DataSource=ds;
			this.rptNew.DataBind();
		}
		private void bindHits()
		{
			string sql="select top 8 [ID],[PhotoName],[PostDate],[RegisterID],[PhotoType],[ImageName],[Hits],[CommentCount] from c_Photo where  PhotoType="+this.PhotoType+"  order by hits desc";
			DataSet ds=Globals.DbProvider.GetDataSet(sql);
			this.rptHits.DataSource=ds;
			this.rptHits.DataBind();
		}
		private void bindComment()
		{
			string sql="select top 8 [ID],[PhotoName],[PostDate],[RegisterID],[PhotoType],[ImageName],[Hits],[CommentCount] from c_Photo where  PhotoType="+this.PhotoType+" order by CommentCount desc";
			DataSet ds=Globals.DbProvider.GetDataSet(sql);
			this.rptComment.DataSource=ds;
			this.rptComment.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
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -