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);
        }
        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);
        }
Beispiel #4
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);
        }
Beispiel #5
0
        public override IQueryOver <DeficiencyLiteDto, DeficiencyLiteDto> Filtering(
            IQueryOver <DeficiencyLiteDto, DeficiencyLiteDto> query,
            DeficiencyFilter filter)
        {
            query.IsLike(x => x.DSE, filter.DSE.ReplaceStar(string.Empty));
            query.IsLike(x => x.ShopRecipient, filter.ShopRecipient.ReplaceStar(string.Empty));
            query.IsLike(x => x.Department, filter.ShopRecipient.ReplaceStar(string.Empty));

            return(query);
        }
Beispiel #6
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 <StoreLiteDto, StoreLiteDto> Filtering(
            IQueryOver <StoreLiteDto, StoreLiteDto> query, StoreGasStationOilDepotFilter filter)
        {
            query.IsLike(x => x.AZSNUMBER, filter.AzsNumber.ReplaceStar());
            query.IsLike(x => x.AZSNAME, filter.AzsName.ReplaceStar());

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

            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);
        }
Beispiel #8
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 <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);
        }
        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);
        }
Beispiel #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);
        }
        /// <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 <GoodsManager, GoodsManager> Filtering(IQueryOver <GoodsManager, GoodsManager> query, GoodsManagerFilter filter)
        {
            query.FindByRn(filter.Rn);

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

                if (!string.IsNullOrWhiteSpace(filter.Contractor.TableNumber))
                {
                    query.IsLike((x) => contractorAlias.ClockNumber, filter.Contractor.TableNumber.ReplaceStar(string.Empty));
                }
                if (!string.IsNullOrWhiteSpace(filter.Contractor.OrganizationName))
                {
                    query.IsLike(x => contractorAlias.Name, filter.Contractor.OrganizationName.ReplaceStar(string.Empty));
                }
            }
            return(query);
        }
Beispiel #13
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);
        }
        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);
        }
        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);
        }
Beispiel #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 <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);
        }
        /// <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);
        }