Exemplo n.º 1
0
        public override IQueryOver <CertificateQuality, CertificateQuality> Filtering(
            IQueryOver <CertificateQuality, CertificateQuality> query, CertificateQualityFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsBetween(x => x.CreationDate, filter.CreationDate);
            query.IsBetween(x => x.StorageDate, filter.StorageDate);
            query.IsBetween(x => x.MakingDate, filter.MakingDate);

            query.IsLike(x => x.StandardSize, filter.StandardSize.ReplaceStar());
            query.IsLike(x => x.NomerCertificata, filter.NomerCertificata.ReplaceStar());
            query.IsLike(x => x.ModeThermoTreatment, filter.ModeThermoTreatment.ReplaceStar());
            query.IsLike(x => x.Mix, filter.Mix.ReplaceStar());
            query.IsLike(x => x.Marka, filter.Marka.ReplaceStar());
            query.IsLike(x => x.GostMix, filter.GostMix.ReplaceStar());
            query.IsLike(x => x.GostMarka, filter.GostMarka.ReplaceStar());
            query.IsLike(x => x.FullRepresentation, filter.FullRepresentation.ReplaceStar());
            query.IsLike(x => x.DeliveryCondition, filter.DeliveryCondition.ReplaceStar());
            query.IsLike(x => x.Cast, filter.Cast.ReplaceStar());

            query.IsIn(x => x.State, filter.State);
            if (filter.UserCreator != null)
            {
                query.Where(x => x.UserCreator.Rn == filter.UserCreator.Rn);
            }

            if (!string.IsNullOrWhiteSpace(filter.Pref))
            {
                query.Where(x => x.Pref == filter.Pref);
            }

            if (filter.Numb != null)
            {
                query.Where(x => x.Numb == filter.Numb);
            }

            if (filter.CreatorFactory != null)
            {
                query.Where(x => x.CreatorFactory.Rn == filter.CreatorFactory.Rn);
            }

            if (filter.NomenclatureNumber != null)
            {
                query.JoinQueryOver(x => x.PlanCertificate, JoinType.LeftOuterJoin);
                NomenclatureNumberModification nommodifAlias = null;
                query.JoinAlias(x => x.PlanCertificate.ModificationNomenclature, () => nommodifAlias, JoinType.LeftOuterJoin);

                query.Where(x => nommodifAlias.Code == filter.NomenclatureNumber.Code);
            }

            return(query);
        }
        Filtering(IQueryOver <PlanReceiptOrderLiteDto, PlanReceiptOrderLiteDto> query, PlanReceiptOrderFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsBetween(x => x.CreationDate, filter.CreationDate);
            query.IsBetween(x => x.GroundDocDate, filter.GroundDocumentDate);
            query.IsBetween(x => x.StateDate, filter.StateDate);

            query.IsLike(x => x.GroundDocNumb, filter.GroundDocumentNumb);
            query.IsLike(x => x.Note, filter.Note);
            query.IsLike(x => x.Pref, filter.Pref);

            if (filter.Numb != null)
            {
                query.Where(x => x.Numb == filter.Numb);
            }

            query.IsIn(x => x.State, filter.States);

            if (filter.StaffingDivision != null)
            {
                query.IsIn(x => x.Department, filter.StaffingDivision.Code);
            }

            if (filter.StoreGasStationOilDepot != null)
            {
                if (!string.IsNullOrWhiteSpace(filter.StoreGasStationOilDepot.AzsNumber))
                {
                    query.Where(x => x.Store == filter.StoreGasStationOilDepot.AzsNumber);
                }
            }

            if (!string.IsNullOrWhiteSpace(filter.GroundTypeOfDocument.DocCode))
            {
                query.Where(x => x.GroundDocType == filter.GroundTypeOfDocument.DocCode);
            }

            return(query);
        }
Exemplo n.º 3
0
        public override IQueryOver <PermissionMaterialLiteDto, PermissionMaterialLiteDto> Filtering(IQueryOver <PermissionMaterialLiteDto, PermissionMaterialLiteDto> query, PermissionMaterialFilter filter)
        {
            query.FindByRn(filter.Rn);
            if (filter.Rnf != null)
            {
                query.Where(x => x.Rn == filter.Rnf);
            }
            query.IsIn(x => x.State, filter.States);
            query.IsBetween(x => x.StateDate, filter.StateDate);
            query.IsBetween(x => x.AcceptToDate, filter.AcceptToDate);
            query.IsBetween(x => x.CreationDate, filter.CreationDate);

            return(query.OrderBy(x => x.CreationDate).Desc());
        }