///<summary>
        /// 通过员工姓名部门,得到考勤情况,只获得已经结束的考勤
        ///</summary>
        ///<returns></returns>
        public List <Employee> GetEmployeeAttendanceByCondition(string EmployeeName, int DepartmentID, int?gradesId,
                                                                DateTime FromDate, DateTime ToDate, Account _Account, int?powers)
        {
            _GetBadAttendance = new GetBadAttendance(_Account);

            List <Employee> retEmployeeList = new List <Employee>();
            List <Account>  AccountList     =
                _IAccountBll.GetAccountByBaseCondition(EmployeeName, DepartmentID, -1, gradesId, true, null);

            if (powers != null)
            {
                AccountList = Tools.RemoteUnAuthAccount(AccountList, AuthType.HRMIS, _Account, (int)powers);
            }
            List <Employee> EmployeeList = new List <Employee>();

            foreach (Account account in AccountList)
            {
                Employee employee = _dalEmployee.GetEmployeeBasicInfoByAccountID(account.Id);
                if (employee == null)
                {
                    continue;
                }
                employee.Account = account;
                EmployeeList.Add(employee);
            }

            for (int i = 0; i < EmployeeList.Count; i++)
            {
                if (GetEmployeeAttendanceInfo(EmployeeList[i], FromDate, ToDate))
                {
                    retEmployeeList.Add(EmployeeList[i]);
                }
            }
            return(retEmployeeList);
        }
Ejemplo n.º 2
0
        ///<summary>
        /// 条件查询员工打卡修改日志信息
        ///</summary>
        public List <AttendanceInAndOutRecordLog> GetInAndOutLogByCondition(string employeeName, int DempartmentId,
                                                                            DateTime operateTiemFrom,
                                                                            DateTime operateTimeTo, string operatorName,
                                                                            DateTime oldIOTimeFrom, DateTime oldIOTimeTo)
        {
            List <Account> accountList = _IAccountBll.GetAccountByBaseCondition(employeeName, DempartmentId, -1, null, true, null);

            if (DempartmentId == -1)
            {
                accountList = Tools.RemoteUnAuthAccount(accountList, AuthType.HRMIS, _LoginUser, HrmisPowers.A508);
            }

            List <AttendanceInAndOutRecordLog> logs = _DalLog.GetInAndOutLogByCondition(operateTiemFrom, operateTimeTo,
                                                                                        operatorName, oldIOTimeFrom,
                                                                                        oldIOTimeTo);

            for (int i = logs.Count - 1; i >= 0; i--)
            {
                Account temp = Tools.FindAccountById(accountList, logs[i].EmployeeID);

                if (temp == null)
                {
                    logs.RemoveAt(i);
                }
                else
                {
                    logs[i].EmployeeName = temp.Name;
                }
            }
            return(logs);
        }
