📄 specialindex.cs
字号:
namespace PowerEasy.WebSite
{
using PowerEasy.Common;
using PowerEasy.Contents;
using PowerEasy.Model.Contents;
using PowerEasy.Model.TemplateProc;
using PowerEasy.Templates;
using PowerEasy.Web.UI;
using System;
using System.Collections.Specialized;
using System.Text;
using System.Web;
using System.Web.UI;
public class SpecialIndex : DynamicPage
{
private SpecialCategoryInfo specialCategoryInfo;
private SpecialInfo specialInfo;
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
int specialId = BasePage.RequestInt32("id");
switch (BasePage.RequestStringToLower("action"))
{
case "special":
this.specialInfo = Special.GetSpecialInfoById(specialId);
break;
case "specialcategory":
this.specialCategoryInfo = Special.GetSpecialCategoryInfoById(specialId);
break;
}
}
protected override void Render(HtmlTextWriter writer)
{
string str = BasePage.RequestStringToLower("action");
string templatePath = "";
string str3 = str;
if (str3 != null)
{
if (!(str3 == "special"))
{
if (str3 == "specialcategory")
{
if (this.specialCategoryInfo.IsNull)
{
DynamicPage.WriteErrMsg("您查看的专题类别不存在!", base.BasePath + "Default.aspx");
}
templatePath = this.specialCategoryInfo.SpecialTemplatePath;
goto Label_00A9;
}
}
else
{
if (this.specialInfo.IsNull)
{
DynamicPage.WriteErrMsg("您查看的专题不存在!", base.BasePath + "Default.aspx");
}
templatePath = this.specialInfo.SpecialTemplatePath;
goto Label_00A9;
}
}
templatePath = base.TemplatePath;
Label_00A9:
if (!string.IsNullOrEmpty(templatePath))
{
TemplateInfo templateInfo = new TemplateInfo();
templateInfo.QueryList = base.Request.QueryString;
NameValueCollection queryString = base.Request.QueryString;
StringBuilder builder = new StringBuilder();
if (queryString.Count > 3)
{
for (int i = 2; i < queryString.Count; i++)
{
builder.Append(queryString[i]);
builder.Append("&");
}
}
templateInfo.PageName = "index_{$pageid/}.aspx";
if (!string.IsNullOrEmpty(builder.ToString()))
{
templateInfo.PageName = templateInfo.PageName + "?" + builder.ToString();
}
templateInfo.PageType = 1;
templateInfo.TemplateContent = Template.GetTemplateContent(templatePath);
templateInfo.RootPath = HttpContext.Current.Request.PhysicalApplicationPath;
templateInfo.CurrentPage = DataConverter.CLng(base.Request.QueryString["page"], 1);
templateInfo.IsDynamicPage = true;
templateInfo = TemplateTransform.GetHtml(templateInfo);
writer.Write(templateInfo.TemplateContent);
}
else
{
DynamicPage.WriteErrMsg("您查看的专题未设置模板!", base.BasePath + "Default.aspx");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -