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);
        }
        public override IQueryOver <AdditionalDictionary, AdditionalDictionary> Filtering(
            IQueryOver <AdditionalDictionary, AdditionalDictionary> query,
            AdditionalDictionaryFilter filter)
        {
            query.FindByRn(filter.Rn);

            if (!string.IsNullOrWhiteSpace(filter.Code))
            {
                query.IsLike(x => x.Code, filter.Code.ReplaceStar(string.Empty));
            }

            if (filter.AdditionalDictionaryValues != null)
            {
                AdditionalDictionaryValues additionalDictionaryValuesAlias = null;
                query.JoinAlias(
                    x => x.AdditionalDictionaryValues,
                    () => additionalDictionaryValuesAlias,
                    JoinType.LeftOuterJoin);

                if (!string.IsNullOrWhiteSpace(filter.AdditionalDictionaryValues.Note))
                {
                    query.Where(() => additionalDictionaryValuesAlias.Note == filter.AdditionalDictionaryValues.Note);
                }
            }

            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 <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);
        }
        /// <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);
        }
        Filtering(IQueryOver <TestSheetLiteDto, TestSheetLiteDto> query, TestSheetFilter filter)
        {
            query.FindByRn(filter.Rn);
            query.IsBetween(x => x.CreationDate, filter.TestSheetCreationDate);

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

            if (!string.IsNullOrWhiteSpace(filter.TableNumber))
            {
                query.IsLike(x => x.ClockNumber, filter.TableNumber.ReplaceStar(string.Empty));
            }

            if (filter.TypeCatalog > 0)
            {
                query.Where(x => x.Catalog.Rn == (long)filter.TypeCatalog);
            }

            if (filter.IsWorker)
            {
                query.Where(Restrictions.Eq(Projections.SqlFunction("length", NHibernateUtil.String, Projections.Property <Contractor>(x => x.ClockNumber)), 6));
            }

            query.IsLike(x => x.Family, filter.Lastname.ReplaceStar(string.Empty));
            query.IsLike(x => x.Firstname, filter.Firstname.ReplaceStar(string.Empty));
            query.IsLike(x => x.Name, filter.OrganizationName.ReplaceStar(string.Empty));
            query.IsLike(x => x.NameShort, filter.NameShort.ReplaceStar(string.Empty));

            return(query);
        }
        Filtering(IQueryOver <NomenclatureNumberModification, NomenclatureNumberModification> query, NomenclatureNumberModificationFilter filter)
        {
            query.FindByRn(filter.Rn);
            query.IsLike(x => x.Code, filter.Code.ReplaceStar());
            query.IsLike(x => x.Name, filter.Name.ReplaceStar());

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

            query.IsLike(x => x.Fullname, filter.Fullname.ReplaceStar(string.Empty));

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

            query.IsLike(x => x.Code, filter.Code.ReplaceStar());
            query.IsLike(x => x.Name, filter.Name.ReplaceStar());

            return(query);
        }
Пример #11
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 <NomenclatureNumber, NomenclatureNumber> Filtering(
            IQueryOver <NomenclatureNumber, NomenclatureNumber> query,
            NomenclatureNumberFilter filter)
        {
            query.FindByRn(filter.Rn);
            query.IsLike(x => x.NomenCode, filter.Code.ReplaceStar(string.Empty), MatchMode.Start);
            query.IsLike(x => x.NomenName, filter.Name.ReplaceStar(string.Empty), MatchMode.Start);

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

            query = query.OrderBy(x => x.Code).Asc;

            return(query);
        }
Пример #13
0
        public override IQueryOver <TaxBand, TaxBand> Filtering(IQueryOver <TaxBand, TaxBand> query, TaxBandFilter filter)
        {
            query.FindByRn(filter.Rn);

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

            return(query);
        }
