Example #1
0
        private void treeWorkflow_AfterSelect(object sender, TreeViewEventArgs e)
        {
            _nowTreeNode   = (BaseTreeNode)treeWorkflow.SelectedNode;
            _nowTreeNodeId = _nowTreeNode.NodeId;
            MenuEnable(_nowTreeNode.NodeType);

            if (_nowTreeNode.NodeType == WorkConst.WORKFLOW_CLASS)
            {
                _nowTreeNode.Nodes.Clear();
                WorkFlowClassTreeNode.LoadWorkFlowClassSelectNode(_nowTreeNodeId, _nowTreeNode.Nodes);
                WorkFlowTreeNode.LoadWorkFlowSelectNode(_nowTreeNodeId, _nowTreeNode.Nodes);
            }

            if (_nowTreeNode.NodeType == WorkConst.WORKFLOW_FLOW)
            {
                if (WpClient != null)
                {
                    WpClient.closeFlow();
                }

                this.plClient.Controls.Clear();
                WpClient = new WorkPlace(_nowTreeNodeId, UserId, UserName)
                {
                    WorkFlowCaption = _nowTreeNode.Text,
                    CanEdit         = true,
                    State           = WorkConst.STATE_MOD
                };
                this.plClient.Controls.Add(WpClient);
                toolStrip1.Enabled = true;
            }
        }
Example #2
0
        /// <summary>
        /// 选中装载流程列表
        /// </summary>
        /// <param name="key"></param>
        /// <param name="startNodes"></param>
        public static void LoadWorkFlowSelectNode(string key, TreeNodeCollection startNodes)
        {
            if (startNodes == null)
            {
                throw new Exception("LoadWorkFlowSelectNode的参数startNotes不能为空!");
            }

            var table = RDIFrameworkService.Instance.WorkFlowTemplateService.GetWorkFlowsByClassId(SystemInfo.UserInfo, key);

            foreach (DataRow row in table.Rows)
            {
                var tmpNode = new WorkFlowTreeNode
                {
                    NodeId             = row["WorkFlowId"].ToString(),
                    WorkFlowClassId    = row["WFClassId"].ToString(),
                    ImageIndex         = 2,
                    SelectedImageIndex = 2,
                    ToolTipText        = "流程",
                    Status             = row["Status"].ToString(),
                    Text        = row["FlowCaption"].ToString(),
                    MgrUrl      = row["mgrurl"].ToString(),
                    Description = row["Description"].ToString(),
                    NodeType    = WorkConst.WORKFLOW_FLOW
                };
                if (!string.IsNullOrEmpty(tmpNode.Status) && tmpNode.Status == "0")
                {
                    tmpNode.ForeColor = System.Drawing.Color.DarkGray;
                }

                startNodes.Add(tmpNode);
            }
        }
Example #3
0
 private void delWftoolStripMenuItem3_Click(object sender, EventArgs e)
 {
     if (DesignerHelper.IsPower(UserId, (sender as ToolStripMenuItem).Tag.ToString()) == false)
     {
         return;
     }
     if (MessageBoxHelper.Show("是否删除流程[" + _nowTreeNode.Text + "]? 删除后不能恢复。") == DialogResult.Yes)
     {
         WorkFlowTreeNode.DeleteSelectWorkflowNode(_nowTreeNodeId);
         _nowTreeNode.Remove();
     }
 }
Example #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (formState == WorkConst.STATE_ADD)
            {
                WorkFlowTreeNode tmpNodeInfo = new WorkFlowTreeNode
                {
                    WorkFlowClassId = InfoId,
                    NodeId          = Guid.NewGuid().ToString(),
                    NodeType        = WorkConst.WORKFLOW_FLOW,
                    Text            = tbxWorkflowCaption.Text,
                    MgrUrl          = tbxPath.Text,
                    Status          = chkStatus.Checked ? "1" : "0",
                    Description     = tbxDescription.Text
                };
                tmpNodeInfo.InsertWorkflowNode();
                switch (nowTreeNode.NodeType)
                {
                case WorkConst.WORKFLOW_CLASS:
                    nowTreeNode.Nodes.Add(tmpNodeInfo);
                    break;

                case WorkConst.WORKFLOW_FLOW:
                    nowTreeNode.Parent.Nodes.Add(tmpNodeInfo);
                    break;
                }
            }
            else //肯定点的是流程节点
            {
                nowTreeNode.Text = tbxWorkflowCaption.Text;
                (nowTreeNode as WorkFlowTreeNode).MgrUrl = tbxPath.Text;
                nowTreeNode.NodeType = WorkConst.WORKFLOW_FLOW;
                (nowTreeNode as WorkFlowTreeNode).Description = tbxDescription.Text;
                (nowTreeNode as WorkFlowTreeNode).Status      = chkStatus.Checked ? "1" : "0";
                (nowTreeNode as WorkFlowTreeNode).UpdateWorkflowNode();
            }
            this.Close();
        }