Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin;
            this.m_NodeId        = BasePage.RequestInt32("NodeID");
            bool flag = false;

            if (!this.m_Administrator)
            {
                if (this.m_NodeId > 0)
                {
                    string   findStr       = this.m_NodeId.ToString();
                    NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId);
                    if (cacheNodeById.IsNull)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag = StringHelper.FoundCharInArr(RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage), findStr);
                }
                else
                {
                    flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                }
                if (!flag)
                {
                    AdminPage.WriteErrMsg("您没有此栏目的管理权限!");
                }
            }
            foreach (StatusInfo info2 in Status.GetStatusList())
            {
                if (!this.m_StatusDictionary.ContainsKey(info2.StatusCode))
                {
                    this.m_StatusDictionary.Add(info2.StatusCode, info2.StatusName);
                }
            }
            if (!base.IsPostBack)
            {
                Nodes.GetNodeWorkFlowId(this.m_NodeId);
                this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
                this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
                this.HdnStatus.Value   = BasePage.RequestStringToLower("status", "102");
                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("根节点 >>", "");
                    }
                }
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (PEContext.Current.Admin.IsSuperAdmin)
     {
         this.m_Administrator = true;
     }
     this.nodeId = BasePage.RequestInt32("NodeID");
     if (!base.IsPostBack)
     {
         NodeInfo cacheNodeById = new NodeInfo(true);
         if (this.nodeId > 0)
         {
             this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(this.nodeId, "ContentRecycle.aspx");
             cacheNodeById        = Nodes.GetCacheNodeById(this.nodeId);
             this.BtnClear.Text   = "清空" + cacheNodeById.NodeName + "下的信息";
             this.BtnRecycle.Text = "还原" + cacheNodeById.NodeName + "下的信息";
         }
         this.DropRescentQuery.SelectedValue = BasePage.RequestStringToLower("ListType");
         this.HdnListType.Value = BasePage.RequestStringToLower("ListType");
         if (!this.m_Administrator)
         {
             this.m_arrContentNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
             bool flag = false;
             if (this.nodeId > 0)
             {
                 string findStr = this.nodeId.ToString();
                 if (cacheNodeById.IsNull)
                 {
                     AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                 }
                 if (cacheNodeById.ParentId > 0)
                 {
                     findStr = findStr + "," + cacheNodeById.ParentPath;
                 }
                 if (StringHelper.FoundCharInArr(this.m_arrContentNodeIdManage, findStr))
                 {
                     flag = true;
                 }
             }
             else
             {
                 flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
             }
             if (!flag)
             {
                 this.EBtnDelete.Enabled  = false;
                 this.EBtnRestore.Enabled = false;
                 this.BtnClear.Enabled    = false;
                 this.BtnRecycle.Enabled  = false;
             }
         }
     }
 }