Пример #14
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 <Acatalog, Acatalog> Filtering(IQueryOver <Acatalog, Acatalog> query, CatalogFilter filter)
        {
            query.FindByRn(filter.Rn);

            if (!string.IsNullOrEmpty(filter.Name))
            {
                return(query.WhereRestrictionOn(x => x.Name).IsLike(filter.Name));
            }

            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 <DictionaryPass, DictionaryPass> Filtering(
            IQueryOver <DictionaryPass, DictionaryPass> query,
            DictionaryPassFilter filter)
        {
            query.FindByRn(filter.Rn);

            query.IsLike(x => x.MemoPass, filter.MemoPass.ReplaceStar());
            query.IsLike(x => x.Pass, filter.Pass.ReplaceStar());

            return(query);
        }
Пример #16
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 <PersonalAccount, PersonalAccount> Filtering(IQueryOver <PersonalAccount, PersonalAccount> query,
                                                                                PersonalAccountFilter filter)
        {
            query.FindByRn(filter.Rn);
            if (!string.IsNullOrWhiteSpace(filter.Numb))
            {
                query.IsLike(x => x.Numb, filter.Numb.ReplaceStar());
            }

            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 IQueryOver <TEntity, TEntity> Filtering(IQueryOver <TEntity, TEntity> query, IUserFilter filter)
        {
            LogManager.Log.Debug("Default filter for entity {0}".StringFormat(typeof(TEntity)));

            if (filter != null)
            {
                return(query.FindByRn(filter.Rn));
            }

            return(query);
        }
Пример #18
0
        public override IQueryOver <TaxLiteDto, TaxLiteDto> Filtering(IQueryOver <TaxLiteDto, TaxLiteDto> query, TaxFilter filter)
        {
            query.FindByRn(filter.Rn);

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

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

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

            return(query.OrderBy(x => x.Fullname).Asc());
        }
Пример #20
0
        Filtering(IQueryOver <HeatTreatment, HeatTreatment> query, HeatTreatmentFilter filter)
        {
            if (filter != null)
            {
                query.FindByRn(filter.Rn);

                query.JoinQueryOver(x => x.TestSheet, JoinType.InnerJoin)
                .Where(x => x.Rn == filter.RnTestSheet);
            }

            return(query);
        }
Пример #21
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);
        }
        public override IQueryOver <UnitOfMeasure, UnitOfMeasure> Filtering(IQueryOver <UnitOfMeasure, UnitOfMeasure> query, UnitOfMeasureFilter filter)
        {
            query.FindByRn(filter.Rn);

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

            query = query.OrderBy(x => x.Code).Asc;

            return(query);
        }
Пример #23
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 <ContractLiteDto, ContractLiteDto> Filtering(
            IQueryOver <ContractLiteDto, ContractLiteDto> query, ContractFilter filter)
        {
            query.FindByRn(filter.Rn);

            if (filter.Contaractor != null)
            {
                query.Where(x => x.ContractorAgentMemo == filter.Contaractor.TableNumber);
            }

            query.Where(x => x.State == filter.State);

            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 <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);
        }
Пример #25
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());
        }
Пример #26
0
        Filtering(IQueryOver <PlanCertificateLiteDto, PlanCertificateLiteDto> query, PlanCertificateFilter filter)
        {
            if (filter != null)
            {
                query.FindByRn(filter.Rn);

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

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

            if (filter.PlanCertificate.Rn > 0)
            {
                query.Where(x => x.PRn == filter.PlanCertificate.Rn);
            }

            query.IsLike(x => x.PersonalAccount, filter.PersonalAccount);

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

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

            return(query);
        }
Пример #29
0
        public override IQueryOver <Sample, Sample> Filtering(IQueryOver <Sample, Sample> query, SampleFilter filter)
        {
            query.FindByRn(filter.Rn);

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

            return(query);
        }
Пример #30
0
        Filtering(IQueryOver <PlanReceiptOrderPersonalAccount, PlanReceiptOrderPersonalAccount> query, PlanReceiptOrderPersonalAccountFilter filter)
        {
            query.FindByRn(filter.Rn);

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

            return(query);
        }