Example #1
0
        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);
        }
Example #2
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;
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         int nodeId = DataConverter.CLng(HttpContext.Current.Request["NodeId"]);
         if (nodeId == 0)
         {
             nodeId = ContentManage.GetContentNodeId(DataConverter.CLng(HttpContext.Current.Request["GeneralId"]));
         }
         if (base.IsAdminManage)
         {
             int             nodeWorkFlowId     = Nodes.GetNodeWorkFlowId(nodeId);
             string          roles              = PEContext.Current.Admin.Roles;
             FlowProcessInfo flowProcessByRoles = FlowProcess.GetFlowProcessByRoles(nodeWorkFlowId, roles);
             if (BaseUserControl.RequestStringToLower("Action") == "modify")
             {
                 ListItem item  = new ListItem("草稿", "-1");
                 ListItem item2 = new ListItem("不改变当前状态", this.FieldValue);
                 item2.Selected = true;
                 if (PEContext.Current.Admin.IsSuperAdmin)
                 {
                     ListItem item3 = new ListItem("退稿", "-2");
                     this.RadlStatus.Items.Add(item);
                     this.RadlStatus.Items.Add(item3);
                     if (this.FieldValue == "99")
                     {
                         item2.Text = "终审通过";
                         this.RadlStatus.Items.Add(item2);
                     }
                     else
                     {
                         this.RadlStatus.Items.Add(item2);
                         ListItem item4 = new ListItem("终审通过", "99");
                         this.RadlStatus.Items.Add(item4);
                     }
                 }
                 else if (!flowProcessByRoles.IsNull)
                 {
                     ListItem item5 = new ListItem(flowProcessByRoles.RejectActionName, flowProcessByRoles.RejectActionStatus.ToString());
                     ListItem item6 = new ListItem(flowProcessByRoles.PassActionName, flowProcessByRoles.PassActionStatus.ToString());
                     this.RadlStatus.Items.Add(item5);
                     if (this.FieldValue == flowProcessByRoles.PassActionStatus.ToString())
                     {
                         item2.Text = flowProcessByRoles.PassActionName;
                         this.RadlStatus.Items.Add(item2);
                     }
                     else
                     {
                         this.RadlStatus.Items.Add(item2);
                         this.RadlStatus.Items.Add(item6);
                     }
                 }
                 else
                 {
                     this.RadlStatus.Items.Add(item2);
                 }
             }
             else
             {
                 ListItem item7 = new ListItem("草稿", "-1");
                 ListItem item8 = new ListItem("待审核", "0");
                 this.RadlStatus.Items.Add(item7);
                 this.RadlStatus.Items.Add(item8);
                 item8.Selected = true;
                 if (PEContext.Current.Admin.IsSuperAdmin)
                 {
                     ListItem item9 = new ListItem("终审通过", "99");
                     item9.Selected = true;
                     this.RadlStatus.Items.Add(item9);
                 }
                 else if (!flowProcessByRoles.IsNull)
                 {
                     ListItem item10 = new ListItem(flowProcessByRoles.PassActionName, flowProcessByRoles.PassActionStatus.ToString());
                     item10.Selected = true;
                     this.RadlStatus.Items.Add(item10);
                 }
             }
         }
         else if (PEContext.Current.User.Identity.IsAuthenticated)
         {
             if (HttpContext.Current.Request["Action"] == "Modify")
             {
                 ListItem item11 = new ListItem("草稿", "-1");
                 ListItem item12 = new ListItem("不改变当前状态", this.FieldValue);
                 if (this.FieldValue == "-1")
                 {
                     item11.Selected = true;
                     item12.Text     = "投稿";
                     item12.Value    = "0";
                 }
                 else
                 {
                     item12.Selected = true;
                 }
                 this.RadlStatus.Items.Add(item11);
                 this.RadlStatus.Items.Add(item12);
             }
             else
             {
                 ListItem item13 = new ListItem("草稿", "-1");
                 ListItem item14 = new ListItem("投稿", "0");
                 this.RadlStatus.Items.Add(item13);
                 this.RadlStatus.Items.Add(item14);
                 item14.Selected = true;
             }
         }
         else
         {
             ListItem item15 = new ListItem("投稿", "0");
             this.RadlStatus.Items.Add(item15);
             item15.Selected = true;
         }
         this.RadlStatus.RepeatLayout    = RepeatLayout.Flow;
         this.RadlStatus.RepeatDirection = RepeatDirection.Horizontal;
     }
     else
     {
         this.FieldValue = this.RadlStatus.SelectedValue;
     }
 }
        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            = "取消审核";
                }
            }
        }
        private void InitPage()
        {
            this.Path = this.Page.Request.ApplicationPath.Equals("/") ? string.Empty : this.Page.Request.ApplicationPath;
            this.Path = this.Page.Request.Url.Scheme + "://" + this.Page.Request.Url.Authority + this.Path;
            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>");
            }
            int       nodeId        = DataConverter.CLng(this.contentDataTable.Rows[0]["NodeId"]);
            ModelInfo modelInfoById = ModelManager.GetModelInfoById(DataConverter.CLng(this.contentDataTable.Rows[0]["ModelID"].ToString()));

            if (modelInfoById.IsEshop)
            {
                this.m_IsEshop = true;
                this.TabTitle5.Style.Add("display", "none");
            }
            else
            {
                this.m_IsEshop = false;
                if (!modelInfoById.EnableCharge)
                {
                    this.TabTitle5.Style.Add("display", "none");
                }
                if (!modelInfoById.EnableSignIn)
                {
                    this.TabTitle6.Style.Add("display", "none");
                }
                this.InitSigin(this.m_GeneralId, modelInfoById.EnableSignIn);
            }
            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            = "取消审核";
                }
            }
            this.InitContent();
        }