Exemplo n.º 3
0
        private void CheckPermissions(NodeInfo nodeInfo)
        {
            string checkStr   = "";
            string roleNodeId = "";
            string str3       = "";
            string str4       = "";
            string str5       = "";

            if (!this.Administrator)
            {
                this.m_IsNodeShow           = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, nodeInfo.NodeId);
                this.m_IsNodeInput          = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, nodeInfo.NodeId);
                this.m_IsNodeManage         = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, nodeInfo.NodeId);
                this.m_IsCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, nodeInfo.NodeId);
                checkStr   = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentPreview);
                roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput);
                str3       = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentCheck);
                str4       = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                str5       = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.CurrentNodesManage);
                string findStr = nodeInfo.NodeId.ToString();
                if ((nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) && !this.m_IsNodeShow)
                {
                    if (!string.IsNullOrEmpty(nodeInfo.ArrChildId))
                    {
                        findStr = nodeInfo.ArrChildId;
                    }
                    if ((StringHelper.FoundCharInArr(checkStr, findStr) || StringHelper.FoundCharInArr(roleNodeId, findStr)) || (StringHelper.FoundCharInArr(str3, findStr) || StringHelper.FoundCharInArr(str4, findStr)))
                    {
                        this.m_IsShow = true;
                    }
                }
                if (nodeInfo.ParentId > 0)
                {
                    findStr = nodeInfo.ParentPath + "," + nodeInfo.NodeId.ToString();
                    if (!this.m_IsNodeShow)
                    {
                        this.m_IsNodeShow = StringHelper.FoundCharInArr(checkStr, findStr);
                    }
                    if (!this.m_IsNodeInput)
                    {
                        this.m_IsNodeInput = StringHelper.FoundCharInArr(roleNodeId, findStr);
                    }
                    if (!this.m_IsNodeManage)
                    {
                        this.m_IsNodeManage = StringHelper.FoundCharInArr(str4, findStr);
                    }
                    if (!this.m_IsCurrentNodesManage)
                    {
                        this.m_IsCurrentNodesManage = StringHelper.FoundCharInArr(str5, findStr);
                    }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (PEContext.Current.Admin.IsSuperAdmin)
     {
         this.m_Administrator = true;
     }
     else
     {
         this.m_arrContentNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
     }
     if (!base.IsPostBack)
     {
         int nodeId = BasePage.RequestInt32("NodeID");
         if (nodeId > 0)
         {
             this.SmpNavigator.AdditionalNode = Nodes.ShowNodeNavigation(nodeId, "ContentHtml.aspx");
         }
         if (!this.m_Administrator)
         {
             bool flag = false;
             if (nodeId > 0)
             {
                 string   findStr       = nodeId.ToString();
                 NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId);
                 if (cacheNodeById.IsNull)
                 {
                     AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                 }
                 if (cacheNodeById.ParentId > 0)
                 {
                     findStr = findStr + "," + cacheNodeById.ParentPath;
                 }
                 if (StringHelper.FoundCharInArr(this.m_arrContentNodeIdManage, findStr))
                 {
                     flag = true;
                 }
             }
             else
             {
                 flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
             }
             if (!flag)
             {
                 this.BtnCreateAll.Enabled = false;
                 this.BtnCreate.Enabled    = false;
                 this.BtnDelete.Enabled    = false;
             }
         }
     }
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.m_Administrator = PEContext.Current.Admin.IsSuperAdmin;
     if (!this.m_Administrator)
     {
         this.m_arrNodeIdManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, EasyOne.Enumerations.OperateCode.NodeContentManage);
     }
     if (string.IsNullOrEmpty(base.Title))
     {
         base.Title = "待审核内容";
     }
     this.EgvContent.DataSource = ContentManage.GetCommonModelInfoList(0, this.PageSize, this.NodeId, (ContentSortType)this.ListType, this.Status);
     this.EgvContent.DataBind();
     base.Subtitle = "共" + ContentManage.GetTotalOfCommonModelInfo(this.NodeId, (ContentSortType)this.ListType, this.Status).ToString() + "条";
     base.TitleUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Contents/ContentManage.aspx?Status=0";
 }
Exemplo n.º 6
0
 private void DetectionPermissions(string action)
 {
     if (!PEContext.Current.Admin.IsSuperAdmin)
     {
         string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.ChildNodesManage);
         if (roleNodeId.IndexOf("-1", StringComparison.Ordinal) >= 0)
         {
             this.m_arrCurrentNodesManage = "-1";
         }
         else
         {
             if (roleNodeId.IndexOf(',') > 0)
             {
                 string[]      strArray = roleNodeId.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                 StringBuilder builder  = new StringBuilder();
                 foreach (string str2 in strArray)
                 {
                     if (builder.Length == 0)
                     {
                         builder.Append(CountRoleNodePermissionsId(str2));
                     }
                     else
                     {
                         builder.Append("," + CountRoleNodePermissionsId(str2));
                     }
                 }
                 roleNodeId = builder.ToString();
             }
             else
             {
                 roleNodeId = CountRoleNodePermissionsId(roleNodeId);
             }
             this.m_arrCurrentNodesManage = roleNodeId;
             foreach (ListItem item in this.DropParentNode.Items)
             {
                 if (!StringHelper.FoundCharInArr(this.m_arrCurrentNodesManage, item.Value))
                 {
                     item.Attributes.CssStyle.Add("background", "red");
                 }
             }
         }
         if (action == "add")
         {
             this.LblNodePermissions.Text = "注意:<span style='color:red;'>红色</span>的栏目表示没有权限";
         }
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (PEContext.Current.Admin.IsSuperAdmin)
     {
         this.m_Administrator = true;
     }
     if (!this.m_Administrator)
     {
         this.m_NodeCommentReply  = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentReply);
         this.m_NodeCommentCheck  = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentCheck);
         this.m_NodeCommentManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeCommentManage);
         bool flag   = false;
         int  nodeId = BasePage.RequestInt32("NodeID");
         if (nodeId > 0)
         {
             string   findStr       = nodeId.ToString();
             NodeInfo cacheNodeById = Nodes.GetCacheNodeById(nodeId);
             if (cacheNodeById.IsNull)
             {
                 AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
             }
             if (cacheNodeById.ParentId > 0)
             {
                 findStr = findStr + "," + cacheNodeById.ParentPath;
             }
             if (StringHelper.FoundCharInArr(this.m_NodeCommentManage, findStr))
             {
                 flag = true;
             }
         }
         else
         {
             flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeCommentManage, -1);
         }
         if (!flag)
         {
             this.BtnSubmit1.Enabled = false;
             this.BtnSubmit2.Enabled = false;
             this.BtnSubmit3.Enabled = false;
         }
     }
     if (!base.IsPostBack)
     {
         this.InitComment();
     }
 }
 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");
     }
 }
Exemplo n.º 9
0
 protected override void OnInit(EventArgs e)
 {
     if (this.IsChecked)
     {
         base.Disabled = true;
         if (PEContext.Current.Admin.IsSuperAdmin)
         {
             base.Disabled = false;
         }
         else
         {
             string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, this.OperateCode);
             if (this.m_NodeId > 0)
             {
                 bool     flag          = false;
                 string   findStr       = "";
                 NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId);
                 if (!cacheNodeById.IsNull)
                 {
                     findStr = findStr + this.m_NodeId;
                     if (cacheNodeById.ParentId > 0)
                     {
                         findStr = findStr + "," + cacheNodeById.ParentPath;
                     }
                     flag = StringHelper.FoundCharInArr(roleNodeId, findStr);
                 }
                 if (flag)
                 {
                     base.Disabled = false;
                 }
             }
             else if (RolePermissions.AccessCheckNodePermission(this.OperateCode, -1))
             {
                 base.Disabled = false;
             }
         }
     }
     this.Visible = true;
     base.OnInit(e);
 }
Exemplo n.º 10
0
        public static bool CheckRoleNodePurview(int nodeId, OperateCode operateCode)
        {
            bool flag = true;

            if (PEContext.Current.Admin.IsSuperAdmin || RolePermissions.AccessCheckNodePermission(operateCode, -1))
            {
                return(flag);
            }
            if (nodeId > 0)
            {
                NodeInfo cacheNodeById = GetCacheNodeById(nodeId);
                flag = RolePermissions.AccessCheckNodePermission(operateCode, cacheNodeById.NodeId);
                if (!flag && (cacheNodeById.ParentId > 0))
                {
                    string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, operateCode);
                    string findStr    = cacheNodeById.ParentPath + "," + cacheNodeById.NodeId.ToString();
                    flag = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                return(flag);
            }
            return(false);
        }
Exemplo n.º 11
0
        private static void CheckPurview(NodeInfo nodeInfo, ref bool isShow, ref bool isCurrentNodesManage, ref bool isChildNodesManage, ref string arrCurrentNodesManage)
        {
            if (!Administrator)
            {
                isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, -1);
                if (!isCurrentNodesManage)
                {
                    isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, nodeInfo.NodeId);
                }
                isChildNodesManage = !RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, -1);
                if (!isChildNodesManage)
                {
                    isChildNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, nodeInfo.NodeId);
                }
                switch (nodeInfo.NodeType)
                {
                case NodeType.Container:
                {
                    string findStr = nodeInfo.NodeId.ToString();
                    if ((nodeInfo.ArrChildId.IndexOf(",", StringComparison.Ordinal) > 0) && !isCurrentNodesManage)
                    {
                        if (!string.IsNullOrEmpty(nodeInfo.ArrChildId))
                        {
                            findStr = nodeInfo.ArrChildId;
                        }
                        arrCurrentNodesManage = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.CurrentNodesManage);
                        if (StringHelper.FoundCharInArr(arrCurrentNodesManage, findStr))
                        {
                            isShow = true;
                        }
                    }
                    if (nodeInfo.ParentId > 0)
                    {
                        foreach (string str2 in nodeInfo.ParentPath.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
                        {
                            if (str2 != "0")
                            {
                                if (!isCurrentNodesManage)
                                {
                                    isCurrentNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.CurrentNodesManage, DataConverter.CLng(str2));
                                }
                                if (!isChildNodesManage)
                                {
                                    isChildNodesManage = RolePermissions.AccessCheckNodePermission(OperateCode.ChildNodesManage, DataConverter.CLng(str2));
                                }
                                if (isCurrentNodesManage && isChildNodesManage)
                                {
                                    return;
                                }
                            }
                        }
                        return;
                    }
                    return;
                }

                case NodeType.Special:
                    return;

                case NodeType.Single:
                case NodeType.Link:
                    if (!isCurrentNodesManage)
                    {
                        isShow = false;
                        isCurrentNodesManage = false;
                    }
                    return;
                }
            }
        }
