📄 specials.cs
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
using PowerEasy.AccessManage;
using PowerEasy.Common;
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Enumerations;
using PowerEasy.Model.AccessManage;
using PowerEasy.Model.Contents;
using PowerEasy.Model.UserManage;
using PowerEasy.ModelControls;
using PowerEasy.Templates;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Specials : AdminPage
{
protected TextBox Custom_Content1;
protected TextBox Custom_Content10;
protected TextBox Custom_Content11;
protected TextBox Custom_Content12;
protected TextBox Custom_Content13;
protected TextBox Custom_Content14;
protected TextBox Custom_Content15;
protected TextBox Custom_Content16;
protected TextBox Custom_Content17;
protected TextBox Custom_Content18;
protected TextBox Custom_Content19;
protected TextBox Custom_Content2;
protected TextBox Custom_Content20;
protected TextBox Custom_Content3;
protected TextBox Custom_Content4;
protected TextBox Custom_Content5;
protected TextBox Custom_Content6;
protected TextBox Custom_Content7;
protected TextBox Custom_Content8;
protected TextBox Custom_Content9;
protected DropDownList DropCustomNum;
protected DropDownList DropSpecialCategory;
protected Button EBtnAdd;
protected Button EBtnModify;
protected ExtendedGridView EgvPermissions;
protected ExtendedGridView EgvRoleView;
protected TemplateSelectControl FileCSearchTemplatePath;
protected TemplateSelectControl FileCSpecialTemplatePath;
protected HiddenField HdnOrderId;
protected HiddenField HdnSpecialDir;
protected HiddenField HdnSpecialName;
protected HtmlTableRow objFiles1;
protected HtmlTableRow objFiles10;
protected HtmlTableRow objFiles11;
protected HtmlTableRow objFiles12;
protected HtmlTableRow objFiles13;
protected HtmlTableRow objFiles14;
protected HtmlTableRow objFiles15;
protected HtmlTableRow objFiles16;
protected HtmlTableRow objFiles17;
protected HtmlTableRow objFiles18;
protected HtmlTableRow objFiles19;
protected HtmlTableRow objFiles2;
protected HtmlTableRow objFiles20;
protected HtmlTableRow objFiles3;
protected HtmlTableRow objFiles4;
protected HtmlTableRow objFiles5;
protected HtmlTableRow objFiles6;
protected HtmlTableRow objFiles7;
protected HtmlTableRow objFiles8;
protected HtmlTableRow objFiles9;
protected ComboBox PagePostfix;
protected Panel PnlCustomFileds;
protected RadioButtonList RadlCreatHtml;
protected RadioButtonList RadlIsElite;
protected RadioButtonList RadlListPageHtmlDirType;
protected RadioButtonList RadOpenType;
protected RegularExpressionValidator RegularExpressionValidator1;
protected PowerEasy.Controls.RequiredFieldValidator RequiredFieldValidator1;
protected ExtendedSiteMapPath SmpNavigator;
private int specialCategoryId;
private int specialId;
protected HtmlTableCell TabTitle1;
protected HtmlTableCell TdGroupPermissions;
protected HtmlTableCell TdRolePermissions;
protected TextBox TxtDescription;
protected TextBox TxtSpecialDir;
protected TextBox TxtSpecialIdentifier;
protected TextBox TxtSpecialName;
protected TextBox TxtSpecialPic;
protected TextBox TxtSpecialTips;
protected PowerEasy.Controls.RequiredFieldValidator ValrSpecialIdentifier;
protected PowerEasy.Controls.RequiredFieldValidator ValrSpecialName;
private static void AppendSelectId(bool isChecked, StringBuilder roleIdList, string selectId)
{
if (isChecked)
{
StringHelper.AppendString(roleIdList, selectId);
}
}
private void BindSpecial()
{
SpecialInfo specialInfoById = Special.GetSpecialInfoById(this.specialId, true);
if (specialInfoById.IsNull)
{
AdminPage.WriteErrMsg("发生错误,请传入正确的专题ID!");
}
BasePage.SetSelectedIndexByValue(this.DropSpecialCategory, specialInfoById.SpecialCategoryId.ToString());
this.TxtSpecialName.Text = specialInfoById.SpecialName;
this.TxtSpecialIdentifier.Text = specialInfoById.SpecialIdentifier;
this.TxtSpecialDir.Enabled = false;
string[] strArray = specialInfoById.SpecialDir.Split(new char[] { '/' });
if (strArray.Length > 1)
{
this.TxtSpecialDir.Text = strArray[1];
}
else
{
this.TxtSpecialDir.Text = strArray[0];
}
this.TxtSpecialPic.Text = specialInfoById.SpecialPic;
this.TxtSpecialTips.Text = specialInfoById.SpecialTips;
this.TxtDescription.Text = specialInfoById.Description;
this.RadlIsElite.SelectedValue = specialInfoById.IsElite.ToString();
BasePage.SetSelectedIndexByValue(this.RadOpenType, specialInfoById.OpenType.ToString());
this.FileCSpecialTemplatePath.Text = specialInfoById.SpecialTemplatePath;
this.FileCSearchTemplatePath.Text = specialInfoById.SearchTemplatePath;
BasePage.SetSelectedIndexByValue(this.RadlCreatHtml, specialInfoById.IsCreateListPage.ToString());
this.PagePostfix.Value = specialInfoById.ListPagePostfix;
BasePage.SetSelectedIndexByValue(this.RadlListPageHtmlDirType, specialInfoById.ListPageSavePathType.ToString());
int num = 1;
if (!string.IsNullOrEmpty(specialInfoById.CustomContent))
{
string[] strArray2 = specialInfoById.CustomContent.Split(new string[] { "{#$$$#}" }, StringSplitOptions.None);
int num2 = 1;
foreach (string str in strArray2)
{
num = num2;
((TextBox) this.PnlCustomFileds.FindControl("Custom_Content" + num2)).Text = str;
((HtmlTableRow) this.PnlCustomFileds.FindControl("objFiles" + num2)).Attributes.Add("style", "display: ''");
num2++;
}
}
((DropDownList) this.PnlCustomFileds.FindControl("DropCustomNum")).SelectedValue = num.ToString();
this.HdnSpecialName.Value = specialInfoById.SpecialName;
this.HdnSpecialDir.Value = specialInfoById.SpecialDir;
this.HdnOrderId.Value = specialInfoById.OrderId.ToString();
}
protected void EBtnAdd_Click(object sender, EventArgs e)
{
if (this.Page.IsValid)
{
SpecialInfo specialInfo = this.GetSpecialInfo();
if (Special.ExistsSpecialName(specialInfo.SpecialName))
{
AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "");
}
if (Special.ExistsSpecialDir(specialInfo.SpecialDir))
{
AdminPage.WriteErrMsg("<li>此专题目录已经存在,请输入其它的目录名!</li>", "");
}
if (Special.AddSpecial(specialInfo))
{
this.InputPermissions(specialInfo.SpecialId);
this.InputRolePermission(specialInfo.SpecialId);
IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "Special.aspx?SpecialCategoryID=" + this.specialCategoryId.ToString());
}
else
{
AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "");
}
}
}
protected void EBtnModify_Click(object sender, EventArgs e)
{
if (this.Page.IsValid)
{
SpecialInfo specialInfo = this.GetSpecialInfo();
specialInfo.SpecialId = this.specialId;
specialInfo.OrderId = DataConverter.CLng(this.HdnOrderId.Value);
string specialName = specialInfo.SpecialName;
if ((specialName != this.HdnSpecialName.Value) && Special.ExistsSpecialName(specialName))
{
AdminPage.WriteErrMsg("<li>此专题名已经存在,请输入其它的专题名!</li>", "Special.aspx");
}
if (Special.UpdateSpecial(specialInfo))
{
this.InputPermissions(specialInfo.SpecialId);
this.InputRolePermission(specialInfo.SpecialId);
IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "SpecialManage.aspx");
}
else
{
AdminPage.WriteErrMsg("<li>专题信息保存失败!</li>", "SpecialManage.aspx");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -