Exemplo n.º 1
0
        public string GetDemandsJson(int?pageNumber, int?pageLength, int?companyId)
        {
            Expression <Func <Demand, bool> > expression = p => p.RecordStatus == Helpdesk.Model.Enums.RecordStatus.A;

            var users = companyUserRepository.GetAll(p => p.CompanyId == companyId).Select(p => p.AccountId).ToList();

            if (companyId != null)
            {
                expression = expression.And(p => users.Contains(p.CompanyUserAccountId));
            }

            int?skip = null;

            if (pageNumber.HasValue && pageLength.HasValue)
            {
                skip = (pageNumber - 1) * pageLength;
            }

            var data = demandRepository.GetAllDemandJson(expression, out int records, null, skip, pageLength);

            return(data);
        }
Exemplo n.º 2
0
 public IEnumerable <CompanyUser> GetAll()
 {
     return(companyUserRepository.GetAll());
 }