Example #1
0
        public List <EmployeeCompany> GetByRange(int skip, string word, EStatusUser status)
        {
            int take = 12;

            return(_context.EmployeeCompany
                   .Include("Company")
                   .Include("User")
                   .Include("User.ProfileUser")
                   .Include("SectorCompany")
                   .Where(EmployeeCompanySpecs.GetEmployeeCompany(word, status))
                   .OrderBy(x => x.IdCompany).Skip((skip - 1) * take).Take(take).ToList());
        }
Example #2
0
        public static Expression <Func <EmployeeCompany, bool> > GetEmployeeCompany(string word, EStatusUser status)
        {
            if (string.IsNullOrEmpty(word) || word.Equals("null"))
            {
                return(x => x.User.StatusUser == status);
            }

            return(x => x.User.StatusUser == status && (x.User.Name.Contains(word) || x.User.LastName.Contains(word) || x.User.Email.Contains(word) || x.Cpf.Contains(word)));
        }
        public Task <HttpResponseMessage> GetCount(string word, EStatusUser status)
        {
            var countEmployee = _service.GetCount(word, status);

            return(CreateResponse(HttpStatusCode.OK, countEmployee));
        }
        public Task <HttpResponseMessage> GetByRange(int skip, EStatusUser status, string word)
        {
            var employee = _service.GetByRange(skip, word, status);

            return(CreateResponse(HttpStatusCode.OK, employee));
        }
 public List <EmployeeCompany> GetByRange(int skip, string word, EStatusUser status)
 {
     return(_repository.GetByRange(skip, word, status));
 }
 public int GetCount(string word, EStatusUser status)
 {
     return(_repository.GetCount(word, status));
 }
Example #7
0
 public int GetCount(string word, EStatusUser status)
 {
     return(_context.EmployeeCompany.Where(EmployeeCompanySpecs.GetEmployeeCompany(word, status)).Count());
 }