Exemplo n.º 12
0
 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("根节点 >>", "");
             }
             IList <FieldInfo> nodeFieldList = ModelManager.GetNodeFieldList(this.m_NodeId);
             if (nodeFieldList != null)
             {
                 foreach (FieldInfo info4 in nodeFieldList)
                 {
                     if (info4.EnableShowOnSearchForm && (info4.FieldName != "Title"))
                     {
                         this.DrpSearchType.Items.Add(new ListItem(info4.FieldAlias, info4.FieldName));
                     }
                 }
             }
         }
     }
     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   findStr       = this.m_NodeId.ToString();
             NodeInfo cacheNodeById = Nodes.GetCacheNodeById(this.m_NodeId);
             if (cacheNodeById.IsNull)
             {
                 AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
             }
             if (cacheNodeById.ParentId > 0)
             {
                 findStr = findStr + "," + cacheNodeById.ParentPath;
             }
             this.m_isCheck  = StringHelper.FoundCharInArr(this.m_arrNodeIdCheck, findStr);
             this.m_isManage = StringHelper.FoundCharInArr(this.m_arrNodeIdManage, findStr);
         }
         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.BatchNodeSet.Enabled    = false;
             this.EBtnBatchMove.Enabled   = false;
             this.BtnArchiving.Enabled    = false;
         }
         if (!this.m_isCheck)
         {
             this.EBtnPass.Enabled       = false;
             this.EBtnCancelPass.Enabled = false;
         }
     }
     else
     {
         this.LblContentAdvancedSearch.Visible = true;
     }
 }
        private void InitPage()
        {
            this.m_GeneralId = BasePage.RequestInt32("GeneralID");
            if (base.Request.UrlReferrer != null)
            {
                this.ViewState["UrlReferrer"] = base.Request.UrlReferrer.ToString();
            }
            this.contentDataTable = ContentManage.GetContentDataById(this.m_GeneralId);
            if ((this.contentDataTable == null) || (this.contentDataTable.Rows.Count == 0))
            {
                AdminPage.WriteErrMsg("<li>指定项目不存在!</li>");
            }
            this.InitContent();
            int nodeId = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]);

            if (!PEContext.Current.Admin.IsSuperAdmin)
            {
                bool   flag       = false;
                string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (nodeId > 0)
                {
                    string   findStr       = nodeId.ToString();
                    NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (!RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, cacheNodeById.NodeId))
                    {
                        AdminPage.WriteErrMsg("您没有查看该信息的权限!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                else
                {
                    flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                }
                if (!flag)
                {
                    this.EBtnModify.Enabled = false;
                    this.EBtnDelete.Enabled = false;
                }
            }
            CommonModelInfo prevInfo = ContentManage.GetPrevInfo(nodeId, this.m_GeneralId);

            if (!prevInfo.IsNull)
            {
                this.LnkGetPrevInfo.Text        = prevInfo.Title;
                this.LnkGetPrevInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + prevInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetPrevInfo.Text = "没有了";
            }
            CommonModelInfo nextInfo = ContentManage.GetNextInfo(nodeId, this.m_GeneralId);

            if (!nextInfo.IsNull)
            {
                this.LnkGetNextInfo.Text        = nextInfo.Title;
                this.LnkGetNextInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + nextInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetNextInfo.Text = "没有了";
            }
            this.SmpNavigator.AdditionalNode = EasyOne.Contents.Nodes.ShowNodeNavigation(nodeId);
            if (!string.IsNullOrEmpty(this.SmpNavigator.AdditionalNode))
            {
                this.SmpNavigator.AdditionalNode = this.SmpNavigator.AdditionalNode.Replace("根节点 >>", "");
            }
            if (!this.Page.IsPostBack)
            {
                int             nodeWorkFlowId     = EasyOne.Contents.Nodes.GetNodeWorkFlowId(nodeId);
                string          roles              = PEContext.Current.Admin.Roles;
                FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, roles);
                int             passActionStatus   = 0;
                if (PEContext.Current.Admin.IsSuperAdmin || (nodeWorkFlowId == -1))
                {
                    passActionStatus = 0x63;
                }
                else if (!flowProcessByRoles.IsNull)
                {
                    passActionStatus = flowProcessByRoles.PassActionStatus;
                }
                else
                {
                    this.EBtnCheck.Visible = false;
                }
                if ((passActionStatus > 0) && (passActionStatus > DataConverter.CLng(this.contentDataTable.Rows[0]["Status"])))
                {
                    this.EBtnCheck.CommandArgument = passActionStatus.ToString();
                    this.EBtnCheck.Text            = "审核通过";
                }
                else
                {
                    this.EBtnCheck.CommandArgument = "0";
                    this.EBtnCheck.Text            = "取消审核";
                }
            }
        }
        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;

            if (!isSuperAdmin)
            {
                string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentInput);
                string checkStr   = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (nodeId > 0)
                {
                    string   findStr       = nodeId.ToString();
                    NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        BaseUserControl.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag3 = StringHelper.FoundCharInArr(checkStr, findStr);
                    flag2 = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                else
                {
                    flag3 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                    flag2 = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentInput, -1);
                }
                if (!flag2)
                {
                    this.LblAddProduct.Enabled     = false;
                    this.ELnkProductImport.Enabled = false;
                }
                if (!flag3)
                {
                    this.ELnkContentList.Enabled        = false;
                    this.ELnkProductRecycle.Enabled     = false;
                    this.ELnkProductStockManage.Enabled = false;
                    this.ELnkProductBatchModify.Enabled = false;
                    this.ELnkProductHtml.Enabled        = false;
                }
            }
            if ((nodeId > 0) && ((flag2 || flag3) || isSuperAdmin))
            {
                DataTable shopModelListByNodeId = ModelManager.GetShopModelListByNodeId(nodeId, true);
                if (shopModelListByNodeId.Rows.Count <= 1)
                {
                    this.LblAddProduct.Visible = false;
                }
                else
                {
                    this.RptModelList.DataSource = shopModelListByNodeId;
                    this.RptModelList.DataBind();
                }
                if (shopModelListByNodeId.Rows.Count == 1)
                {
                    this.HlkModel.Visible = true;
                    string str5 = "";
                    str5 = string.Concat(new object[] { "~/Admin/Shop/", shopModelListByNodeId.Rows[0]["AddInfoFilePath"].ToString(), "?Action=add&modelId=", shopModelListByNodeId.Rows[0]["ModelId"].ToString(), "&NodeID=", BaseUserControl.RequestInt32("NodeID") });
                    this.HlkModel.NavigateUrl = str5;
                    this.HlkModel.Text        = "添加" + shopModelListByNodeId.Rows[0]["ItemName"].ToString();
                }
                if (!this.LblAddProduct.Visible && !this.HlkModel.Visible)
                {
                    this.LitSeparator.Visible = false;
                }
            }
            else
            {
                this.LblAddProduct.Visible = false;
                this.HlkModel.Visible      = false;
                this.LitSeparator.Visible  = false;
            }
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.m_GeneralId = BasePage.RequestInt32("GeneralID");
            this.InitPage();
            this.InitComment();
            int nodeId = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]);

            if (!PEContext.Current.Admin.IsSuperAdmin)
            {
                bool   flag       = false;
                string roleNodeId = RolePermissions.GetRoleNodeId(PEContext.Current.Admin.Roles, OperateCode.NodeContentManage);
                if (nodeId > 0)
                {
                    string   findStr       = nodeId.ToString();
                    NodeInfo cacheNodeById = EasyOne.Contents.Nodes.GetCacheNodeById(nodeId);
                    if (cacheNodeById.IsNull)
                    {
                        AdminPage.WriteErrMsg("当前栏目不存在,可能被删除了请返回!");
                    }
                    if (!RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentPreview, cacheNodeById.NodeId))
                    {
                        AdminPage.WriteErrMsg("您没有查看该信息的权限!");
                    }
                    if (cacheNodeById.ParentId > 0)
                    {
                        findStr = findStr + "," + cacheNodeById.ParentPath;
                    }
                    flag = StringHelper.FoundCharInArr(roleNodeId, findStr);
                }
                else
                {
                    flag = RolePermissions.AccessCheckNodePermission(OperateCode.NodeContentManage, -1);
                }
                if (!flag)
                {
                    this.EBtnModify.Enabled = false;
                    this.EBtnDelete.Enabled = false;
                }
            }
            CommonModelInfo prevInfo = ContentManage.GetPrevInfo(nodeId, this.m_GeneralId);

            if (!prevInfo.IsNull)
            {
                this.LnkGetPrevInfo.Text        = prevInfo.Title;
                this.LnkGetPrevInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + prevInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetPrevInfo.Text = "没有了";
            }
            CommonModelInfo nextInfo = ContentManage.GetNextInfo(nodeId, this.m_GeneralId);

            if (!nextInfo.IsNull)
            {
                this.LnkGetNextInfo.Text        = nextInfo.Title;
                this.LnkGetNextInfo.NavigateUrl = ModelManager.GetModelInfoById(prevInfo.ModelId).PreviewInfoFilePath + "?GeneralID=" + nextInfo.GeneralId.ToString();
            }
            else
            {
                this.LnkGetNextInfo.Text = "没有了";
            }
        }