📄 category.aspx.cs
字号:
if (info2.OperateCode == OperateCode.NodeContentManage)
{
box4.Checked = true;
if (!flag)
{
box4.Enabled = flag;
}
}
if (info2.OperateCode == OperateCode.NodeCommentManage)
{
box6.Checked = true;
if (flag)
{
continue;
}
box6.Enabled = flag;
}
}
}
}
private IList<NodesModelTemplateRelationShipInfo> GetDataFromRepeater()
{
IList<NodesModelTemplateRelationShipInfo> list = new List<NodesModelTemplateRelationShipInfo>();
foreach (RepeaterItem item in this.RepContentModelTemplate.Items)
{
if ((item.ItemType != ListItemType.Item) && (item.ItemType != ListItemType.AlternatingItem))
{
continue;
}
string text = ((TextBox) item.FindControl("FileCTemplate")).Text;
if (((CheckBox) item.FindControl("ChkModel")).Checked && !string.IsNullOrEmpty(text))
{
NodesModelTemplateRelationShipInfo info = new NodesModelTemplateRelationShipInfo();
info.ModelId = DataConverter.CLng(((HiddenField) item.FindControl("HdnModelId")).Value);
info.DefaultTemplateFile = text;
list.Add(info);
}
}
foreach (RepeaterItem item2 in this.RepShopModelTemplate.Items)
{
if ((item2.ItemType != ListItemType.Item) && (item2.ItemType != ListItemType.AlternatingItem))
{
continue;
}
string str2 = ((TextBox) item2.FindControl("FileCTemplate")).Text;
if (((CheckBox) item2.FindControl("ChkModel")).Checked && !string.IsNullOrEmpty(str2))
{
NodesModelTemplateRelationShipInfo info2 = new NodesModelTemplateRelationShipInfo();
info2.ModelId = DataConverter.CLng(((HiddenField) item2.FindControl("HdnModelId")).Value);
info2.DefaultTemplateFile = str2;
list.Add(info2);
}
}
return list;
}
private NodeInfo GetNodesInfo()
{
NodeInfo nodeById = PowerEasy.Contents.Nodes.GetNodeById(BasePage.RequestInt32("NodeId", 0));
NodeSettingInfo info2 = new NodeSettingInfo();
nodeById.ParentId = DataConverter.CLng(this.DropParentNode.SelectedValue);
nodeById.NodeName = this.TxtNodeName.Text;
nodeById.NodeIdentifier = this.TxtNodeIdentifier.Text;
nodeById.NodeType = NodeType.Container;
nodeById.NodePicUrl = this.TxtNodePicUrl.Text;
nodeById.NodeDir = this.TxtNodeDir.Text;
nodeById.Tips = this.TxtTips.Text;
nodeById.Description = this.TxtDescription.Text;
nodeById.MetaDescription = this.TxtMetaDescription.Text;
nodeById.MetaKeywords = this.TxtMetaKeywords.Text;
if (this.RadOpenType0.Checked)
{
nodeById.OpenType = 0;
}
if (this.RadOpenType1.Checked)
{
nodeById.OpenType = 1;
}
if (this.RadPurviewType0.Checked)
{
nodeById.PurviewType = 0;
}
if (this.RadPurviewType1.Checked)
{
nodeById.PurviewType = 1;
}
if (this.RadPurviewType2.Checked)
{
nodeById.PurviewType = 2;
}
info2.EnableComment = this.ChkEnableComment.Checked;
info2.EnableTouristsComment = this.ChkEnableTouristsComment.Checked;
info2.CommentNeedCheck = this.ChkCommentNeedCheck.Checked;
nodeById.WorkFlowId = DataConverter.CLng(this.DropWorkFlow.SelectedValue);
info2.EnableProtect = Convert.ToBoolean(this.RadlEnableProtect.SelectedValue);
info2.EnableAddWhenHasChild = Convert.ToBoolean(this.RadlEnableAddWhenHasChild.SelectedValue);
nodeById.HitsOfHot = DataConverter.CLng(this.TxtHitsOfHot.Text);
if (this.RadNeedCache1.Checked)
{
info2.IsSetCache = true;
info2.CacheTime = DataConverter.CLng(this.TxtCacheTime.Text);
}
if (this.RadNeedCache0.Checked)
{
info2.IsSetCache = false;
info2.CacheTime = 0;
}
info2.PresentExp = DataConverter.CLng(this.TxtPresentExp.Text);
info2.DefaultItemPoint = DataConverter.CLng(this.TxtDefaultItemPoint.Text);
info2.DefaultItemChargeType = this.ShowChargeType.ChargeType;
info2.DefaultItemPitchTime = this.ShowChargeType.PitchTime;
info2.DefaultItemReadTimes = this.ShowChargeType.ReadTimes;
info2.DefaultItemDividePercent = DataConverter.CLng(this.TxtDefaultItemDividePercent.Text);
nodeById.DefaultTemplateFile = this.FileCdefaultListTmeplate.Text;
nodeById.ContainChildTemplateFile = this.FileContainChildTemplate.Text;
nodeById.ShowOnMenu = Convert.ToBoolean(this.RadlShowOnMenu.SelectedValue);
nodeById.ShowOnPath = Convert.ToBoolean(this.RadlShowOnPath.SelectedValue);
nodeById.ShowOnMap = Convert.ToBoolean(this.RadlShowOnMap.SelectedValue);
nodeById.ShowOnListIndex = Convert.ToBoolean(this.RadlShowOnListIndex.SelectedValue);
nodeById.ShowOnListParent = Convert.ToBoolean(this.RadlShowOnListParent.SelectedValue);
nodeById.ItemListOrderType = DataConverter.CLng(this.DrpItemListOrderType.SelectedValue);
nodeById.ItemOpenType = DataConverter.CLng(this.DrpItemOpenType.SelectedValue);
nodeById.ItemPageSize = DataConverter.CLng(this.CombItemPageSize.Value);
nodeById.IsCreateContentPage = DataConverter.CBool(this.RadlIsContentPageCreate.SelectedValue);
nodeById.IsCreateListPage = DataConverter.CBool(this.RadlIsListPageCreate.SelectedValue);
nodeById.ListPageSavePathType = (ListPagePathType) Enum.Parse(typeof(ListPagePathType), this.RadlListPageHtmlDirType.SelectedValue);
nodeById.ListPagePostfix = this.PagePostfix.Value;
nodeById.AutoCreateHtmlType = (AutoCreateHtmlType) Enum.Parse(typeof(AutoCreateHtmlType), this.RadlAutoCreateHtmlType.SelectedValue);
nodeById.ContentPageHtmlRule = this.TxtContentHtmlDir.Value + "/" + this.TxtContentHtmlFile.Value + "." + this.TxtContentHtmlExt.Value;
nodeById.RelateNode = this.GetSelectArrFromListControl(this.LstRelationNodes).ToString();
nodeById.RelateSpecial = this.GetSelectArrFromListControl(this.LstRelationSpecial).ToString();
int num = DataConverter.CLng(this.DropCustomNum.SelectedValue);
StringBuilder builder = new StringBuilder();
for (int i = 1; i <= num; i++)
{
if (builder.Length > 0)
{
builder.Append("{#$$$#}");
}
builder.Append(((TextBox) this.PnlCustomFileds.FindControl("Custom_Content" + i)).Text);
}
nodeById.CustomContent = builder.ToString();
nodeById.Settings = info2;
return nodeById;
}
private StringBuilder GetSelectArrFromListControl(ListControl listControl)
{
StringBuilder builder = new StringBuilder();
foreach (ListItem item in listControl.Items)
{
if (!item.Selected)
{
continue;
}
if (builder.Length > 0)
{
builder.Append(",");
}
builder.Append(item.Value);
}
return builder;
}
private void InitCreateHtmlControl()
{
this.RadlAutoCreateHtmlType.Items[4].Attributes.Add("onclick", "ShowSelectRelation(\"0\")");
this.RadlAutoCreateHtmlType.Items[0].Attributes.Add("onclick", "ShowSelectRelation(\"0\")");
this.RadlAutoCreateHtmlType.Items[1].Attributes.Add("onclick", "ShowSelectRelation(\"0\")");
this.RadlAutoCreateHtmlType.Items[2].Attributes.Add("onclick", "ShowSelectRelation(\"0\")");
this.RadlAutoCreateHtmlType.Items[3].Attributes.Add("onclick", "ShowSelectRelation(\"0\")");
this.RadlAutoCreateHtmlType.Items[5].Attributes.Add("onclick", "ShowSelectRelation(\"4\")");
}
private void InitFromParentNode(int parentId)
{
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(parentId);
if (!cacheNodeById.IsNull && (cacheNodeById.Settings != null))
{
this.TxtMetaDescription.Text = cacheNodeById.MetaDescription;
this.TxtMetaKeywords.Text = cacheNodeById.MetaKeywords;
this.ChkEnableComment.Checked = cacheNodeById.Settings.EnableComment;
this.ChkEnableTouristsComment.Checked = cacheNodeById.Settings.EnableTouristsComment;
this.ChkCommentNeedCheck.Checked = cacheNodeById.Settings.CommentNeedCheck;
this.DropWorkFlow.SelectedValue = cacheNodeById.WorkFlowId.ToString();
this.TxtPresentExp.Text = cacheNodeById.Settings.PresentExp.ToString();
this.TxtDefaultItemPoint.Text = cacheNodeById.Settings.DefaultItemPoint.ToString();
this.ShowChargeType.ChargeType = cacheNodeById.Settings.DefaultItemChargeType;
this.ShowChargeType.PitchTime = cacheNodeById.Settings.DefaultItemPitchTime;
this.ShowChargeType.ReadTimes = cacheNodeById.Settings.DefaultItemReadTimes;
this.TxtDefaultItemDividePercent.Text = cacheNodeById.Settings.DefaultItemDividePercent.ToString();
this.FileCdefaultListTmeplate.Text = cacheNodeById.DefaultTemplateFile;
this.FileContainChildTemplate.Text = cacheNodeById.ContainChildTemplateFile;
}
}
private void InitialPage()
{
bool flag;
int nodeId = BasePage.RequestInt32("NodeID");
string action = BasePage.RequestStringToLower("Action", "add");
this.InitCreateHtmlControl();
if (action == "modify")
{
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(nodeId);
this.HdnNodeId.Value = cacheNodeById.ParentId.ToString();
switch (cacheNodeById.NodeType)
{
case NodeType.Single:
BasePage.ResponseRedirect("Single.aspx?Action=modify&NodeID=" + nodeId);
break;
case NodeType.Link:
BasePage.ResponseRedirect("OutLink.aspx?Action=modify&NodeID=" + nodeId);
break;
}
}
int parentId = BasePage.RequestInt32("ParentID");
this.initDataTable = ModelManager.GetModelListByNodeId(nodeId, true);
if (!this.Page.IsPostBack)
{
this.RadNeedCache0.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='none';");
this.RadNeedCache1.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='';");
IList<NodeInfo> nodeNameForContainerItems = PowerEasy.Contents.Nodes.GetNodeNameForContainerItems();
this.DropParentNode.DataSource = nodeNameForContainerItems;
this.DropParentNode.DataBind();
this.LstRelationNodes.DataSource = PowerEasy.Contents.Nodes.GetNodeNameForItemsExceptOutLinks();
this.LstRelationNodes.DataTextField = "NodeName";
this.LstRelationNodes.DataValueField = "NodeId";
this.LstRelationNodes.DataBind();
IList<UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
this.EgvPermissions.DataSource = userGroupList;
this.EgvPermissions.DataBind();
this.EgvRoleView.DataSource = UserRole.GetRoleList();
this.EgvRoleView.DataBind();
IList<ModelInfo> modelList = ModelManager.GetModelList(ModelType.Content, ModelShowType.Enable);
this.RepContentModelTemplate.DataSource = modelList;
this.RepContentModelTemplate.DataBind();
if (string.Compare(SiteConfig.SiteInfo.ProductEdition, "eshop", true) == 0)
{
this.RepShopModelTemplate.DataSource = ModelManager.GetModelList(ModelType.Shop, ModelShowType.Enable);
this.RepShopModelTemplate.DataBind();
}
IList<WorkFlowsInfo> workFlowsList = WorkFlow.GetWorkFlowsList();
this.DropWorkFlow.DataSource = workFlowsList;
this.DropWorkFlow.DataBind();
this.LstRelationSpecial.DataSource = Special.GetSpecialList();
this.LstRelationSpecial.DataBind();
((DropDownList) this.PnlCustomFileds.FindControl("DropCustomNum")).Attributes.Add("onchange", "setFileFileds(this.value)");
this.DropParentNode.Attributes.Add("onchange", "ShowNodeDir(this.value);");
}
string str2 = action;
if (str2 != null)
{
if (!(str2 == "add"))
{
if (str2 == "modify")
{
this.SmpNavigator.CurrentNode = "修改栏目设置:";
this.EBtnModify.Visible = true;
this.EbtnDelete.Visible = true;
if (!this.Page.IsPostBack)
{
this.BindNodesInfo(nodeId);
}
goto Label_039C;
}
}
else
{
if (!this.Page.IsPostBack)
{
if (parentId > 0)
{
this.DropParentNode.SelectedValue = parentId.ToString();
this.InitFromParentNode(parentId);
this.SmpNavigator.CurrentNode = "添加子栏目";
this.SetPurviewType(parentId);
}
else if (nodeId > 0)
{
parentId = PowerEasy.Contents.Nodes.GetCacheNodeById(nodeId).ParentId;
this.SetPurviewType(parentId);
this.InitFromParentNode(parentId);
this.SmpNavigator.CurrentNode = "添加平级栏目";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -