/// <summary> /// 先删除与该项目有关的所有员工 再新添加员工 /// </summary> /// <param name="epRel">新添加员工</param> /// <returns>如果添加成功返回 true 否则返回false</returns> public bool AddAfterDeleteInfo(List <EPRelation> epRel) { EPRelationDal erpDal = new EPRelationDal(); if (epRel == null) { return(false); } return(erpDal.AddAfterDeleteInfo(epRel)); }
/// <summary> /// 根据员工号查询他所属项目,返回项目名集合 /// </summary> /// <param name="id">员工号</param> /// <returns>项目名称的集合</returns> public List <string> QueryLikeThis(string id) { EPRelationDal eDal = new EPRelationDal(); List <string> list = new List <string>(); list.Clear(); var datas = eDal.QueryLikeThis(id); if (datas.Count == null) { return(null); } foreach (var item in datas) { list.Add(item.ProjectName); } return(list); }
/// <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); }