private void btnSave_Click(object sender, EventArgs e)
 {
     if (formState == WorkConst.STATE_ADD)
     {
         var tmpNodeInfo = new WorkFlowClassTreeNode
         {
             WorkflowFatherClassId = InfoId,
             NodeId      = Guid.NewGuid().ToString(),
             NodeType    = WorkConst.WORKFLOW_CLASS,
             Text        = tbxClassCaption.Text,
             Description = tbxDescription.Text,
             clLevel     = Convert.ToInt16(tbxCllevel.Text)
         };
         tmpNodeInfo.InsertWorkflowClassNode();
         tmpNodeInfo.MgrUrl = tbxPath.Text;
         if (nowTreeNode.NodeType == WorkConst.WORKFLOW_CLASS)//点击的是分类节点
         {
             nowTreeNode.Nodes.Add(tmpNodeInfo);
         }
     }
     else ////肯定点的是流程节点
     {
         nowTreeNode.Text     = tbxClassCaption.Text;
         nowTreeNode.NodeType = WorkConst.WORKFLOW_CLASS;
         nowTreeNode.MgrUrl   = tbxPath.Text;
         (nowTreeNode as WorkFlowClassTreeNode).Description = tbxDescription.Text;
         (nowTreeNode as WorkFlowClassTreeNode).clLevel     = Convert.ToInt16(tbxCllevel.Text);
         (nowTreeNode as WorkFlowClassTreeNode).UpdateWorkflowClassNode();
     }
     this.Close();
 }
示例#2
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;
            }
        }
 /// <summary>
 /// 选中装载流程类型
 /// </summary>
 /// <param name="key"></param>
 /// <param name="startNodes"></param>
 public static void LoadWorkFlowClassSelectNode(string key, TreeNodeCollection startNodes)
 {
     try
     {
         var table = RDIFrameworkService.Instance.WorkFlowTemplateService.GetChildWorkFlowClass(SystemInfo.UserInfo, key);
         foreach (DataRow row in table.Rows)
         {
             var tmpNode = new WorkFlowClassTreeNode
             {
                 NodeId             = row[WorkFlowClassTable.FieldWFClassId].ToString(),
                 ImageIndex         = 0,
                 ToolTipText        = "分类",
                 SelectedImageIndex = 1,
                 clLevel            = Convert.ToInt16(row[WorkFlowClassTable.FieldClLevel]),
                 Text = row[WorkFlowClassTable.FieldCaption].ToString(),
                 WorkflowFatherClassId = row[WorkFlowClassTable.FieldFatherId].ToString(),
                 Description           = row[WorkFlowClassTable.FieldDescription].ToString(),
                 MgrUrl   = row[WorkFlowClassTable.FieldClMgrUrl].ToString(),
                 NodeType = WorkConst.WORKFLOW_CLASS
             };
             startNodes.Add(tmpNode);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#4
0
        private void delclassToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DesignerHelper.IsPower(UserId, (sender as ToolStripMenuItem).Tag.ToString()) == false)
            {
                return;
            }
            if (_nowTreeNode.Nodes.Count > 0)
            {
                MessageBoxHelper.ShowWarningMsg("删除失败,流程分类下面有子分类或者流程不能删除!");
                return;
            }

            if (MessageBoxHelper.Show("是否删除分类[" + _nowTreeNode.Text + "]?删除后不能恢复。") == DialogResult.Yes)
            {
                WorkFlowClassTreeNode.DeleteSelectClassNode(_nowTreeNodeId);
                _nowTreeNode.Remove();
            }
        }
示例#5
0
 private void SelectDutyFm_Load(object sender, EventArgs e)
 {
     WorkFlowClassTreeNode.LoadWorkFlowClass("####", tvWorkClass.Nodes);
     tvWorkClass.ExpandAll();
 }
示例#6
0
 public override void FormOnLoad()
 {
     WorkFlowClassTreeNode.LoadWorkFlowClass("####", treeWorkflow.Nodes);
     treeWorkflow.ExpandAll();
 }