📄 favoriteshow.aspx.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.Skin
{
/// <summary>
/// FavoriteShow 的摘要说明。
/// </summary>
public class favoriteShow : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Repeater rptList;
protected System.Web.UI.WebControls.Repeater rptMenu;
private const int SORT_TYPE=3;
protected int SortID
{
get
{
if(Request.Params["SortID"]!=null&&Request.Params["SortID"]!=string.Empty)
{
return int.Parse(Request.Params["SortID"]);
}
return 0;
}
}
protected int PageSize
{
get
{
if(Request.Params["PageSize"]!=null&&Request.Params["PageSize"]!=string.Empty)
{
return int.Parse(Request.Params["PageSize"]);
}
return 15;
}
}
protected int PageIndex
{
get
{
if(Request.Params["PageIndex"]!=null&&Request.Params["PageIndex"]!=string.Empty)
{
return int.Parse(Request.Params["PageIndex"]);
}
return 1;
}
}
protected int MaxPage
{
get
{
int maxPage=this.rowCount/this.PageSize;
if(this.rowCount%this.PageSize>0)
{
maxPage++;
}
return maxPage;
}
}
protected int RegisterId
{
get
{
if(FormSecurity.GetAdminLoginId()!=0)
{
return FormSecurity.GetAdminLoginId();
}
return FormSecurity.GetMemberId();
}
}
private int rowCount;
protected int RowCount
{
get
{
return this.rowCount;
}
set
{
this.rowCount=value;
}
}
protected string SelectButton
{
get
{
string reStr=string.Empty;
for(int i=1;i<=this.MaxPage;i++)
{
reStr+="<option value=\""+i+"\" "+(i==this.PageIndex?"Selected":"")+">"+i+"</option>\n";
}
return reStr;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
bindMenu();
bindList();
}
private void bindMenu()
{
this.rptMenu.DataSource = Globals.DbProvider.Select_c_SortByRegsiterIDAndSortType(this.RegisterId,SORT_TYPE);
this.rptMenu.DataBind();
}
private void bindList()
{
string strWhere="RegisterId="+this.RegisterId+(this.SortID==0?"":" and SortID="+this.SortID);
this.rptList.DataSource = Globals.DbProvider.Select_c_FavoriteByPage(this.PageSize,this.PageIndex,strWhere,out rowCount);
this.rptList.DataBind();
}
protected string getSortList()
{
c_SortCollection _c_SortCollection=Globals.DbProvider.Select_c_SortByRegsiterIDAndSortType(this.RegisterId,SORT_TYPE);
string reStr=string.Empty;
for(int i=0;i<_c_SortCollection.Count;i++)
{
if(this.SortID!=_c_SortCollection[i].ID)
{
reStr+="<option value=\""+_c_SortCollection[i].ID+"\" >"+_c_SortCollection[i].SortName+"</option>\n";
}
}
return reStr;
}
#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 + -