Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var cond = new Cond();

            if (cond.Retrieve(CondAttr.NodeID, this.FK_Node, CondAttr.ToNodeID, this.ToNodeId) != 0)
            {
                CurrentCond = DataFrom[cond.HisDataFrom];
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化Init.
        /// </summary>
        /// <returns></returns>
        public string Condition_Init()
        {
            string toNodeID = this.GetRequestVal("ToNodeID");
            var    cond     = new Cond();

            cond.Retrieve(CondAttr.NodeID, this.FK_Node, CondAttr.ToNodeID, toNodeID);
            cond.Row.Add("HisDataFrom", cond.HisDataFrom.ToString());

            //   cond.HisDataFrom
            //CurrentCond = DataFrom[cond.HisDataFrom];
            return(cond.ToJson());
        }
Пример #3
0
        /// <summary>
        /// 绑定多分支
        /// </summary>
        public void BindMStations()
        {
            this.BindByStation();

            Nodes mynds = this.HisNode.HisToNodes;

            this.Left.Add("<fieldset><legend>&nbsp;选择方向:列出所选方向设置的人员&nbsp;</legend>");
            string str = "<p>";

            foreach (BP.WF.Node mynd in mynds)
            {
                if (mynd.HisDeliveryWay != DeliveryWay.BySelected)
                {
                    continue;
                }

                #region 过滤不能到达的节点.
                Cond cond = new Cond();
                int  i    = cond.Retrieve(CondAttr.FK_Node, this.HisNode.NodeID, CondAttr.ToNodeID, mynd.NodeID);
                if (i == 0)
                {
                    continue; // 没有设置方向条件,就让它跳过去。
                }
                cond.WorkID = this.WorkID;
                cond.en     = geRpt;
                if (cond.IsPassed == false)
                {
                    continue;
                }
                #endregion 过滤不能到达的节点.

                if (this.ToNode == mynd.NodeID)
                {
                    str += "&nbsp;&nbsp;<b class='l-link'><font color='red' >" + mynd.Name + "</font></b>";
                }
                else
                {
                    str += "&nbsp;&nbsp;<b><a class='l-link' href='Accepter.aspx?FK_Node=" + this.FK_Node + "&type=1&ToNode=" + mynd.NodeID + "&WorkID=" + this.WorkID + "&WorkIDs=" + this.WorkIDs + "' >" + mynd.Name + "</a></b>";
                }
            }
            this.Left.Add(str + "</p>");
            this.Left.AddFieldSetEnd();
        }
Пример #4
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");
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Pub1.Clear();
            this.Title = "选择下一步骤接受的人员";

            //判断是否需要转向。
            if (this.ToNode == 0)
            {
                int num          = 0;
                int tempToNodeID = 0;

                /*如果到达的点为空 */

                /*首先判断当前节点的ID,是否配置到了其他节点里面,
                 * * 如果有则需要转向高级的选择框中去,当前界面不能满足公文类的选择人需求。*/
                string sql = "SELECT COUNT(*) FROM WF_Node WHERE FK_Flow='" + this.HisNode.FK_Flow + "' AND " + NodeAttr.DeliveryWay + "=" + (int)DeliveryWay.BySelected + " AND " + NodeAttr.DeliveryParas + " LIKE '%" + this.HisNode.NodeID + "%' ";

                if (DBAccess.RunSQLReturnValInt(sql, 0) > 0)
                {
                    /*说明以后的几个节点人员处理的选择 */
                    string url = "AccepterAdv.aspx?1=3" + this.RequestParas;
                    this.Response.Redirect(url, true);
                    return;
                }

                Nodes nds = this.HisNode.HisToNodes;
                if (nds.Count == 0)
                {
                    this.Pub1.AddFieldSetRed("提示", "当前点是最后的一个节点,不能使用此功能。");
                    return;
                }
                else if (nds.Count == 1)
                {
                    BP.WF.Node toND = nds[0] as BP.WF.Node;
                    tempToNodeID = toND.NodeID;
                }
                else
                {
                    BP.WF.Node nd = new BP.WF.Node(this.FK_Node);
                    foreach (BP.WF.Node mynd in nds)
                    {
                        if (mynd.HisDeliveryWay != DeliveryWay.BySelected)
                        {
                            continue;
                        }

                        #region 过滤不能到达的节点.
                        if (nd.CondModel == CondModel.ByLineCond)
                        {
                            Cond cond = new Cond();
                            int  i    = cond.Retrieve(CondAttr.FK_Node, this.HisNode.NodeID, CondAttr.ToNodeID, mynd.NodeID);
                            if (i == 0)
                            {
                                continue; // 没有设置方向条件,就让它跳过去。
                            }
                            cond.WorkID = this.WorkID;
                            cond.en     = geRpt;
                            if (cond.IsPassed == false)
                            {
                                continue;
                            }
                        }
                        #endregion 过滤不能到达的节点.
                        tempToNodeID = mynd.NodeID;
                        num++;
                    }
                }

                if (tempToNodeID == 0)
                {
                    this.WinCloseWithMsg("@流程设计错误:\n\n 当前节点的所有分支节点没有一个接受人员规则为按照选择接受。");
                    return;
                }


                this.Response.Redirect("Accepter.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&ToNode=" + tempToNodeID + "&FID=" + this.FID + "&type=1&WorkID=" + this.WorkID + "&WorkIDs=" + this.WorkIDs + "&IsWinOpen=" + this.IsWinOpen, true);
                return;
            }


            try
            {
                /* 首先判断是否有多个分支的情况。*/
                if (ToNode == 0 && this.IsMFZ)
                {
                    //IsMultiple = true;
                    //this.BindMStations();
                    return;
                }
                MySelector = new Selector(this.ToNode);
                switch (MySelector.SelectorModel)
                {
                case SelectorModel.Station:
                    returnValue("BindByStation");
                    break;

                case SelectorModel.SQL:
                    returnValue("BindBySQL");
                    break;

                case SelectorModel.Dept:
                    returnValue("BindByDept");
                    break;

                case SelectorModel.Emp:
                    returnValue("BindByEmp");
                    break;

                case SelectorModel.Url:
                    if (MySelector.SelectorP1.Contains("?"))
                    {
                        this.Response.Redirect(MySelector.SelectorP1 + "&WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node, true);
                    }
                    else
                    {
                        this.Response.Redirect(MySelector.SelectorP1 + "?WorkID=" + this.WorkID + "&FK_Node=" + this.FK_Node, true);
                    }
                    return;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Pub1.Clear();
                this.Pub1.AddMsgOfWarning("错误", ex.Message);
            }
        }