/// <summary> /// 根据项目名称查员工集合 /// </summary> /// <param name="name">项目名</param> /// <returns>项目员工集合</returns> public List <Employee> QueryProEmp(string name) { List <Employee> empList = new List <Employee>(); empList.Clear(); EPRelationDal eperDal = new EPRelationDal(); EmployeeBll empBll = new EmployeeBll(); var epRel = eperDal.QueryByProName(name);//取得项目名为name的关系表集合 if (epRel.Count == 0) { return(empList); } foreach (var item in epRel)//将关系表中项目名为name的员工id加入到员工id集合Emplist { //Employee emp = new Employee(); var emp = empBll.QueryById(item.EmployeeId); empList.Add(emp); } return(empList); }