Ejemplo n.º 1
0
        /// <summary>
        /// 获得公司CompanyID下所有的员工的基本信息
        /// </summary>
        /// <param name="companyID"></param>
        /// <returns></returns>
        public List <Employee> GetEmployeeBasicInfoByCompanyID(int companyID)
        {
            List <Employee> employeeList = _dalEmployee.GetEmployeeBasicInfoByCompanyID(companyID);

            if (employeeList == null)
            {
                return(new List <Employee>());
            }
            foreach (Employee employee in employeeList)
            {
                LoadSEPInfo.SetEmployeeAccountInfo(employee.Account.Id, employee, _IAccountBll, _IDepartmentBll);
            }
            return(employeeList);
        }
Ejemplo n.º 2
0
        private List <Employee> LoadAndCompareAllEmployeeInfo(List <Employee> employeeList,
                                                              List <SearchField> otherSearchFieldList, bool isSearched, string partConst)
        {
            if ((otherSearchFieldList.Count > 0 && !isSearched) ||
                (otherSearchFieldList.Count == 0 && isSearched))
            {
                switch (partConst)
                {
                //加载员工基本信息,帐号信息
                case EmployeeFieldPara.EmployeeBasicInfoPart:
                    foreach (Employee employee in employeeList)
                    {
                        if (employee.EmployeeDetails != null)
                        {
                            employee.EmployeeDetails.Photo = null;
                        }
                        LoadSEPInfo.SetEmployeeAccountInfo(employee.Account.Id, employee, _IAccountBll,
                                                           _IDepartmentBll, _IPositionBll);
                        if (employee.EmployeeDetails != null &&
                            employee.EmployeeDetails.Work != null &&
                            employee.EmployeeDetails.Work.Company != null &&
                            employee.EmployeeDetails.Work.Company.Name != null &&
                            employee.EmployeeDetails.Work.Company.Name == "")
                        {
                            employee.EmployeeDetails.Work.Company =
                                _IDepartmentBll.GetDepartmentById(employee.EmployeeDetails.Work.Company.Id, null);
                        }
                    }
                    employeeList =
                        HrmisUtility.RemoteUnAuthEmployee(employeeList, AuthType.HRMIS, _OperationAccount,
                                                          HrmisPowers.A401);
                    break;

                //加载员工福利信息
                case EmployeeFieldPara.EmployeeWelfarePart:
                    foreach (Employee employee in employeeList)
                    {
                        employee.EmployeeWelfare =
                            new GetEmployeeWelfare(_IEmployeeWelfareHistory, _IEmployeeWelfare).
                            GetEmployeeWelfareByAccountID(
                                employee.Account.Id);
                    }
                    break;

                //加载员工国籍信息
                case EmployeeFieldPara.CountryNationalityPart:
                    foreach (Employee employee in employeeList)
                    {
                        if (employee.EmployeeDetails != null && employee.EmployeeDetails.CountryNationality != null)
                        {
                            employee.EmployeeDetails.CountryNationality =
                                new GetNationality().GetNationalityByPkid(
                                    employee.EmployeeDetails.CountryNationality.ParameterID);
                        }
                    }
                    break;

                //加载员工自定义流程信息
                case EmployeeFieldPara.DiyProcessPart:
                    foreach (Employee employee in employeeList)
                    {
                        employee.DiyProcessList =
                            new GetDiyProcess(_IDiyProcessDal, _IEmployeeDiyProcessDal, _IAccountBll, _IDepartmentBll).
                            GetEmployeeDiyProcesses(employee.Account.Id);
                    }
                    break;

                //加载员工年假信息
                case EmployeeFieldPara.VacationPart:
                    foreach (Employee employee in employeeList)
                    {
                        employee.EmployeeAttendance          = employee.EmployeeAttendance ?? new EmployeeAttendance();
                        employee.EmployeeAttendance.Vacation =
                            new GetVacation().GetLastVacationByAccountID(employee.Account.Id);
                    }
                    break;

                //加载员工调休信息
                case EmployeeFieldPara.AdjustPart:
                    foreach (Employee employee in employeeList)
                    {
                        employee.EmployeeAttendance = employee.EmployeeAttendance ?? new EmployeeAttendance();
                        employee.EmployeeAttendance.MonthAttendance = employee.EmployeeAttendance.MonthAttendance ?? new MonthAttendance();
                        employee.EmployeeAttendance.MonthAttendance.HoursofAdjustRestRemained =
                            new GetAdjustRest().GetNowAdjustRestByAccountID(employee.Account.Id).SurplusHours;
                    }
                    break;

                //加载员工技能信息
                case EmployeeFieldPara.SkillPart:
                    foreach (Employee employee in employeeList)
                    {
                        try
                        {
                            employee.EmployeeSkills =
                                _dalEmployeeSkill.GetEmployeeSkillByAccountID(employee.Account.Id
                                                                              , "", -1,
                                                                              SkillLevelEnum.All).EmployeeSkills;
                        }
                        catch
                        {
                        }
                    }
                    break;

                default:
                    break;
                }
                if (!isSearched)
                {
                    _EmployeeDoSearch = new EmployeeDoSearch(employeeList, otherSearchFieldList);
                    _EmployeeDoSearch.DoSearchExecute();
                    employeeList = _EmployeeDoSearch.EmployeeList;
                }
            }
            return(employeeList);
        }