Example #1
0
		/// <summary>
		/// 选中装载流程列表
		/// </summary>
		/// <param name="iSqlstr"></param>
		/// <param name="StartNotes"></param>
        public static void LoadWorkFlowSelectNode(string key, TreeNodeCollection startNodes)
		{
			if (startNodes==null)
                throw new Exception("LoadWorkFlowSelectNode的参数startNotes不能为空!");

            DataTable table = WorkFlowClass.GetWorkflowsByClassId(key);
			//startNodes.Clear();
            //deleteNode(startNodes);
			foreach(DataRow row in table.Rows)
			{

                WorkFlowTreeNode tmpNode = new WorkFlowTreeNode();
                tmpNode.NodeId = row["WorkFlowId"].ToString();
                tmpNode.WorkFlowClassId = row["WFClassId"].ToString();
				tmpNode.ImageIndex=2;
				tmpNode.SelectedImageIndex=2;
                tmpNode.ToolTipText = "流程";
                tmpNode.Status = row["Status"].ToString();
                tmpNode.Text = row["FlowCaption"].ToString();
                tmpNode.MgrUrl=row["mgrurl"].ToString();
                tmpNode.Description = row["Description"].ToString();
                tmpNode.NodeType = WorkConst.WORKFLOW_FLOW;
				startNodes.Add(tmpNode);

			}

		}
Example #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            
            
            if (formState == WorkConst.STATE_ADD)
            {
                WorkFlowTreeNode tmpNodeInfo = new WorkFlowTreeNode();
                tmpNodeInfo.WorkFlowClassId = InfoId;
                tmpNodeInfo.NodeId = Guid.NewGuid().ToString();
                tmpNodeInfo.NodeType = WorkConst.WORKFLOW_FLOW;
                tmpNodeInfo.Text = tbxWorkflowCaption.Text;
                if (tbxPath.Tag!=null)
                tmpNodeInfo.MgrUrl = tbxPath.Tag.ToString();
                if (cbxStatus.Checked) tmpNodeInfo.Status = "1";
                else
                    tmpNodeInfo.Status = "0";
                tmpNodeInfo.Description = tbxDescription.Text;
                
                if (tmpNodeInfo.NodeType == WorkConst.WORKFLOW_CLASS)//点击的是分类节点
                {
                    tmpNodeInfo.InsertWorkflowNode();
                    nowTreeNode.Nodes.Add(tmpNodeInfo);
                }
                else
                    if (tmpNodeInfo.NodeType == WorkConst.WORKFLOW_FLOW)//点击的是流程节点
                    {
                        //nowTreeNode.Parent.Nodes.Add(tmpNodeInfo);
                        WF_WorkFlow wf = (WF_WorkFlow)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkFlowList", " where FlowCaption='" + tbxWorkflowCaption.Text + "'");
                        if(wf!=null)
                        {
                            MsgBox.ShowWarningMessageBox("流程名 " + tbxWorkflowCaption.Text + " 已经存在,不能重复");
                            return;
                        }
                        tmpNodeInfo.InsertWorkflowNode();
                        nowTreeNode.Nodes.Add(tmpNodeInfo);
                        //保存控制权限
                        WorkFlowTask.DeleteAllPower((tmpNodeInfo as WorkFlowTreeNode).NodeId, (tmpNodeInfo as WorkFlowTreeNode).NodeId);
                        if (cbxFuJian.Checked)
                        {
                            WorkFlowTask.SetTaskPower(WorkConst.WorkTask_FuJian, tmpNodeInfo.NodeId, tmpNodeInfo.NodeId);
                            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        }
                        if (checkHuiQianYiJian.Checked)
                        {
                            WorkFlowTask.SetTaskPower(WorkConst.WorkTask_SPYJ, tmpNodeInfo.NodeId, tmpNodeInfo.NodeId);
                            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        }

                        if (cbxExplore.Checked)
                        {
                            WorkFlowTask.SetTaskPower(WorkConst.WorkTask_FlowEndExplore, tmpNodeInfo.NodeId, tmpNodeInfo.NodeId);
                            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        }
                        if (checkFollow.Checked)
                        {
                            WorkFlowTask.SetTaskPower(WorkConst.WorkTask_WorkFollow, tmpNodeInfo.NodeId, tmpNodeInfo.NodeId);
                            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        }
                        
                    }
               
            }
            else ////肯定点的是流程节点
            {

                nowTreeNode.Text = tbxWorkflowCaption.Text;
                if (tbxPath.Tag!=null) (nowTreeNode as WorkFlowTreeNode).MgrUrl = tbxPath.Tag.ToString();
                nowTreeNode.NodeType = WorkConst.WORKFLOW_FLOW;
                (nowTreeNode as WorkFlowTreeNode).Description = tbxDescription.Text;
                if (cbxStatus.Checked) (nowTreeNode as WorkFlowTreeNode).Status = "1";
                else
                    (nowTreeNode as WorkFlowTreeNode).Status = "0";
                (nowTreeNode as WorkFlowTreeNode).UpdateWorkflowNode(); 
                //保存控制权限
                WorkFlowTask.DeleteAllPower((nowTreeNode as WorkFlowTreeNode).NodeId, (nowTreeNode as WorkFlowTreeNode).NodeId);
                if (cbxFuJian.Checked)
                {
                   WorkFlowTask.SetTaskPower(WorkConst.WorkTask_FuJian, (nowTreeNode as WorkFlowTreeNode).NodeId, (nowTreeNode as WorkFlowTreeNode).NodeId);
                   Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                }
                if (checkHuiQianYiJian.Checked)
                {
                    WorkFlowTask.SetTaskPower(WorkConst.WorkTask_SPYJ, (nowTreeNode as WorkFlowTreeNode).NodeId, (nowTreeNode as WorkFlowTreeNode).NodeId);
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                }
                if (cbxExplore.Checked)
                {
                    WorkFlowTask.SetTaskPower(WorkConst.WorkTask_FlowEndExplore, (nowTreeNode as WorkFlowTreeNode).NodeId, (nowTreeNode as WorkFlowTreeNode).NodeId);
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                }
                if (checkFollow.Checked)
                {
                    WorkFlowTask.SetTaskPower(WorkConst.WorkTask_WorkFollow, (nowTreeNode as WorkFlowTreeNode).NodeId, (nowTreeNode as WorkFlowTreeNode).NodeId);
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                }
               
            }
            this.Close();
            

        }