Exemple #1
0
        public AlquilerSpec(AlquilerFilter filter)
        {
            Query.OrderBy(x => x.FechaInicio).ThenByDescending(x => x.Id);

            if (filter.LoadChildren)
            {
                Query.Include(x => x.Cliente);

                Query.Include(x => x.Auto);
            }


            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (filter.TypeFilter == "Auto")
            {
                if (!string.IsNullOrEmpty(filter.SearchString))
                {
                    Query.Search(x => x.Auto.Descripcion(), "%" + filter.SearchString + "%");
                }
            }
            else if (filter.TypeFilter == "Cliente")
            {
                if (!string.IsNullOrEmpty(filter.SearchString))
                {
                    Query.Search(x => x.Cliente.NombreCompleto(), "%" + filter.SearchString + "%");
                }
            }
        }
Exemple #2
0
 public Paquete_UserSpec(Paquete_Filter filter)
 {
     Query.OrderBy(x => x.Envio_Prioridad);
     if (filter.IsPagingEnabled)
     {
         Query.Skip(PaginationHelper.CalculateSkip(filter))
         .Take(PaginationHelper.CalculateTake(filter));
     }
     Query.Search(x => x.Id_Paquete.ToString(), filter.Paquete_Id.ToString()).Where(x => x.UserId == filter.UserId);
 }
Exemple #3
0
 public Paquete_Spec(Paquete_Filter filter)
 {
     Query.OrderBy(x => x.Nombre_Paquete).ThenByDescending(x => x.Id);
     if (filter.IsPagingEnabled)
     {
         Query.Skip(PaginationHelper.CalculateSkip(filter))
         .Take(PaginationHelper.CalculateTake(filter));
     }
     if (!string.IsNullOrEmpty(filter.Nombre_Paquete))
     {
         Query.Search(x => x.Nombre_Paquete, "%" + filter.Nombre_Paquete + "%");
     }
 }
 public Paquete_Spec(Paquete_Filter filter)
 {
     Query.OrderBy(x => x.Envio_Prioridad);
     if (filter.IsPagingEnabled)
     {
         Query.Skip(PaginationHelper.CalculateSkip(filter))
         .Take(PaginationHelper.CalculateTake(filter));
     }
     if (!string.IsNullOrEmpty(filter.Contenido_Paquete))
     {
         Query.Search(x => x.Contenido_Paquete, "%" + filter.Contenido_Paquete + "%")
         .Where(x => x.UserId == filter.UserId);
     }
 }
Exemple #5
0
        public AutoSpec(AutoFilter filter)
        {
            Query.OrderBy(x => x.Marca).ThenByDescending(x => x.Id);

            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (!string.IsNullOrEmpty(filter.Marca))
            {
                Query.Search(x => x.Marca, "%" + filter.Marca + "%");
            }
        }
Exemple #6
0
        public ProductoSpec(ProductoFilter filter)
        {
            Query.OrderBy(x => x.Nombre).ThenByDescending(x => x.Id);

            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (!string.IsNullOrEmpty(filter.Nombre))
            {
                Query.Search(x => x.Nombre.ToLower(), "%" + filter.Nombre.ToLower() + "%");
            }
        }
Exemple #7
0
        public AlumnoSpec(AlumnoFilter filter)
        {
            Query.OrderBy(x => x.Apellido).ThenByDescending(x => x.Id);

            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (!string.IsNullOrEmpty(filter.Apellido))
            {
                Query.Search(x => x.Apellido, "%" + filter.Apellido + "%");
            }
        }
Exemple #8
0
        public ClientesSpec(ClienteFilter filter)
        {
            Query.OrderBy(x => x.Apellidos).ThenByDescending(x => x.Id);
            //Query.OrderBy(y => y.Nombres).ThenByDescending(y => y.Id);

            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (!string.IsNullOrEmpty(filter.Apellidos))
            {
                Query.Search(x => x.Apellidos, "%" + filter.Apellidos + "%");
            }

            //if (!string.IsNullOrEmpty(filter.Nombres))
            //   Query.Search(y => y.Nombres, "%" + filter.Nombres + "%");
        }
        public CategoriaSpec(CategoriaFilter filter)
        {
            Query.OrderBy(x => x.Nombre).ThenByDescending(x => x.Id);

            if (filter.IsPagingEnabled)
            {
                Query.Skip(PaginationHelper.CalculateSkip(filter))
                .Take(PaginationHelper.CalculateTake(filter));
            }

            if (filter.LoadChildren)
            {
                Query.Include(x => x.Negocios);
            }

            if (!string.IsNullOrEmpty(filter.Nombre))
            {
                Query.Search(x => x.Nombre.ToLower(), "%" + filter.Nombre.ToLower() + "%");
            }
        }