Пример #1
0
        /// <summary>
        /// 检查节点是否是启用接收人选择器
        /// </summary>
        /// <returns></returns>
        private string CheckAccepterOper()
        {
            int tempToNodeID = 0;
            //获取到当前节点
            Node _HisNode = new Node(this.FK_Node);

            /*如果到达的点为空 */
            Nodes nds = _HisNode.HisToNodes;

            if (nds.Count == 0)
            {
                //当前点是最后的一个节点,不能使用此功能
                return("end");
            }
            else if (nds.Count == 1)
            {
                BP.WF.Node toND = nds[0] as BP.WF.Node;
                tempToNodeID = toND.NodeID;
            }
            else
            {
                foreach (BP.WF.Node mynd in nds)
                {
                    //if (mynd.HisDeliveryWay != DeliveryWay.BySelected)
                    //    continue;

                    GERpt _wk = _HisNode.HisFlow.HisGERpt;
                    _wk.OID = this.WorkID;
                    _wk.Retrieve();
                    _wk.ResetDefaultVal();

                    #region 过滤不能到达的节点.
                    Cond cond = new Cond();
                    int  i    = cond.Retrieve(CondAttr.FK_Node, _HisNode.NodeID, CondAttr.ToNodeID, mynd.NodeID);
                    if (i == 0)
                    {
                        continue; // 没有设置方向条件,就让它跳过去。
                    }
                    cond.WorkID = this.WorkID;
                    cond.en     = _wk;
                    if (cond.IsPassed == false)
                    {
                        continue;
                    }
                    #endregion 过滤不能到达的节点.
                    tempToNodeID = mynd.NodeID;
                }
            }
            //不存在下一个节点,检查是否配置了有用户选择节点
            if (tempToNodeID == 0)
            {
                try
                {
                    //检查必填项
                    BP.WF.WorkNode workeNode = new WorkNode(this.WorkID, this.FK_Node);
                    workeNode.CheckFrmIsNotNull();
                }
                catch (Exception ex)
                {
                    return("error:" + ex.Message);
                }
                //按照用户选择计算
                if (_HisNode.CondModel == CondModel.ByUserSelected)
                {
                    return("byuserselected");
                }
                return("notonode");
            }

            //判断到达的节点是否是按接受人选择
            Node toNode = new Node(tempToNodeID);
            if (toNode.HisDeliveryWay == DeliveryWay.BySelected)
            {
                return("byselected");
            }
            return("nodata");
        }