Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string action      = BasePage.RequestString("Action", "Add");
         int    workFlowsId = BasePage.RequestInt32("FlowId");
         int    processId   = BasePage.RequestInt32("ProcessID");
         this.HdnFlowId.Value = workFlowsId.ToString();
         string flowName = WorkFlow.GetWorkFlowsById(workFlowsId).FlowName;
         this.ListStatusCodeDataBind(1);
         this.DropStatusCodeDataBind(this.DropPassActionStatus, 2);
         this.DropStatusCodeDataBind(this.DropRejectActionStatus, 3);
         this.RolesList(action, workFlowsId, processId);
         this.SmpNavigator.CurrentNode = " " + flowName;
         this.LblWorkFlows.Text        = flowName;
         if (action == "Modify")
         {
             FlowProcessInfo flowProcessById = FlowProcess.GetFlowProcessById(workFlowsId, processId);
             if (!flowProcessById.IsNull)
             {
                 this.TxtProcessName.Text = flowProcessById.ProcessName;
                 this.TxtDescription.Text = flowProcessById.Description;
             }
             this.GetProcessStatusCodeList(workFlowsId, processId);
             this.EChklProcessGroup.SetSelectValue(FlowProcess.GetGroupIdByProcessIdAndFlowId(flowProcessById.FlowId, flowProcessById.ProcessId));
             this.TxtPassActionName.Text             = flowProcessById.PassActionName;
             this.DropPassActionStatus.SelectedValue = flowProcessById.PassActionStatus.ToString();
             this.TxtRejectActionName.Text           = flowProcessById.RejectActionName;
             this.DropRejectActionStatus.Text        = flowProcessById.RejectActionStatus.ToString();
             this.HdnAction.Value    = action;
             this.HdnProcessId.Value = flowProcessById.ProcessId.ToString();
         }
     }
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        private void GetProcessStatusCodeList(int flowId, int processId)
        {
            IList <StatusInfo> processStatusCodeList = FlowProcess.GetProcessStatusCodeList(flowId, processId);

            for (int i = 0; i < processStatusCodeList.Count; i++)
            {
                foreach (ListItem item in this.ListProcessStatusCode.Items)
                {
                    if (item.Value == processStatusCodeList[i].StatusCode.ToString())
                    {
                        item.Selected = true;
                        break;
                    }
                }
            }
        }
Ejemplo n.º 4
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         if (this.DropPassActionStatus.SelectedValue == this.DropRejectActionStatus.SelectedValue)
         {
             AdminPage.WriteErrMsg("<li>“通过后的状态”与“打回后的状态”必须不同!</li>");
         }
         FlowProcessInfo flowProcessInfo = new FlowProcessInfo();
         if (this.HdnAction.Value == "Modify")
         {
             flowProcessInfo.ProcessId = BasePage.RequestInt32("ProcessID");
             flowProcessInfo.FlowId    = BasePage.RequestInt32("FlowID");
         }
         flowProcessInfo.FlowId             = DataConverter.CLng(this.HdnFlowId.Value);
         flowProcessInfo.ProcessName        = this.TxtProcessName.Text;
         flowProcessInfo.Description        = this.TxtDescription.Text;
         flowProcessInfo.PassActionName     = this.TxtPassActionName.Text;
         flowProcessInfo.PassActionStatus   = DataConverter.CLng(this.DropPassActionStatus.SelectedValue);
         flowProcessInfo.RejectActionName   = this.TxtRejectActionName.Text;
         flowProcessInfo.RejectActionStatus = DataConverter.CLng(this.DropRejectActionStatus.SelectedValue);
         StringBuilder listControl = this.GetListControl(this.ListProcessStatusCode, "请选择可以执行操作的状态码!");
         string        roleIds     = this.EChklProcessGroup.SelectList();
         bool          flag        = false;
         if (this.HdnAction.Value == "Modify")
         {
             flag = FlowProcess.Update(flowProcessInfo, listControl.ToString(), roleIds);
         }
         else if (!FlowProcess.ExistFlowProcess(flowProcessInfo.FlowId, flowProcessInfo.ProcessName))
         {
             flag = FlowProcess.Add(flowProcessInfo, listControl.ToString(), roleIds);
         }
         else
         {
             AdminPage.WriteErrMsg("<li>存在相同的步骤名!</li>");
         }
         if (flag)
         {
             AdminPage.WriteSuccessMsg("<li>保存流程数据成功!</li>", "FlowProcessManage.aspx?FlowId=" + BasePage.RequestString("FlowId") + "&ProcessID=" + BasePage.RequestString("FlowId"));
         }
         else
         {
             AdminPage.WriteErrMsg("<li>保存流程数据失败!</li>");
         }
     }
 }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         string str3;
         string str      = BasePage.RequestString("Action");
         string flowName = WorkFlow.GetWorkFlowsById(BasePage.RequestInt32("FlowID")).FlowName;
         if (((str3 = str) != null) && (str3 == "Delete"))
         {
             if (FlowProcess.Delete(BasePage.RequestInt32("FlowID"), BasePage.RequestInt32("ProcessID")))
             {
                 AdminPage.WriteSuccessMsg("<li>流程步骤删除成功!</li>", "FlowProcessManage.aspx?FlowId=" + BasePage.RequestString("FlowId") + "&ProcessID=" + BasePage.RequestString("FlowId"));
             }
             else
             {
                 AdminPage.WriteErrMsg("<li>流程步骤删除失败!</li>");
             }
         }
         this.SmpNavigator.CurrentNode = " " + flowName;
     }
 }
Ejemplo n.º 6
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            = "取消审核";
                }
            }
        }
Ejemplo n.º 8
0
 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;
     }
 }
Ejemplo n.º 9
0
        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();
        }