⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 contentmanageui.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
                if (dataItem.NodeId != this.m_NodeId)
                {
                    Label label = e.Row.FindControl("LblNodeLink") as Label;
                    label.Text = "<strong>[<a href=\"ContentManage.aspx?NodeID=" + dataItem.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(s) + "\">" + s + "</a>]</strong>";
                    length = StringHelper.SubStringLength(DataSecurity.HtmlDecode(s)) + 2;
                }
                HyperLink link = e.Row.FindControl("HypTitle") as HyperLink;
                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;
                }
                if (this.m_ModelPreviewDictionary.ContainsKey(dataItem.ModelId))
                {
                    link.NavigateUrl = this.m_ModelPreviewDictionary[dataItem.ModelId] + "?GeneralID=" + dataItem.GeneralId;
                }
                else
                {
                    ModelInfo modelInfoById = ModelManager.GetModelInfoById(dataItem.ModelId);
                    link.NavigateUrl = modelInfoById.PreviewInfoFilePath + "?GeneralID=" + dataItem.GeneralId;
                    this.m_ModelPreviewDictionary.Add(dataItem.ModelId, modelInfoById.PreviewInfoFilePath);
                }
                dataItem.Title = DataSecurity.HtmlDecode(dataItem.Title);
                length = 0x25 - length;
                link.Text = DataSecurity.HtmlEncode(StringHelper.SubString(DataSecurity.HtmlDecode(dataItem.Title), length, "..."));
                link.ToolTip = dataItem.Title;
                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>";
                }
                HyperLink link2 = (HyperLink) e.Row.FindControl("ContentModify");
                LinkButton button = (LinkButton) e.Row.FindControl("ContentDelete");
                link2.Text = "修改";
                link2.NavigateUrl = string.Concat(new object[] { "Content.aspx?Action=Modify&NodeID=", nodeId.ToString(), "&GeneralID=", dataItem.GeneralId, "&ModelID=", dataItem.ModelId.ToString(), "&LinkType=", dataItem.LinkType.ToString() });
                button.Text = "删除";
                button.CommandName = "DeleteContent";
                button.CommandArgument = dataItem.GeneralId.ToString();
                button.OnClientClick = "if(!this.disabled) return confirm('确实要删除此信息吗?删除后你还可以从回收站中还原!');";
                if (!this.m_Administrator)
                {
                    string str3 = nodeId.ToString();
                    NodeInfo info4 = new NodeInfo();
                    if (this.m_NodeInfoDictionary.ContainsKey(dataItem.NodeId))
                    {
                        info4 = this.m_NodeInfoDictionary[dataItem.NodeId];
                    }
                    else
                    {
                        info4 = Nodes.GetCacheNodeById(nodeId);
                    }
                    if (info4.ParentId > 0)
                    {
                        str3 = str3 + "," + info4.ParentPath;
                    }
                    if (!RolePermissions.CheckNodePurview(str3, this.m_arrNodeIdManage))
                    {
                        link2.Enabled = false;
                        button.Enabled = false;
                    }
                    if (!RolePermissions.CheckNodePurview(this.m_arrNodeIdShow, str3))
                    {
                        link.NavigateUrl = "#";
                    }
                }
            }
        }

        protected string GetStatusShow(string status)
        {
            int key = DataConverter.CLng(status);
            if (this.m_StatusDictionary.ContainsKey(key))
            {
                return this.m_StatusDictionary[key];
            }
            return "";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin;
            this.m_NodeId = BasePage.RequestInt32("NodeID");
            foreach (StatusInfo info in Status.GetStatusList())
            {
                if (!this.m_StatusDictionary.ContainsKey(info.StatusCode))
                {
                    this.m_StatusDictionary.Add(info.StatusCode, info.StatusName);
                }
            }
            if (!base.IsPostBack)
            {
                int nodeWorkFlowId = Nodes.GetNodeWorkFlowId(this.m_NodeId);
                if (this.m_Administrator)
                {
                    this.EBtnPass.Text = "终审通过";
                }
                else
                {
                    string[] strArray = PEContext.Current.Admin.Roles.Split(new char[] { ',' });
                    FlowProcessInfo info2 = new FlowProcessInfo(true);
                    foreach (string str in strArray)
                    {
                        FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, DataConverter.CLng(str));
                        if (flowProcessByRoles.PassActionStatus > info2.PassActionStatus)
                        {
                            info2 = flowProcessByRoles;
                        }
                        bool isNull = info2.IsNull;
                    }
                    if (info2.IsNull)
                    {
                        this.EBtnPass.Visible = false;
                        this.EBtnCancelPass.Visible = false;
                    }
                    else
                    {
                        this.EBtnPass.Text = info2.PassActionName;
                    }
                }
                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");
                if (this.m_NodeId > 0)
                {
                    this.SmpNavigator.CurrentNode = "<a href=\"ContentManage.aspx\">栏目信息管理</a>";
                    this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(this.m_NodeId);
                    if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode))
                    {
                        this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", "");
                    }
                }
            }
            if (!this.m_Administrator)
            {
                this.m_arrNodeIdShow = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentPreview);
                this.m_arrNodeIdCheck = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentCheck);
                this.m_arrNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (this.m_NodeId > 0)
                {
                    string str2 = this.m_NodeId.ToString();
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId);
                    if (cacheNodeById.IsNull)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        str2 = str2 + "," + cacheNodeById.ParentPath;
                    }
                    this.m_isCheck = RolePermissions.CheckNodePurview(this.m_arrNodeIdCheck, str2);
                    this.m_isManage = RolePermissions.CheckNodePurview(this.m_arrNodeIdManage, str2);
                }
                else
                {
                    this.m_isCheck = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentCheck, -1);
                    this.m_isManage = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                }
                if (!this.m_isManage)
                {
                    this.EBtnBatchDelete.Enabled = false;
                    this.EBtnBatchSet.Enabled = false;
                    this.BatchSpecialSet.Enabled = false;
                    this.EBtnBatchMove.Enabled = false;
                }
                if (!this.m_isCheck)
                {
                    this.EBtnPass.Enabled = false;
                    this.EBtnCancelPass.Enabled = false;
                }
            }
        }

        private void PermissionDetection(bool permissionType)
        {
            if (!this.m_Administrator && !permissionType)
            {
                AdminPage.WriteErrMsg("<li>对不起,当前项目的管理权限!</li>");
            }
        }

        protected void RadlContent_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.HdnStatus.Value = this.RadlContent.SelectedValue;
            this.EgvContent.PageIndex = 0;
        }

        private static void UpdateStatus(string itemIDList, int status)
        {
            if (ContentManage.UpdateStatus(itemIDList, status))
            {
                AdminPage.WriteSuccessMsg("<li>审核通过!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                AdminPage.WriteErrMsg("<li>审核通过失败!</li>", "ContentManage.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
        }

        private static int UserPass(int workFlowId)
        {
            string[] strArray = PEContext.Current.Admin.Roles.Split(new char[] { ',' });
            FlowProcessInfo info = new FlowProcessInfo(true);
            foreach (string str in strArray)
            {
                FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(workFlowId, DataConverter.CLng(str));
                if (flowProcessByRoles.PassActionStatus > info.PassActionStatus)
                {
                    info = flowProcessByRoles;
                }
            }
            return info.PassActionStatus;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -