Ejemplo n.º 1
0
        public int Count(PermissionSearchEntity PermissionSearchEntity)
        {
            if (PermissionSearchEntity == null)
            {
                PermissionSearchEntity = new PermissionSearchEntity();
            }
            IQueryable <Permission> Permissions = context.Permissions;

            Apply(Permissions, PermissionSearchEntity);
            return(Permissions.Count());
        }
Ejemplo n.º 2
0
        public List <Permission> List(PermissionSearchEntity PermissionSearchEntity)
        {
            if (PermissionSearchEntity == null)
            {
                PermissionSearchEntity = new PermissionSearchEntity();
            }
            IQueryable <Permission> Permissions = context.Permissions
                                                  .Include(p => p.Employee)
                                                  .Include(p => p.Role);

            Apply(Permissions, PermissionSearchEntity);
            SkipAndTake(Permissions, PermissionSearchEntity);
            return(Permissions.ToList());
        }
Ejemplo n.º 3
0
 private IQueryable <Permission> Apply(IQueryable <Permission> Permissions, PermissionSearchEntity PermissionSearchEntity)
 {
     if (PermissionSearchEntity.Id.HasValue)
     {
         Permissions = Permissions.Where(wh => wh.Id == PermissionSearchEntity.Id.Value);
     }
     if (PermissionSearchEntity.EmployeeId.HasValue)
     {
         Permissions = Permissions.Where(wh => wh.EmployeeId == PermissionSearchEntity.EmployeeId.Value);
     }
     if (PermissionSearchEntity.RoleId.HasValue)
     {
         Permissions = Permissions.Where(wh => wh.RoleId == PermissionSearchEntity.RoleId.Value);
     }
     return(Permissions);
 }
Ejemplo n.º 4
0
        public List <PermissionEntity> Get(EmployeeEntity EmployeeEntity, PermissionSearchEntity PermissionSearchEntity)
        {
            List <Permission> Permissions = UnitOfWork.PermissionRepository.List(PermissionSearchEntity);

            return(Permissions.ToList().Select(c => new PermissionEntity(c)).ToList());
        }
Ejemplo n.º 5
0
 public int Count(EmployeeEntity EmployeeEntity, PermissionSearchEntity PermissionSearchEntity)
 {
     return(UnitOfWork.PermissionRepository.Count(PermissionSearchEntity));
 }
Ejemplo n.º 6
0
 public List <PermissionEntity> Get(PermissionSearchEntity SearchPermissionEntity)
 {
     return(PermissionService.Get(EmployeeEntity, SearchPermissionEntity));
 }
Ejemplo n.º 7
0
 public long Count(PermissionSearchEntity SearchPermissionEntity)
 {
     return(PermissionService.Count(EmployeeEntity, SearchPermissionEntity));
 }