Example #1
0
        /// <summary>
        /// 获取所有下级员工(级别是通过职位来分的)
        /// </summary>
        /// <param name="employeeId">员工编号</param>
        /// <returns></returns>
        public List <TB_Employee_Employees> GetAllChildEmployee(int employeeId)
        {
            Employee_Duty_BLL dutyDal = new Employee_Duty_BLL();
            string            dutyIds = dutyDal.GetAllChildDutyStr(employeeId);

            Employee_Departments_BLL departmentsDal = new Employee_Departments_BLL();
            string departments = departmentsDal.GetAllChildDepartmentsStr(employeeId);

            dutyIds = dutyIds == "" ? "0" : dutyIds;

            departments = departments == "" ? "0" : departments;

            List <Expression> expression = new List <Expression>();

            expression.Add(new Expression("DutyID", "in", dutyIds));
            expression.Add(new Expression("DepartmentID", "in", departments));

            return(Search(expression));
        }
Example #2
0
        /// <summary>
        /// 获取用户在审批流下面所有的审批节点
        /// </summary>
        /// <param name="mainCode"></param>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public string GetStates(string mainCode, int employeeId)
        {
            Employee_Duty_BLL dutyBll = new Employee_Duty_BLL();
            string            dutyIds = dutyBll.GetAllChildDutyStr(employeeId);

            dutyIds = "0," + dutyIds;
            dutyIds = dutyIds.TrimEnd(',');

            string nodeIds  = "0,";
            var    nodelist = Search(s => s.MainCode == mainCode);

            foreach (var item in nodelist)
            {
                nodeIds += item.Id + ",";
            }
            nodeIds = nodeIds.TrimEnd(',');

            List <Expression> expression = new List <Expression>();

            expression.Add(new Expression("NodeID", "in", nodeIds));
            expression.Add(new Expression("and (("));
            expression.Add(new Expression("ObjectID", "=", employeeId));
            expression.Add(new Expression("Type", "=", 0));
            expression.Add(new Expression(") or ("));
            expression.Add(new Expression("ObjectID", "in", dutyIds));
            expression.Add(new Expression("Type", "=", 1));
            expression.Add(new Expression("))"));

            WorkFlow_Approval_BLL       approvalBLL = new WorkFlow_Approval_BLL();
            List <TB_WorkFlow_Approval> list        = approvalBLL.Search(expression);
            string ids = "";

            foreach (var item in list)
            {
                ids += item.NodeID + ",";
            }
            ids = ids.TrimEnd(',');
            return(ids);
        }