Пример #1
0
 public static List <App.Score.Entity.FuncEntry> GetFuncs(string teacherID)
 {
     using (AppBLL bll = new AppBLL())
     {
         return(bll.FillList <FuncEntry>("s_p_getTeacherRight", new { TeacherID = teacherID }));
     }
 }
Пример #2
0
        /// <summary>
        /// 判断是否属于当前人审核
        /// </summary>
        /// <param name="flowEngine"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool CanAudit(FlowEngine flowEngine, int userId)
        {
            Step current = flowEngine.GetCurrent();

            if (current == null || current.NodeValidCount == 0)
            {
                return(false);
            }
            IList <Node> nodes = current.Nodes;

            using (AppBLL bll = new AppBLL())
            {
                IList <FunctionEntity> userFuncs = bll.FillList <FunctionEntity>("Usp_Funcs_ByUser", new { UserId = userId });
                foreach (var userFunc in userFuncs)
                {
                    var auditNodes = from node in nodes
                                     where node.Participant.Reference == userFunc.Id || node.Participant.Department == userId
                                     select node;
                    if (auditNodes.Any())
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #3
0
        /// <summary>
        /// 流程审核
        /// </summary>
        /// <param name="flowEngine">流程</param>
        /// <param name="auditType">审核类型</param>
        /// <param name="auditDesc">审核描述</param>
        /// <param name="userId">Sys_User.Id</param>
        /// <returns>true 审核成功 false 不能审核</returns>
        public bool Audit(FlowEngine flowEngine, AuditType auditType, string auditDesc, int userId)
        {
            using (AppBLL bll = new AppBLL())
            {
                Participant            participant = null;
                Conclusion             conclusion  = null;
                IList <FunctionEntity> userFuncs   = bll.FillList <FunctionEntity>("Usp_Funcs_ByUser", new { UserId = userId });
                foreach (var userFunc in userFuncs)
                {
                    participant = new Participant()
                    {
                        Category = 1, Department = -1, Reference = (long)userFunc.Id
                    };
                    conclusion = new Conclusion(auditType, (long)userId, DateTime.Now)
                    {
                        Description = auditDesc
                    };
                    if (flowEngine.Audit(conclusion, participant))
                    {
                        return(true);
                    }
                }

                participant = new Participant()
                {
                    Category = 0, Department = userId, Reference = -1
                };
                conclusion = new Conclusion(auditType, userId, DateTime.Now)
                {
                    Description = auditDesc
                };
                if (flowEngine.Audit(conclusion, participant))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        /// <summary>
        /// 判断是否属于当前人审核
        /// </summary>
        /// <param name="flowEngine"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool CanAudit(FlowEngine flowEngine, int userId)
        {
            Step current = flowEngine.GetCurrent();
            if (current == null || current.NodeValidCount == 0) return false;
            IList<Node> nodes = current.Nodes;

            using (AppBLL bll = new AppBLL())
            {
                IList<FunctionEntity> userFuncs = bll.FillList<FunctionEntity>("Usp_Funcs_ByUser", new { UserId = userId });
                foreach (var userFunc in userFuncs)
                {
                    var auditNodes = from node in nodes
                                     where node.Participant.Reference == userFunc.Id || node.Participant.Department == userId
                                     select node;
                    if (auditNodes.Any()) return true;
                }
            }
            return false;
        }
Пример #5
0
        /// <summary>
        /// 流程审核
        /// </summary>
        /// <param name="flowEngine">流程</param>
        /// <param name="auditType">审核类型</param>
        /// <param name="auditDesc">审核描述</param>
        /// <param name="userId">Sys_User.Id</param>
        /// <returns>true 审核成功 false 不能审核</returns>
        public bool Audit(FlowEngine flowEngine, AuditType auditType, string auditDesc, int userId)
        {
            using (AppBLL bll = new AppBLL())
            {
                Participant participant = null;
                Conclusion conclusion = null;
                IList<FunctionEntity> userFuncs = bll.FillList<FunctionEntity>("Usp_Funcs_ByUser", new { UserId = userId });
                foreach (var userFunc in userFuncs)
                {
                    participant = new Participant() { Category = 1, Department = -1, Reference = (long)userFunc.Id };
                    conclusion = new Conclusion(auditType, (long)userId, DateTime.Now) { Description = auditDesc };
                    if (flowEngine.Audit(conclusion, participant))
                    {
                        return true;
                    }
                }

                participant = new Participant() { Category = 0, Department = userId, Reference = -1 };
                conclusion = new Conclusion(auditType, userId, DateTime.Now) { Description = auditDesc };
                if (flowEngine.Audit(conclusion, participant))
                {
                    return true;
                }
            }
            return false;
        }