public virtual List <PlacementBLL> GetEmployeesInPlaced() { try { List <PlacementBLL> EmployeesInPlacedBLLList = new List <PlacementBLL>(); List <EmployeesCareersHistory> Employees = new EmployeesCareersHistoryDAL().GetActiveEmployeesCareersHistory(); List <Assignings> Assignings = new AssigningsDAL().GetAssignings(); List <OrganizationsStructures> OrganizationsStructures = new OrganizationsStructuresDAL().GetOrganizationStructure(); int[] EmployeeCareerHistoryIDs = Assignings.Select(c => (int)c.EmployeeCareerHistoryID).ToArray(); int[] ManagerCodeIDs = OrganizationsStructures.Where(p => p.ManagerCodeID.HasValue == true).Select(c => c.ManagerCodeID.Value).ToArray(); //.Select(c => (int)c.ManagerCodeID).ToArray(); Employees.RemoveAll(x => EmployeeCareerHistoryIDs.Contains(x.EmployeeCareerHistoryID)); Employees.RemoveAll(o => ManagerCodeIDs.Contains(o.EmployeeCodeID)); foreach (var item in Employees) { EmployeesInPlacedBLLList.Add(new PlacementBLL() { EmployeeCareerHistory = new EmployeesCareersHistoryBLL().MapEmployeeCareerHistory(item) }); //new OrganizationsStructuresBLL().GetOrganizationNameTillLastParentExceptPresident(((InternalAssigningBLL)AssigningBLL).Organization.OrganizationID); EmployeesInPlacedBLLList.ForEach(x => x.EmployeeCareerHistory.OrganizationJob.OrganizationStructure.FullOrganizationName = new OrganizationsStructuresBLL().GetOrganizationNameTillLastParentExceptPresident(x.EmployeeCareerHistory.OrganizationJob.OrganizationStructure.OrganizationID)); } return(EmployeesInPlacedBLLList); } catch (Exception ex) { throw ex; } }