/// <summary>
        /// The filtering.
        /// </summary>
        /// <param name="query">
        /// The query.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <returns>
        /// The <see cref="IQueryOver"/>.
        /// </returns>
        public override IQueryOver <PlanAndSpecification, PlanAndSpecification> Filtering(IQueryOver <PlanAndSpecification, PlanAndSpecification> query, PlanAndSpecificationFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsBetween(x => x.BeginDate, filter.BeginDate);
            query.IsBetween(x => x.EndDate, filter.EndDate);
            if (filter.ModificationNomenclature != null)
            {
                if (!string.IsNullOrWhiteSpace(filter.ModificationNomenclature.Code))
                {
                    query.JoinQueryOver(x => x.ModificationNomenclature, JoinType.LeftOuterJoin);
                    //NomenclatureNumberModification nommodifAlias = null;
                    //query.JoinAlias((x) => filter.ModificationNomenclature, () => nommodifAlias, JoinType.LeftOuterJoin);
                    query.WhereRestrictionOn(x => x.ModificationNomenclature.Code)
                    .IsLike(filter.ModificationNomenclature.Code.ReplaceStar());
                }
            }

            if (filter.PersonalAccount != null)
            {
                // query.JoinQueryOver(x => x.PersonalAccount, JoinType.LeftOuterJoin);
                query.Where(x => x.PersonalAccount.Rn == filter.PersonalAccount.Rn);
            }

            return(query);
        }
        public override IQueryOver <CuttingOrder, CuttingOrder> Filtering(IQueryOver <CuttingOrder, CuttingOrder> query, CuttingOrderFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsBetween(x => x.AssumeDate, filter.AssumeDate);
            query.IsBetween(x => x.CreationDate, filter.CreationDate);
            query.IsBetween(x => x.DateDocumentIntegration, filter.DateDocumentIntegration);

            if (!string.IsNullOrWhiteSpace(filter.Note))
            {
                query.WhereRestrictionOn(x => x.Note)
                .IsLike(filter.Note, MatchMode.Start);
            }

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

            if (!string.IsNullOrWhiteSpace(filter.Pref))
            {
                query.WhereRestrictionOn(x => x.Pref)
                .IsLike(filter.Pref, MatchMode.Start);
            }

            return(query);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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());
        }
        /// <summary>
        /// The filtering.
        /// </summary>
        /// <param name="query">
        /// The query.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <returns>
        /// The <see cref="IQueryOver"/>.
        /// </returns>
        public override IQueryOver <PlanAndSpecificationLiteDto, PlanAndSpecificationLiteDto> Filtering(IQueryOver <PlanAndSpecificationLiteDto, PlanAndSpecificationLiteDto> query, PlanAndSpecificationFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsBetween(x => x.BeginDate, filter.BeginDate);
            query.IsBetween(x => x.EndDate, filter.EndDate);

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

            return(query);
        }
        Filtering(IQueryOver <TestSheetLiteDto, TestSheetLiteDto> query, TestSheetFilter filter)
        {
            query.FindByRn(filter.Rn);
            query.IsBetween(x => x.CreationDate, filter.TestSheetCreationDate);

            return(query);
        }
        /// <summary>
        /// The filtering.
        /// </summary>
        /// <param name="query">
        /// The query.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <returns>
        /// The <see cref="IQueryOver"/>.
        /// </returns>
        public override IQueryOver <ActInputControl, ActInputControl> Filtering(
            IQueryOver <ActInputControl, ActInputControl> query, ActInputControlFilter filter)
        {
            query.FindByRn(filter.Rn);

            if (filter.State != null)
            {
                query.WhereRestrictionOn(x => x.State).IsInG(filter.State);
            }

            if (!string.IsNullOrWhiteSpace(filter.Note))
            {
                query.WhereRestrictionOn(x => x.Note).IsLike(filter.Note, MatchMode.Start);
            }

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

            if (!string.IsNullOrWhiteSpace(filter.ViewTareStamp))
            {
                query.WhereRestrictionOn(x => x.ViewTareStamp)
                .IsLike(filter.ViewTareStamp.ReplaceStar());
            }

            query.IsBetween(x => x.OpenningTareDate, filter.OpenningTareDate);

            if ((filter.TheMoveActs != null) && (filter.TheMoveActs.Any()))
            {
                TheMoveAct       theMoveActAlias = null;
                StaffingDivision staffingDivisionDepartmentReciverAlias = null;
                StaffingDivision staffingDivisionDepartmentCreatorAlias = null;
                query.JoinAlias(x => x.TheMoveActs, () => theMoveActAlias);
                query.JoinAlias(() => theMoveActAlias.DepartmentCreator, () => staffingDivisionDepartmentCreatorAlias);
                query.JoinAlias(() => theMoveActAlias.DepartmentReciver, () => staffingDivisionDepartmentReciverAlias);

                query.WhereRestrictionOn(x => staffingDivisionDepartmentCreatorAlias.Code)
                .IsIn(
                    filter.TheMoveActs.Where(x => x.DepartmentCreator != null)
                    .Select(x => x.DepartmentCreator.Code)
                    .ToArray());

                query.WhereRestrictionOn(x => staffingDivisionDepartmentReciverAlias.Code)
                .IsIn(
                    filter.TheMoveActs.Where(x => x.DepartmentReciver != null)
                    .Select(x => x.DepartmentReciver.Code)
                    .ToArray());
                query.WhereRestrictionOn(() => theMoveActAlias.UserCreator.Rn)
                .IsIn(filter.TheMoveActs.Select(x => x.UserCreator.Rn).ToArray());
            }

            if ((filter.QualityStateControlOfTheMakes != null) && (filter.QualityStateControlOfTheMakes.Any()))
            {
                QualityStateControlOfTheMake qualityStateControlOfTheMakeAlias = null;
                query.JoinAlias(x => x.QualityStateControlOfTheMakes, () => qualityStateControlOfTheMakeAlias);
            }

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

            if (filter.CertificateQualityFilter.NomerCertificata != null)
            {
                query.Where(x => x.NumbCertificate == filter.CertificateQualityFilter.NomerCertificata);
            }

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

            if (filter.RnDepartmentCreator > 0)
            {
                query.Where(x => x.RnDepartmentCreator == filter.RnDepartmentCreator);
            }

            if (filter.CreationDate.From != null || filter.CreationDate.To != null)
            {
                query.IsBetween(x => x.CreationDate, filter.CreationDate);
            }

            return(query);
        }
