Exemplo n.º 1
0
        private List <EmployeeItem> SearchDataEmployee(DTParameters <EmployeeModel> searchView = null)
        {
            var param = new EmployeeParamInput();

            param.Status        = searchView.StatusSource == "False" ? false : true;
            param.EmployeeId    = searchView.EmployeeId;
            param.FormalName    = searchView.FormalName;
            param.PositionTitle = searchView.PositionTitle;
            param.Division      = searchView.Division;
            param.Directorate   = searchView.Directorate;
            param.Address       = searchView.Address;
            param.City          = searchView.City;
            param.BaseTown      = searchView.BaseTown;
            param.Company       = searchView.Company;
            param.CostCenter    = searchView.CostCenter;
            param.GroupLevel    = searchView.GroupLevel;
            param.EmailAddress  = searchView.EmailAddress;
            param.FlexPoint     = searchView.FlexPoint;

            var data = _employeeBLL.GetEmployeeByParam(param);

            return(Mapper.Map <List <EmployeeItem> >(data));
        }
Exemplo n.º 2
0
        public List <MST_EMPLOYEE> GetEmployeeByParam(EmployeeParamInput input)
        {
            Expression <Func <MST_EMPLOYEE, bool> > queryFilterEmployee = null;

            if (input.Status != null)
            {
                queryFilterEmployee = c => c.IS_ACTIVE == input.Status;
            }

            if (input != null)
            {
                if (!string.IsNullOrEmpty(input.Address))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.ADDRESS == input.Address);
                }

                if (!string.IsNullOrEmpty(input.BaseTown))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.BASETOWN == input.BaseTown);
                }

                if (!string.IsNullOrEmpty(input.City))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.CITY == input.City);
                }

                if (!string.IsNullOrEmpty(input.Company))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.COMPANY == input.Company);
                }

                if (!string.IsNullOrEmpty(input.CostCenter))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.COST_CENTER == input.CostCenter);
                }

                if (!string.IsNullOrEmpty(input.Directorate))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.DIRECTORATE == input.Directorate);
                }

                if (!string.IsNullOrEmpty(input.Division))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.DIVISON == input.Division);
                }

                if (!string.IsNullOrEmpty(input.EmailAddress))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.EMAIL_ADDRESS == input.EmailAddress);
                }

                if (!string.IsNullOrEmpty(input.EmployeeId))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.EMPLOYEE_ID == input.EmployeeId);
                }

                if (!string.IsNullOrEmpty(input.FlexPoint))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.FLEX_POINT == Convert.ToInt32(input.FlexPoint));
                }

                if (!string.IsNullOrEmpty(input.FormalName))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.FORMAL_NAME == input.FormalName);
                }

                if (!string.IsNullOrEmpty(input.GroupLevel))
                {
                    var grpLevel = Convert.ToInt32(input.GroupLevel);
                    queryFilterEmployee = queryFilterEmployee.And(c => c.GROUP_LEVEL == grpLevel);
                }

                if (!string.IsNullOrEmpty(input.PositionTitle))
                {
                    queryFilterEmployee = queryFilterEmployee.And(c => c.POSITION_TITLE == input.PositionTitle);
                }
            }
            return(_employeeRepository.Get(queryFilterEmployee, null, "").ToList());
        }
Exemplo n.º 3
0
        public List <EmployeeDto> GetEmployeeByParam(EmployeeParamInput param)
        {
            var data = _employeeService.GetEmployeeByParam(param);

            return(Mapper.Map <List <EmployeeDto> >(data));
        }