Пример #1
0
        public List<CajasDto> Listado(string sortBy, string sortDirection, Guid? operador , bool? aprobado, int pageIndex, int pageSize, out int pageTotal)
        {
            var criteros = new PagingCriteria();

            criteros.PageNumber = pageIndex;
            criteros.PageSize = pageSize;
            criteros.SortBy = !string.IsNullOrEmpty(sortBy) ? sortBy : "FechaAlta";
            criteros.SortDirection = !string.IsNullOrEmpty(sortDirection) ? sortDirection : "ASC";

            System.Linq.Expressions.Expression<Func<Caja, bool>> where =
                                            x =>
                                                //(operador == null )//|| x.OperadorAltaId == operador)
                                                //&& (x.FCierre != null || x.FCierre == fechaCierre)
                                                //&& (movilId == null || x.MovilId == movilId)
                                                 (x.FCierre !=null)
                                                 && (x.Aprobada == aprobado)
                                                 && ((x.Efectivo >0) || (x.Vales>0) ||(x.Egresos>0))
                                                ;

            var resultados = Uow.Cajas.Listado(criteros, where);

            pageTotal = resultados.PagedMetadata.TotalItemCount;

            return resultados.Entities.Project().To<CajasDto>().ToList();
        }
        public List<TitularesDto> Listado(string sortBy, string sortDirection, int? dni, string apellido, int pageIndex, int pageSize, out int pageTotal)
        {
            var criteros = new PagingCriteria();

            criteros.PageNumber = pageIndex;
            criteros.PageSize = pageSize;
            criteros.SortBy = !string.IsNullOrEmpty(sortBy) ? sortBy : "Apellido";
            criteros.SortDirection = !string.IsNullOrEmpty(sortDirection) ? sortDirection : "ASC";

            System.Linq.Expressions.Expression<Func<Titulare, bool>> where =
                                            x =>
                                                (dni == 0 || x.DNI == dni)
                                                && (string.IsNullOrEmpty(apellido) || SqlFunctions.PatIndex(apellido, x.Apellido) > 0)
                                                ;

            var resultados = Uow.Titulares.Listado(criteros, where);

            pageTotal = resultados.PagedMetadata.TotalItemCount;

            return resultados.Entities.Project().To<TitularesDto>().ToList();
        }
        public List<MovilesDto> Listado(string sortBy, string sortDirection, int? numero, string patente, bool? activo, int pageIndex, int pageSize, out int pageTotal)
        {
            var criteros = new PagingCriteria();

            criteros.PageNumber = pageIndex;
            criteros.PageSize = pageSize;
            criteros.SortBy = !string.IsNullOrEmpty(sortBy) ? sortBy : "Denominacion";
            criteros.SortDirection = !string.IsNullOrEmpty(sortDirection) ? sortDirection : "DESC";

            Expression<Func<Movil,bool> >where=
                                            x =>
                                                (numero == 0 || x.Numero.ToString().Contains(numero.ToString())) &&
                                                (string.IsNullOrEmpty(patente) || x.Patente.Contains(patente)) &&
                                                (x.Activo==activo);

            var resultados = Uow.Moviles.Listado(criteros,where,
                                                    x=> x.Numero);

            pageTotal = resultados.PagedMetadata.TotalItemCount;

            return resultados.Entities.Project().To<MovilesDto>().ToList();
        }
        public List<ChoferesDto> Listado(string sortBy, string sortDirection, int? dni, string apellido , Guid? movilId , bool? activo, int pageIndex, int pageSize, out int pageTotal)
        {
            var criteros = new PagingCriteria();

            criteros.PageNumber = pageIndex;
            criteros.PageSize = pageSize;
            criteros.SortBy = !string.IsNullOrEmpty(sortBy) ? sortBy : "Apellido";
            criteros.SortDirection = !string.IsNullOrEmpty(sortDirection) ? sortDirection : "ASC";

            System.Linq.Expressions.Expression<Func<Chofer, bool>> where =
                                            x =>
                                                (dni == 0 || x.Dni == dni)
                                                && (string.IsNullOrEmpty(apellido) || SqlFunctions.PatIndex(apellido, x.Apellido) > 0)
                                                && (movilId == null || x.MovilId == movilId)
                                                 && (x.Activo == activo)
                                                ;

            var resultados = Uow.Choferes.Listado(criteros, where, x=> x.Movil);

            pageTotal = resultados.PagedMetadata.TotalItemCount;

            return resultados.Entities.Project().To<ChoferesDto>().ToList();
        }