Exemplo n.º 9
0
        /// <summary>
        /// The filtering.
        /// </summary>
        /// <param name="query">
        /// The query.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <returns>
        /// The <see cref="IQueryOver"/>.
        /// </returns>
        public override IQueryOver <CertificateQualityRestLiteDto, CertificateQualityRestLiteDto> Filtering(
            IQueryOver <CertificateQualityRestLiteDto, CertificateQualityRestLiteDto> 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.NomerCertificate, filter.NomerCertificata.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.Cast, filter.Cast.ReplaceStar());

            if (filter.UserCreator != null)
            {
                query.Where(x => x.RnUserCreator == 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.RnCreatorFactory == filter.CreatorFactory.Rn);
            }

            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.º 11
0
        public override IQueryOver <WarehouseQualityCertificateRestLiteDto, WarehouseQualityCertificateRestLiteDto> Filtering(
            IQueryOver <WarehouseQualityCertificateRestLiteDto, WarehouseQualityCertificateRestLiteDto> query,
            WarehouseQualityCertificateRestFilter filter)
        {
            query.FindByRn(filter.Rn);
            if (filter.RNCertificateQuality != 0)
            {
                query.Where(x => x.RNCertificateQuality == filter.RNCertificateQuality);
            }
            query.IsLike(x => x.Cast, filter.Cast.ReplaceStar(string.Empty));
            query.IsLike(x => x.FullRepresentation, filter.FullRepresentation.ReplaceStar(string.Empty));
            query.IsLike(x => x.GostMix, filter.GostMix.ReplaceStar(string.Empty));
            // query.IsLike(x => x.GostCast, filter.Cast.ReplaceStar(string.Empty));
            query.IsLike(x => x.Marka, filter.Marka.ReplaceStar(string.Empty));
            query.IsLike(x => x.Mix, filter.GostMix.ReplaceStar(string.Empty));

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

            return(query);
        }
        Filtering(IQueryOver <ActSelectionOfProbe, ActSelectionOfProbe> query, ActSelectionOfProbeFilter filter)
        {
            query.FindByRn(filter.Rn);
            query.IsBetween(x => x.CreationDate, filter.CreationDate);
            //query.IsLike(x => x.Pref, filter.Pref, MatchMode.Start);
            //query.IsLike(x => x.Numb, filter.Number.ToString(), MatchMode.Start);

            //if (filter.IdDepartment > 0)
            //{

            //    query.JoinQueryOver(x => x.RnDepartmentCreator, JoinType.InnerJoin)
            //         .Where(x => x.Rn == filter.IdDepartment);
            //}

            if (filter.CertificateQualityFilter.Numb > 0)
            {
                //query.JoinQueryOver(x => x.CertificateQuality, JoinType.InnerJoin)
                //    .Where(x => x.Numb == filter.CertificateQualityFilter.Numb);
            }

            return(query);
        }
        /// <summary>
        /// The filtering.
        /// </summary>
        /// <param name="query">
        /// The query.
        /// </param>
        /// <param name="filter">
        /// The filter.
        /// </param>
        /// <returns>
        /// The <see cref="IQueryOver"/>.
        /// </returns>
        public override IQueryOver <PlanReceiptOrder, PlanReceiptOrder> Filtering(
            IQueryOver <PlanReceiptOrder, PlanReceiptOrder> query, PlanReceiptOrderFilter filter)
        {
            query.FindByRn(filter.Rn);

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

            query.IsLike(x => x.GroundDocumentNumb, filter.GroundDocumentNumb, MatchMode.Start);
            query.IsLike(x => x.Note, filter.Note, MatchMode.Start);
            query.IsLike(x => x.Pref, filter.Pref, MatchMode.Start);
            query.IsBetween(x => x.StateDate, filter.StateDate);

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

            if (filter.States.Any())
            {
                query.WhereRestrictionOn(x => x.State)
                .IsIn(filter.States.ToArray());
            }

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

                            NomenclatureNumber nomenclatureNumberAlias = null;
                            query.JoinQueryOver(() => nommodifAlias.NomenclatureNumber, () => nomenclatureNumberAlias, JoinType.LeftOuterJoin);

                            query.WhereRestrictionOn(() => nomenclatureNumberAlias.NomenCode)
                            .IsLike(
                                filter.PlanCertificate.ModificationNomenclature.NomenclatureNumber.Code
                                .ReplaceStar());
                        }
                    }
                }
            }

            if (filter.StaffingDivision != null)
            {
                if (filter.StaffingDivision.Code != null && filter.StaffingDivision.Code.Any())
                {
                    query.JoinQueryOver(x => x.StaffingDivision, JoinType.LeftOuterJoin)
                    .WhereRestrictionOn(x => x.Code)
                    .IsIn(filter.StaffingDivision.Code.ToArray());
                }
            }

            if (filter.StoreGasStationOilDepot != null)
            {
                if (!string.IsNullOrWhiteSpace(filter.StoreGasStationOilDepot.AzsNumber))
                {
                    query.JoinQueryOver(x => x.StoreGasStationOilDepot, JoinType.LeftOuterJoin)
                    .Where(x => x.Number == filter.StoreGasStationOilDepot.AzsNumber);
                }
            }

            if (!string.IsNullOrWhiteSpace(filter.GroundTypeOfDocument.DocCode))
            {
                query.JoinQueryOver(x => x.GroundTypeOfDocument, JoinType.LeftOuterJoin)
                .Where(x => x.DocumentCode == filter.GroundTypeOfDocument.DocCode);
            }

            return(query);
        }