Ejemplo n.º 3
0
        public void SearchEmployee(object sender, EventArgs e)
        {
            int positionID   = _View.PositionID;
            int departmentID = _View.DepartmentID;

            _View.EmployeeLeft =
                BulletinUtility.RemoteUnAuthAccount(
                    _IAccount.GetAccountByBaseCondition(_View.EmployeeName, departmentID, positionID, null, true, true),
                    AuthType.SEP, LoginUser, Powers.A302);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 供报销统计使用
        /// </summary>
        /// <param name="employeeName"></param>
        /// <param name="companyID"></param>
        /// <param name="positionID"></param>
        /// <param name="departmentID"></param>
        /// <param name="recursionDepartment"></param>
        /// <returns></returns>
        public List <Employee> GetEmployeeByConditionForReimburseStatistics(string employeeName,
                                                                            int companyID, int positionID,
                                                                            int departmentID,
                                                                            bool recursionDepartment)
        {
            List <Employee> employeeList = new List <Employee>();
            List <Account>  accountList  =
                _IAccountBll.GetAccountByBaseCondition(employeeName, departmentID, positionID, null, recursionDepartment, null);

            foreach (Account account in accountList)
            {
                Employee employee = GetEmployeeBasicInfoByAccountID(account.Id);
                if (employee == null)
                {
                    continue;
                }
                if (companyID == -1 || employee.EmployeeDetails.Work.Company.Id == companyID)
                {
                    employee.Account = account;
                    employeeList.Add(employee);
                }
            }
            return(employeeList);
        }
        //public void InitControl()
        //{
        //    _View.PositionList = _IPositionBll.GetAllPosition();
        //    _View.DepartmentList = _IDepartmentBll.GetAllDepartment();
        //    _View.AccountRight = _View.AccountRight;
        //}

        public void SearchEmployee(object sender, EventArgs e)
        {
            int positionID   = _View.PositionID;
            int departmentID = _View.DepartmentID;

            List <Account> accountList =
                _IAccountBll.GetAccountByBaseCondition(_View.AccountName, departmentID, positionID, null, true, true);

            if (_PowerID != -1)
            {
                _View.AccountLeft = Tools.RemoteUnAuthAccount(accountList, AuthType.HRMIS, _LoginUser, _PowerID);
            }
            else
            {
                _View.AccountLeft = accountList;
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 为HR获取可申请考核的员工
        /// </summary>
        public List <Account> GetAssessActivityForHRApply(string employeeName,
                                                          EmployeeTypeEnum employeeType, int positionID,
                                                          int departmentID,
                                                          bool recursionDepartment, Account loginUser)
        {
            List <Account> retaccount = new List <Account>();
            Auth           myAuth     = loginUser.FindAuth(AuthType.HRMIS, HrmisPowers.A703);

            if (myAuth == null)
            {
                throw new ApplicationException("没有权限访问");
            }

            List <Account> accounts =
                RemoveInvalidationAccount(
                    _AccountBll.GetAccountByBaseCondition(employeeName, departmentID, positionID, null, recursionDepartment,
                                                          null));

            foreach (Account account in accounts)
            {
                Employee employee = new GetEmployee().GetEmployeeByAccountID(account.Id);
                if (employee == null)
                {
                    continue;
                }
                if (employeeType == EmployeeTypeEnum.All || employeeType == employee.EmployeeType)
                {
                    retaccount.Add(account);
                }
            }
            if (myAuth.Departments.Count == 0)
            {
                return(retaccount);
            }

            for (int i = retaccount.Count - 1; i >= 0; i--)
            {
                if (!SEP.Model.Utility.Tools.IsDeptListContainsDept(myAuth.Departments, retaccount[i].Dept))
                {
                    retaccount.RemoveAt(i);
                }
            }
            return(retaccount);
        }
Ejemplo n.º 7
0
        ///<summary>
        ///</summary>
        ///<param name="traineeName"></param>
        ///<param name="studentName"></param>
        ///<param name="courseName"></param>
        ///<param name="traineeFrom"></param>
        ///<param name="traineeTo"></param>
        ///<param name="hasCertifacation"></param>
        ///<param name="trainScopeEnum"></param>
        ///<param name="statusEnum"></param>
        ///<returns></returns>
        public List <TraineeApplication> GetTraineeApplicationByCondition
            (string traineeName, string studentName, string courseName, DateTime?traineeFrom, DateTime?traineeTo,
            int hasCertifacation, TrainScopeType trainScopeEnum, TraineeApplicationStatus statusEnum)
        {
            List <TraineeApplication> returnApplication = new List <TraineeApplication>();
            List <Account>            traineeList       = _IAccountBll.GetAccountByBaseCondition(studentName, -1, -1, null, false, null);

            if (traineeList.Count == 0)
            {
                return(returnApplication);
            }
            List <TraineeApplication> applications = _DalTraineeApplication.GetTraineeApplicationByCondition(traineeName, courseName,
                                                                                                             traineeFrom, traineeTo, hasCertifacation,
                                                                                                             trainScopeEnum, statusEnum);

            foreach (TraineeApplication application in applications)
            {
                TraineeApplication newapplication = GetTraineeApplicationByPKID(application.PKID);
                //查找课程中是否包含不被管理的培训人员
                List <int> traineeListid = new List <int>();
                foreach (Account account in traineeList)
                {
                    traineeListid.Add(account.Id);
                }
                bool isFind = true;
                for (int i = 0; i < newapplication.StudentList.Count; i++)
                {
                    if (traineeListid.Contains(newapplication.StudentList[i].Id))
                    {
                        isFind = false;
                        break;
                    }
                }
                if (!isFind)
                {
                    returnApplication.Add(newapplication);
                }
            }
            return(returnApplication);
        }
        /// <summary>
        /// 用于查询某个员工更多信息
        /// </summary>
        public List <AttendanceInAndOutRecord> GetEmployeeInAndOutRecordByCondition(int employeeID, string employeeName,
                                                                                    int departmentID, string doorCardNo,
                                                                                    DateTime iOTimeFrom,
                                                                                    DateTime iOTimeTo,
                                                                                    InOutStatusEnum iOStatus,
                                                                                    OutInRecordOperateStatusEnum
                                                                                    operateStatus,
                                                                                    DateTime operateTimeFrom,
                                                                                    DateTime operateTimeTo)
        {
            List <Account> accountList = _IAccountBll.GetAccountByBaseCondition(employeeName, departmentID, -1, null, true, null);

            if (departmentID == -1)
            {
                accountList = Tools.RemoteUnAuthAccount(accountList, AuthType.HRMIS, _LoginUser, HrmisPowers.A504);
            }

            List <AttendanceInAndOutRecord> records =
                _dalAttendanceInAndOutRecord.GetAttendanceInAndOutRecordByCondition(employeeID, doorCardNo, iOTimeFrom,
                                                                                    iOTimeTo,
                                                                                    iOStatus, operateStatus,
                                                                                    operateTimeFrom,
                                                                                    operateTimeTo);

            for (int i = records.Count - 1; i >= 0; i--)
            {
                Account temp = Tools.FindAccountById(accountList, records[i].EmployeeId);

                if (temp == null)
                {
                    records.RemoveAt(i);
                }
                else
                {
                    records[i].EmployeeName = temp.Name;
                }
            }
            return(records);
        }
Ejemplo n.º 9
0
        public List <Course> GetCourseByConditon(string courseName, string coordinator, int scope, int status, string trainer, string trainee,
                                                 string skillName, DateTime expectedTimeFrom, DateTime expectedTimeTo, DateTime actualTimeFrom, DateTime actualTimeTo,
                                                 decimal expctedCostFrom, decimal expectedCostTo, decimal actaulCostFrom, decimal actualCostTo, Account loginUser)
        {
            List <Course> returnCourse = new List <Course>();
            //协调员账号
            List <Account> coordinatorList = _IAccountBll.GetAccountByBaseCondition(coordinator, -1, -1, null, false, null);

            coordinatorList = Tools.RemoteUnAuthAccount(coordinatorList, AuthType.HRMIS, loginUser, HrmisPowers.A801);
            if (coordinatorList.Count == 0)
            {
                return(returnCourse);
            }
            //培训人员查询

            List <Account> traineeList = _IAccountBll.GetAccountByBaseCondition(trainee, -1, -1, null, false, null);

            traineeList = Tools.RemoteUnAuthAccount(traineeList, AuthType.HRMIS, loginUser, HrmisPowers.A801);
            if (traineeList.Count == 0)
            {
                return(returnCourse);
            }
            List <Course> courses = _dalTrain.GetCourseByConditon(courseName, coordinator, scope, status, trainer, trainee,
                                                                  skillName, expectedTimeFrom, expectedTimeTo, actualTimeFrom,
                                                                  actualTimeTo,
                                                                  expctedCostFrom, expectedCostTo, actaulCostFrom, actualCostTo);

            foreach (Course course in courses)
            {
                //查找课程中是否包含不被管理的协调员
                Course     newcourse         = GetTrainCourseByPKID(course.CourseID);
                List <int> coordinatorListid = new List <int>();
                foreach (Account account in coordinatorList)
                {
                    coordinatorListid.Add(account.Id);
                }
                if (!coordinatorListid.Contains(course.Coordinator.Id))
                {
                    break;
                }
                //查找课程中是否包含不被管理的培训人员
                List <int> traineeListid = new List <int>();
                foreach (Account account in traineeList)
                {
                    traineeListid.Add(account.Id);
                }
                bool isFind = true;
                for (int i = 0; i < newcourse.TrainFBResult.TrainEmployeeFBs.Count; i++)
                {
                    if (traineeListid.Contains(newcourse.TrainFBResult.TrainEmployeeFBs[i].Trainee.Id))
                    {
                        isFind = false;
                        break;
                    }
                }
                if (!isFind)
                {
                    course.TrainFBResult = newcourse.TrainFBResult;
                }
                returnCourse.Add(course);
            }


            return(returnCourse);
        }