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

📄 photo.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.Configuration;
using Club.Framework.Data;
namespace Club.Home
{
	/// <summary>
	/// photo 的摘要说明。
	/// </summary>
	public class photo : System.Web.UI.Page
	{
		protected Club.Common.WebUI.ContentRegion titleContains;
		protected Club.Common.WebUI.ContentRegion headerContains;
		protected Club.Common.WebUI.ContentRegion Content;
		protected System.Web.UI.WebControls.Repeater rptMenu;
		protected Club.Common.WebUI.SitePage PageManage;
		protected Club.Common.GetRequestPage photoPage;
		protected int SortType;
		protected string Title=string.Empty;
		protected int RegisterId
		{
			get
			{
				if(Request.Params["RegisterId"]==null||Request.Params["RegisterId"]=="")
				{
					return 0;
				}
				return int.Parse(Request.Params["RegisterId"]);
			}
		}
		protected int PhotoType
		{
			get
			{
				if(Request.Params["PhotoType"]==null||Request.Params["PhotoType"]=="")
				{
					return 1;
				}
				return int.Parse(Request.Params["PhotoType"]);
			}
		}
		protected int SortID
		{
			get
			{
				if(Request.Params["SortID"]==null||Request.Params["SortID"]=="")
				{
					return 0;
				}
				return int.Parse(Request.Params["SortID"]);
			}
		}
		protected int PageIndex
		{
			get
			{
				if(Request.Params["PageIndex"]==null||Request.Params["PageIndex"]=="")
				{
					return 1;
				}
				return int.Parse(Request.Params["PageIndex"]);
			}
		}
		protected int LoginRegisterId
		{
			get
			{
				try
				{
					return FormSecurity.GetMemberId();
				}
				catch
				{
					return 0;
				}
			}
		}
		private c_UserInfo userInfo;
		protected c_UserInfo UserInfo
		{
			get
			{
				return userInfo;
			}
		}
		private c_SortInfo sort;
		protected c_SortInfo Sort
		{
			get
			{
				return sort;
			}
		}
		private c_HomeSettingInfo setting;
		protected c_HomeSettingInfo Setting
		{
			get
			{
				return this.setting;
			}
		}
		private void Page_Load(object sender, System.EventArgs e)
		{
			if(this.RegisterId==0)
			{
				throw new ShowException("对不起!没有找到该用户网站!",Globals.UrlFormats.Home());
			}
			this.userInfo=Globals.DbProvider.Select_c_UserByID(this.RegisterId);
			this.setting=Globals.DbProvider.Select_c_HomeSettingByRegisterID(this.RegisterId);

			this.sort = Globals.DbProvider.Select_c_SortByID(this.SortID);
			if(this.setting==null)
			{
				throw new ShowException("您的网站还未设置,请在个人管理设置!",Globals.UrlFormats.Home());
			}
			//如果不是用户本人并关闭网站提示
			if(!setting.IsOpen&&this.RegisterId!=this.LoginRegisterId)
			{
				throw new ShowException("该网站已经关闭!",Globals.UrlFormats.Home());
			}
			if(setting.SiteTitle==null||setting.SiteTitle=="")
			{
				setting.SiteTitle = UserInfo.NiceName + "的网上家园";
			}
			if(this.PhotoType==1)
			{
				this.SortType = 1;
				Title =setting.SiteTitle+"-照片";
			}
			else if(this.PhotoType==2)
			{
				this.SortType = 2;
				Title =setting.SiteTitle+"-图片";
			}
			if(this.Sort==null)
			{
				if(this.PhotoType==1)
				{
					Title+= "-所有照片";
				}
				else
				{
					Title += "-所有图片";
				}
			}
			else
			{
				Title += "-"+this.Sort.SortName;
			}
			this.bindMenu();
			this.getPageBind();
			Page.DataBind();
		}
		private void bindMenu()
		{
			this.rptMenu.DataSource = Globals.DbProvider.Select_c_SortByRegsiterIDAndSortTypeAndIsVisible(this.RegisterId,this.SortType,true);
			this.rptMenu.DataBind();
		}
		private void getPageBind()
		{
			photoPage.TableName = "c_Photo";
			photoPage.PageSize = 16;
			//articlePage.OrderField = "id";
			photoPage.OrderType = true;
			photoPage.IsDataSetPage= false;
			string whereStr="RegisterId="+this.RegisterId;
			if(this.PhotoType!=0)
			{
				whereStr+=" and PhotoType="+this.PhotoType;
			}
			if(this.SortID!=0)
			{
				whereStr+=" and SortID="+this.SortID;
			}
			else
			{
				whereStr+=" and SortId in(Select Id From c_Sort where RegisterId="+this.RegisterId+" and SortType="+this.SortType+" and IsVisible=1)";
			}
			photoPage.WhereString =whereStr;
			photoPage.PageUrlFormatString=Globals.UrlFormats.SitePhoto(this.RegisterId,this.PhotoType,this.SortID,"{0}");
			photoPage.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 + -