예제 #1
0
        /// <summary>
        /// 流程是否最后一步(公文,限定和自由判断方式不同)
        /// </summary>
        public bool IsLastStep(M_OA_Document oaMod, M_MisProLevel currentModel)
        {
            B_MisProLevel stepBll = new B_MisProLevel();
            DataTable     dt      = new DataTable();
            bool          flag    = false;

            switch (oaMod.ProType)
            {
            case (int)M_MisProcedure.ProTypes.Admin:
            case (int)M_MisProcedure.ProTypes.AdminFree:
                dt = stepBll.SelByProID(oaMod.ProID);
                break;

            case (int)M_MisProcedure.ProTypes.Free:    //1:0
            default:
                dt = SelDTByDocID(currentModel.BackOption);
                break;
            }
            if (dt.Rows.Count < 1)
            {
                throw new Exception("流程下未定义步骤");
            }
            model = model.GetModelFromDR(dt.Rows[(dt.Rows.Count - 1)]);
            flag  = (model.stepNum == currentModel.stepNum);
            return(flag);
        }
예제 #2
0
        /// <summary>
        /// 获取下一步骤,支持分支
        /// </summary>
        public DataTable GetNextStepDT(M_OA_Document oaMod)
        {
            //ParentID>0,直接分叉流程行进,不必考虑返回等,分叉直至归档,条条支线通归档
            B_MisProLevel stepBll = new B_MisProLevel();

            if (oaMod.ProType != (int)M_MisProcedure.ProTypes.AdminFree)
            {
                throw new Exception("流程类型错误");
            }
            DataTable dt = stepBll.SelByProID(oaMod.ProID);

            //流程下未定义步骤
            if (dt.Rows.Count < 1)
            {
                return(null);
            }
            //获取当前步骤模型
            M_MisProLevel curStepMod = SelByDocIDAndStepNum(oaMod.ID, oaMod.CurStepNum);

            //查看其有无子流程,首步不允许子流程
            if (oaMod.CurStepNum > 0)
            {
                M_MisProLevel orginStepMod = stepBll.SelReturnModel(curStepMod.OrginStepID);
                dt.DefaultView.RowFilter = "ParentID=" + orginStepMod.ID + " AND StepNum=1";//这里读的是free中的ID导致,应该读原中的ID
                if (dt.DefaultView.ToTable().Rows.Count > 0)
                {
                    return(dt.DefaultView.ToTable());
                }
            }
            //同层级下是否有步骤序号大于其的
            dt.DefaultView.RowFilter = "ParentID=" + curStepMod.ParentID + " AND StepNum=" + (curStepMod.stepNum + 1);
            if (dt.DefaultView.ToTable().Rows.Count > 0)
            {
                return(dt.DefaultView.ToTable());
            }
            return(null);
        }