📄 contentsignin.aspx.cs
字号:
namespace PowerEasy.WebSite.Admin.Contents
{
using PowerEasy.AccessManage;
using PowerEasy.Common;
using PowerEasy.CommonModel;
using PowerEasy.Components;
using PowerEasy.Contents;
using PowerEasy.Controls;
using PowerEasy.Enumerations;
using PowerEasy.Model.Contents;
using PowerEasy.ModelControls;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
public class ContentSignin : AdminPage
{
protected Button BtnSearch;
protected ContentManageNavigation Cmn;
protected DropDownList DropRescentQuery;
protected DropDownList DrpSearchType;
protected ExtendedGridView EgvContentSignin;
protected HiddenField HdnListType;
protected HiddenField HdnSearchKeyword;
protected HiddenField HdnSearchType;
protected HiddenField HdnSortType;
protected HiddenField HdnStatus;
private bool m_Administrator;
private string m_arrContentNodeIdManage = "";
protected Dictionary<int, string> m_NodeNameDictionary = new Dictionary<int, string>();
protected ObjectDataSource OdsContents;
protected RadioButtonList RadlContent;
protected RadioButtonList RadlListType;
protected ScriptManager ScriptManageContent;
protected ExtendedSiteMapPath SmpNavigator;
protected TextBox TxtSearchKeyword;
protected void BtnSearch_Click(object sender, EventArgs e)
{
this.HdnSearchType.Value = this.DrpSearchType.SelectedValue;
this.HdnSearchKeyword.Value = this.TxtSearchKeyword.Text;
this.EgvContentSignin.DataBind();
}
protected void DropSelectedIndex_Changed(object sender, EventArgs e)
{
this.HdnSortType.Value = this.DropRescentQuery.SelectedValue;
this.EgvContentSignin.PageIndex = 0;
}
protected void EgvContentSignin_RowCommand(object sender, CommandEventArgs e)
{
if (e.CommandName == "DeleteContent")
{
int generalId = DataConverter.CLng(e.CommandArgument.ToString());
if (ContentManage.UpdateStatus(generalId, -3))
{
PermissionContent.Delete(generalId);
PowerEasy.Contents.ContentCharge.Delete(generalId);
AdminPage.WriteSuccessMsg("<li>删除成功!</li>", "ContentSignin.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
}
else
{
AdminPage.WriteErrMsg("<li>删除失败!</li>");
}
}
}
protected void EgvContentSignin_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CommonModelInfo dataItem = (CommonModelInfo) e.Row.DataItem;
NodeInfo cacheNodeById = new NodeInfo(true);
int length = 0;
int nodeId = BasePage.RequestInt32("NodeID");
string nodeName = "";
if (dataItem.NodeId != nodeId)
{
nodeId = dataItem.NodeId;
if (this.m_NodeNameDictionary.ContainsKey(dataItem.NodeId))
{
nodeName = this.m_NodeNameDictionary[dataItem.NodeId];
}
else
{
cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId);
if (!cacheNodeById.IsNull)
{
nodeName = cacheNodeById.NodeName;
this.m_NodeNameDictionary.Add(dataItem.NodeId, nodeName);
}
}
Label label = e.Row.FindControl("LblNodeLink") as Label;
label.Text = "<strong>[<a href=\"ContentSignin.aspx?NodeID=" + dataItem.NodeId.ToString() + "\">" + nodeName + "</a>]</strong>";
length = StringHelper.SubStringLength(DataSecurity.HtmlDecode(nodeName)) + 2;
}
Label label2 = e.Row.FindControl("LblIsCreateHtml") as Label;
if (!dataItem.CreateTime.HasValue || (dataItem.CreateTime.Value <= dataItem.UpdateTime))
{
label2.Text = "<span style=\"color:Red\"><b>\x00d7</b></span>";
}
else
{
label2.Text = "<b>√</b>";
}
LinkImage image = e.Row.FindControl("LinkImageModel") as LinkImage;
string itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon;
if (string.IsNullOrEmpty(itemIcon))
{
itemIcon = "Default.gif";
}
image.Icon = itemIcon;
if (dataItem.LinkType != 0)
{
image.IsShowLink = true;
}
Label label3 = e.Row.FindControl("LblSigninStatus") as Label;
SigninContentInfo signinContentByGeneralId = SigninContent.GetSigninContentByGeneralId(dataItem.GeneralId);
string signinUsers = SigninLog.GetSigninUsers(dataItem.GeneralId);
IList<SigninLogInfo> list = SigninLog.GetList(dataItem.GeneralId);
StringBuilder builder = new StringBuilder();
StringBuilder builder2 = new StringBuilder();
foreach (SigninLogInfo info4 in list)
{
if (info4.IsSignin)
{
if (builder.Length > 0)
{
builder.Append(",");
}
builder.Append(info4.UserName);
continue;
}
if (builder2.Length > 0)
{
builder2.Append(",");
}
builder2.Append(info4.UserName);
}
string str4 = "";
if (!signinContentByGeneralId.IsNull)
{
str4 = "<font color=" + ((signinContentByGeneralId.Status == SigninStatus.NotSignin) ? "red" : "green") + ">[" + BasePage.EnumToHtml<SigninStatus>(signinContentByGeneralId.Status) + "]</font>";
label3.Text = "<a href='' onclick='return false' title='要求签收用户:" + signinUsers + " 已经签收用户:" + builder.ToString() + " 尚未签收用户:" + builder2.ToString() + "'>" + str4 + "</a>";
}
HyperLink link = e.Row.FindControl("HypTitle") as HyperLink;
length = 0x25 - length;
link.Text = StringHelper.SubString(DataSecurity.HtmlDecode(dataItem.Title), length, "...");
link.ToolTip = DataSecurity.HtmlDecode(dataItem.Title);
link.NavigateUrl = "ContentView.aspx?GeneralID=" + dataItem.GeneralId.ToString();
HyperLink link2 = (HyperLink) e.Row.FindControl("EahContentModify");
link2.NavigateUrl = "Content.aspx?Action=Modify&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + dataItem.NodeId.ToString();
if (!this.m_Administrator)
{
string str5 = nodeId.ToString();
if (cacheNodeById.IsNull)
{
cacheNodeById = Nodes.GetCacheNodeById(nodeId);
}
if (cacheNodeById.ParentId > 0)
{
str5 = str5 + "," + cacheNodeById.ParentPath;
}
if (!RolePermissions.CheckNodePurview(str5, this.m_arrContentNodeIdManage))
{
((HyperLink) e.Row.FindControl("EahContentModify")).Enabled = false;
((LinkButton) e.Row.FindControl("ELbtnDelete")).Enabled = false;
}
}
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (PEContext.Current.Admin.IsSuperAdmin)
{
this.m_Administrator = true;
}
if (!this.m_Administrator)
{
this.m_arrContentNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
}
if (!base.IsPostBack)
{
this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
this.RadlContent.SelectedValue = BasePage.RequestStringToLower("status", "100");
this.HdnStatus.Value = BasePage.RequestStringToLower("status", "100");
}
}
protected void RadlContent_SelectedIndexChanged(object sender, EventArgs e)
{
this.HdnStatus.Value = this.RadlContent.SelectedValue;
this.EgvContentSignin.PageIndex = 0;
}
protected void RadlListType_SelectedIndexChanged(object sender, EventArgs e)
{
this.HdnListType.Value = this.RadlListType.SelectedValue;
this.EgvContentSignin.PageIndex = 0;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -