📄 contentmanagenavigation.cs
字号:
namespace PowerEasy.WebSite.Controls
{
using AjaxControlToolkit;
using PowerEasy.AccessManage;
using PowerEasy.CommonModel;
using PowerEasy.Components;
using PowerEasy.Contents;
using PowerEasy.Enumerations;
using PowerEasy.ExtendedControls;
using PowerEasy.Model.Contents;
using PowerEasy.Web.UI;
using System;
using System.Data;
using System.Web.UI.WebControls;
public class ContentManageNavigation : BaseUserControl
{
protected DropDownExtender Adrp;
protected ExtendedNodeLinkButton ELnkCheckContent;
protected ExtendedNodeLinkButton ELnkContentList;
protected ExtendedNodeLinkButton ELnkContentRecycle;
protected ExtendedLinkButton ELnkHtmlManage;
protected ExtendedLinkButton ELnkReplace;
protected ExtendedLinkButton ELnkSiginManage;
protected HyperLink HlkModel;
protected Label LblAddContent;
protected Literal LitSeparator;
protected Panel PnlSelectModelMenu;
protected Repeater RptModelList;
protected void ELnkCheckContent_Click(object sender, EventArgs e)
{
BaseUserControl.ResponseRedirect("ContentManage.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString() + "&Status=101&ListType=0");
}
protected void ELnkContentList_Click(object sender, EventArgs e)
{
BaseUserControl.ResponseRedirect("ContentManage.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
}
protected void ELnkContentRecycle_Click(object sender, EventArgs e)
{
BaseUserControl.ResponseRedirect("ContentRecycle.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
}
protected void ELnkHtmlManage_Click(object sender, EventArgs e)
{
int num = BaseUserControl.RequestInt32("NodeID");
if (num > 0)
{
BaseUserControl.ResponseRedirect("ContentHtml.aspx?NodeID=" + num.ToString());
}
else
{
BaseUserControl.ResponseRedirect("ContentHtml.aspx");
}
}
protected void ELnkReplaceManage_Click(object sender, EventArgs e)
{
BaseUserControl.ResponseRedirect("ContentBatchModfiy.aspx");
}
protected void ELnkSiginManage_Click(object sender, EventArgs e)
{
BaseUserControl.ResponseRedirect("ContentSignin.aspx?NodeID=" + BaseUserControl.RequestInt32("NodeID").ToString());
}
protected void Page_Load(object sender, EventArgs e)
{
string basePath = "";
basePath = base.BasePath;
basePath = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + basePath;
this.Adrp.DropArrowImageUrl = basePath + "Admin/Images/sitelist.gif";
int nodeId = BaseUserControl.RequestInt32("NodeID");
bool isSuperAdmin = PEContext.Current.Admin.IsSuperAdmin;
bool flag2 = false;
bool flag3 = false;
bool flag4 = false;
if (!isSuperAdmin)
{
string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput);
string str3 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentCheck);
string str4 = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
if (nodeId > 0)
{
string str5 = nodeId.ToString();
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(nodeId);
if (cacheNodeById.IsNull)
{
BaseUserControl.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
}
if (cacheNodeById.ParentId > 0)
{
str5 = str5 + "," + cacheNodeById.ParentPath;
}
flag3 = RolePermissions.CheckNodePurview(str3, str5);
flag4 = RolePermissions.CheckNodePurview(str4, str5);
flag2 = RolePermissions.CheckNodePurview(roleNodeId, str5);
}
else
{
flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1);
flag4 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1);
}
if (!flag2)
{
this.LblAddContent.Enabled = false;
}
if (!flag4)
{
this.ELnkContentList.Enabled = false;
this.ELnkContentRecycle.Enabled = false;
this.ELnkHtmlManage.Enabled = false;
}
if (!flag3)
{
this.ELnkCheckContent.Enabled = false;
}
}
if ((nodeId > 0) && ((flag2 || flag4) || isSuperAdmin))
{
DataTable contentModelListByNodeId = ModelManager.GetContentModelListByNodeId(nodeId, true);
if (contentModelListByNodeId.Rows.Count <= 1)
{
this.LblAddContent.Visible = false;
}
else
{
this.RptModelList.DataSource = contentModelListByNodeId;
this.RptModelList.DataBind();
}
if (contentModelListByNodeId.Rows.Count == 1)
{
this.HlkModel.Visible = true;
string str6 = "";
str6 = string.Concat(new object[] { "~/Admin/Contents/", contentModelListByNodeId.Rows[0]["AddInfoFilePath"].ToString(), "?Action=add&modelId=", contentModelListByNodeId.Rows[0]["ModelId"].ToString(), "&NodeID=", BaseUserControl.RequestInt32("NodeID") });
this.HlkModel.NavigateUrl = str6;
this.HlkModel.Text = "添加" + contentModelListByNodeId.Rows[0]["ItemName"].ToString();
}
if (!this.LblAddContent.Visible && !this.HlkModel.Visible)
{
this.LitSeparator.Visible = false;
}
NodeInfo info2 = PowerEasy.Contents.Nodes.GetCacheNodeById(nodeId);
if (!info2.IsNull && info2.IsCreateContentPage)
{
this.ELnkHtmlManage.Enabled = true;
}
else
{
this.ELnkHtmlManage.Enabled = false;
}
}
else
{
this.LblAddContent.Visible = false;
this.HlkModel.Visible = false;
this.LitSeparator.Visible = false;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -