Beispiel #1
1
        public static RepoAukcijaEntity FetchRepoAukcija(DataAccessAdapterBase adapter, PrefetchPath2 prefetchPath, DateTime datumAukcije)
        {
            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.PredicateExpression.Add(RepoAukcijaFields.DatumAukcije == datumAukcije);

            return FetchRepoAukcijaCollection(adapter, bucket, prefetchPath).SingleOrDefault();
        }
Beispiel #2
1
        public static IEnumerable<ArtworkEntity> GetToDownload()
        {
            var bucket = new RelationPredicateBucket();
            bucket.Relations.Add(ArtworkEntity.Relations.ArtworkToEpisodeEntityUsingArtworkId, JoinHint.Left);
            bucket.Relations.Add(ArtworkToEpisodeEntity.Relations.EpisodeEntityUsingEpisodeId, JoinHint.Left);
            bucket.Relations.Add(EpisodeEntity.Relations.SeasonEntityUsingSeasonId,JoinHint.Left);
            bucket.Relations.Add(SeasonEntity.Relations.SeriesEntityUsingSeriesId, JoinHint.Left);

            bucket.Relations.Add(ArtworkEntity.Relations.ArtworkToPersonEntityUsingArtworkId, JoinHint.Left);

            bucket.Relations.Add(ArtworkEntity.Relations.ArtworkToRoleEntityUsingArtworkId, JoinHint.Left);
            bucket.Relations.Add(ArtworkToRoleEntity.Relations.RoleEntityUsingRoleId, JoinHint.Left);
            bucket.Relations.Add(RoleEntity.Relations.RoleToSeriesEntityUsingRoleId, JoinHint.Left);
            bucket.Relations.Add(RoleToSeriesEntity.Relations.SeriesEntityUsingSeriesId, JoinHint.Left);

            bucket.Relations.Add(ArtworkEntity.Relations.ArtworkToSeasonEntityUsingArtworkId, JoinHint.Left);
            bucket.Relations.Add(ArtworkToSeasonEntity.Relations.SeasonEntityUsingSeasonId, JoinHint.Left);
            bucket.Relations.Add(SeasonEntity.Relations.SeriesEntityUsingSeriesId, JoinHint.Left);

            bucket.Relations.Add(ArtworkEntity.Relations.ArtworkToSeriesEntityUsingArtworkId, JoinHint.Left);
            bucket.Relations.Add(ArtworkToSeriesEntity.Relations.SeriesEntityUsingSeriesId, JoinHint.Left);

            bucket.PredicateExpression.Add(ArtworkFields.IsDownloadedOnMaster == false);

            var prefetchPath = new PrefetchPath2(EntityType.ArtworkEntity);
            prefetchPath.Add(ArtworkEntity.PrefetchPathArtworkToEpisodes).SubPath.Add(ArtworkToEpisodeEntity.PrefetchPathEpisode).SubPath.Add(EpisodeEntity.PrefetchPathSeason).SubPath.Add(SeasonEntity.PrefetchPathSeries);
            prefetchPath.Add(ArtworkEntity.PrefetchPathArtworkToPeople);
            prefetchPath.Add(ArtworkEntity.PrefetchPathArtworkToRoles).SubPath.Add(ArtworkToRoleEntity.PrefetchPathRole).SubPath.Add(RoleEntity.PrefetchPathRoleToSeries).SubPath.Add(RoleToSeriesEntity.PrefetchPathSeries);
            prefetchPath.Add(ArtworkEntity.PrefetchPathArtworkToSeasons).SubPath.Add(ArtworkToSeasonEntity.PrefetchPathSeason).SubPath.Add(SeasonEntity.PrefetchPathSeries);
            prefetchPath.Add(ArtworkEntity.PrefetchPathArtworkToSeries).SubPath.Add(ArtworkToSeriesEntity.PrefetchPathSeries);

            return Database.GetEntityCollection<ArtworkEntity>(bucket, prefetchPath);
        }
Beispiel #3
1
        public EntityCollection<CatalogsEntity> GetAllParent(SortExpression sort)
        {
            EntityCollection<CatalogsEntity> cats = new EntityCollection<CatalogsEntity>();

            SortExpression _sort = new SortExpression();
            if (sort != null)
            {
                _sort = sort;
            }
            else
            {
                _sort.Add(CatalogsFields.CatalogName | SortOperator.Ascending);
            }

            IPredicateExpression predicate = new PredicateExpression();
            predicate.Add(CatalogsFields.ParentId == 0);
            predicate.AddWithAnd(CatalogsFields.IsVisible == true);

            RelationPredicateBucket filter = new RelationPredicateBucket();
            filter.PredicateExpression.Add(predicate);

            using (DataAccessAdapterBase adapter = new DataAccessAdapterFactory().CreateAdapter())
            {
                adapter.FetchEntityCollection(cats, filter, 0, _sort);
            }

            return cats;
        }
		/// <summary>
        /// Efficient pageing for grid.
        /// </summary>
        /// <param name="pageNumber">Must be greater than zero.</param>
        /// <param name="sortDirection">Validne vrijednosti su 'asc' i 'desc'.</param>
        public static EntityCollection<ArtiklEntity> FetchArtiklCollectionForPaging(DataAccessAdapterBase adapter,
			RelationPredicateBucket bucket,
			PrefetchPath2 prefetchPath,
            int pageNumber,
            int pageSize,
            string sortField,
			bool isSortAscending)
        {
			string sortDirection = isSortAscending ? "asc" : "desc";

            Type sortEntityFieldType = typeof(ArtiklFields);
            string sortEntityFieldTypeName = SortHelper.GetEntityFieldTypeNameForSorting(sortField, sortEntityFieldType);
            if (!string.IsNullOrWhiteSpace(sortEntityFieldTypeName))
            {
                sortEntityFieldType = Type.GetType(sortEntityFieldTypeName);
            }

            sortField = SortHelper.GetSortField(sortField);			

			SortExpression sort = SortHelper.GetSortExpression(sortField, sortDirection, sortEntityFieldType);
			
            EntityCollection<ArtiklEntity> toReturn = new EntityCollection<ArtiklEntity>(new ArtiklEntityFactory());
            adapter.FetchEntityCollection(toReturn, bucket, pageSize, sort, prefetchPath, pageNumber, pageSize);

            return toReturn;
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'Test' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoTestCollectionViaInventoryItemTest()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("TestCollectionViaInventoryItemTest"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(InventoryItemFields.InventoryItemId, null, ComparisonOperator.Equal, this.InventoryItemId, "InventoryItemEntity__"));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'SalesOrderDetail' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoSalesOrderDetails()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(SalesOrderDetailFields.ProductId, null, ComparisonOperator.Equal, this.ProductId));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(SalesOrderDetailFields.SpecialOfferId, null, ComparisonOperator.Equal, this.SpecialOfferId));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'OrganizationRoleUser' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoOrganizationRoleUserCollectionViaExportableReportsQueue()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("OrganizationRoleUserCollectionViaExportableReportsQueue"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ExportableReportsFields.Id, null, ComparisonOperator.Equal, this.Id, "ExportableReportsEntity__"));
            return(bucket);
        }
Beispiel #8
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'Encounter' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoEncounterCollectionViaClaim()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("EncounterCollectionViaClaim"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(InsurancePaymentFields.InsurancePaymentId, null, ComparisonOperator.Equal, this.InsurancePaymentId, "InsurancePaymentEntity__"));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Employees' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoEmployeesCollectionViaOrders()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("EmployeesCollectionViaOrders"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CustomersFields.CustomerId, null, ComparisonOperator.Equal, this.CustomerId, "CustomersEntity__"));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Order' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoOrdersCollectionViaOrderDetails()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("OrdersCollectionViaOrderDetails"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProductFields.ProductId, null, ComparisonOperator.Equal, this.ProductId, "ProductEntity__"));
            return(bucket);
        }
Beispiel #11
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'OrganizationRoleUser' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoOrganizationRoleUserCollectionViaAfcampaign()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("OrganizationRoleUserCollectionViaAfcampaign"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AfadvertiserFields.AdvertiserId, null, ComparisonOperator.Equal, this.AdvertiserId, "AfadvertiserEntity__"));
            return(bucket);
        }
Beispiel #12
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'MessageDetails' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoMessageDetailsCollectionViaMessageDetails()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("MessageDetailsCollectionViaMessageDetails"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ItemDetailsFields.ItemId, null, ComparisonOperator.Equal, this.ItemId, "ItemDetailsEntity__"));
            return(bucket);
        }
Beispiel #13
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'ProspectContact' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoProspectContactCollectionViaProspectContactRoleMapping()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("ProspectContactCollectionViaProspectContactRoleMapping"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ProspectContactRoleFields.ProspectContactRoleId, null, ComparisonOperator.Equal, this.ProspectContactRoleId, "ProspectContactRoleEntity__"));
            return(bucket);
        }
Beispiel #14
0
        public IEnumerable <CallQueue> GetAll(bool isManual = true, bool isHealthPlan = false)
        {
            var relationPredicateBucket = new RelationPredicateBucket(CallQueueFields.IsActive == true);

            relationPredicateBucket.PredicateExpression.AddWithAnd(CallQueueFields.IsManual == isManual);
            relationPredicateBucket.PredicateExpression.AddWithAnd(CallQueueFields.IsHealthPlan == isHealthPlan);
            return(Get(relationPredicateBucket));
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'CustomerEventTestIncidentalFinding' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoCustomerEventTestIncidentalFindingCollectionViaCustomerEventTestIncidentalFindingDetail()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("CustomerEventTestIncidentalFindingCollectionViaCustomerEventTestIncidentalFindingDetail"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(IncidentalFindingReadingGroupItemFields.GroupItemId, null, ComparisonOperator.Equal, this.GroupItemId, "IncidentalFindingReadingGroupItemEntity__"));
            return(bucket);
        }
Beispiel #16
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'Lookup' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoLookupCollectionViaCustomerUnsubscribedSmsNotification()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("LookupCollectionViaCustomerUnsubscribedSmsNotification"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(SmsReceivedFields.Id, null, ComparisonOperator.Equal, this.Id, "SmsReceivedEntity__"));
            return(bucket);
        }
        public CorporateCustomerCustomTag GetByCustomerAndTag(long customerId, string tag)
        {
            var expresion = new RelationPredicateBucket(CustomerTagFields.CustomerId == customerId);

            expresion.PredicateExpression.AddWithAnd(CustomerTagFields.Tag == tag);

            return(Get(expresion).SingleOrDefault());
        }
 public void DeleteEventZipByEventId(long eventId)
 {
     using (var adapter = PersistenceLayer.GetDataAccessAdapter())
     {
         var bucket = new RelationPredicateBucket(EventZipFields.EventId == eventId);
         adapter.DeleteEntitiesDirectly(typeof(EventZipEntity), bucket);
     }
 }
    public RelationPredicateBucket GetActiveCategoriesBucket()
    {
        var bucket = new RelationPredicateBucket();

        bucket.PredicateExpression.Add(CategoryFields.IsDeleted == false);
        bucket.PredicateExpression.Add(CategoryFields.IsActive == true);
        return(bucket);
    }
Beispiel #20
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'User' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoUserCollectionViaAuditInfo()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("UserCollectionViaAuditInfo"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AuditActionTypeFields.AuditActionTypeId, null, ComparisonOperator.Equal, this.AuditActionTypeId, "AuditActionTypeEntity__"));
            return(bucket);
        }
        public IEnumerable <CampaignActivity> GetDirectMailActivityByCampaignId(long campaignId)
        {
            var relationPredicateBucket = new RelationPredicateBucket(CampaignActivityFields.CampaignId == campaignId);

            relationPredicateBucket.PredicateExpression.AddWithAnd(CampaignActivityAssignmentFields.CampaignActivityId == (long)CampaignActivityType.DirectMail);

            return(Get(relationPredicateBucket).ToArray());
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Customer' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoCustomersCollectionViaCustomerCustomerDemo()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("CustomersCollectionViaCustomerCustomerDemo"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(CustomerDemographyFields.CustomerTypeId, null, ComparisonOperator.Equal, this.CustomerTypeId, "CustomerDemographyEntity__"));
            return(bucket);
        }
Beispiel #23
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Group' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoGroupCollectionViaUserGroup()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("GroupCollectionViaUserGroup"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(UserFields.UserId, null, ComparisonOperator.Equal, this.UserId, "UserEntity__"));
            return(bucket);
        }
Beispiel #24
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'ServiceLocation' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoServiceLocationCollectionViaServiceLocationAssetTypeId()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("ServiceLocationCollectionViaServiceLocationAssetTypeId"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AssetTypeFields.AssetTypeId, null, ComparisonOperator.Equal, this.AssetTypeId, "AssetTypeEntity__"));
            return(bucket);
        }
Beispiel #25
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Category' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoCategoriesCollectionViaProducts()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("CategoriesCollectionViaProducts"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(SupplierFields.SupplierId, null, ComparisonOperator.Equal, this.SupplierId, "SupplierEntity__"));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'CustomerProfile' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoCustomerProfileCollectionViaCustomerChaseChannel()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("CustomerProfileCollectionViaCustomerChaseChannel"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(ChaseChannelLevelFields.ChaseChannelLevelId, null, ComparisonOperator.Equal, this.ChaseChannelLevelId, "ChaseChannelLevelEntity__"));
            return(bucket);
        }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'Events' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoEventsCollectionViaAfmarketingMaterial()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("EventsCollectionViaAfmarketingMaterial"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(AfmarketingMaterialTypeFields.MarketingMaterialTypeId, null, ComparisonOperator.Equal, this.MarketingMaterialTypeId, "AfmarketingMaterialTypeEntity__"));
            return(bucket);
        }
Beispiel #28
0
 private void DeletePreQualificationTemplateQuestion(long templateId)
 {
     using (var adapter = PersistenceLayer.GetDataAccessAdapter())
     {
         var relationPredicateBucket = new RelationPredicateBucket(PreQualificationTemplateQuestionFields.TemplateId == templateId);
         adapter.DeleteEntitiesDirectly(typeof(PreQualificationTemplateQuestionEntity), relationPredicateBucket);
     }
 }
Beispiel #29
0
 public void DeleteTemplateQuestions(long templateId)
 {
     using (var adapter = PersistenceLayer.GetDataAccessAdapter())
     {
         var relationPredicateBucket = new RelationPredicateBucket(FluConsentTemplateQuestionFields.TemplateId == templateId);
         adapter.DeleteEntitiesDirectly(typeof(FluConsentTemplateQuestionEntity), relationPredicateBucket);
     }
 }
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'Employee' to this entity.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoEmployeeCollectionViaEmployeeTerritory()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("EmployeeCollectionViaEmployeeTerritory"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(TerritoryFields.TerritoryId, null, ComparisonOperator.Equal, this.TerritoryId, "TerritoryEntity__"));
            return(bucket);
        }
Beispiel #31
0
        public List <EventTest> GetByEventAndTestIds(long eventId, IEnumerable <long> testIds)
        {
            var bucket =
                new RelationPredicateBucket(EventTestFields.EventId == eventId);

            bucket.PredicateExpression.AddWithAnd(EventTestFields.TestId == testIds.ToArray());
            return(Get(bucket).ToList());
        }
 private void DeleteCallQueueAssignment(long callQueueId)
 {
     using (var adapter = PersistenceLayer.GetDataAccessAdapter())
     {
         var relationPredicateBucket = new RelationPredicateBucket(CallQueueAssignmentFields.CallQueueId == callQueueId);
         adapter.DeleteEntitiesDirectly(typeof(CallQueueAssignmentEntity), relationPredicateBucket);
     }
 }
Beispiel #33
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'RecycleType' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoRecycleTypeCollectionViaBale()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("RecycleTypeCollectionViaBale"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(DockFields.DockId, null, ComparisonOperator.Equal, this.DockId, "DockEntity__"));
            return(bucket);
        }
Beispiel #34
0
        /// <summary> Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch
        /// the related entities of type 'MvuserEventTestLock' to this entity. Use DataAccessAdapter.FetchEntityCollection() to fetch these related entities.</summary>
        /// <returns></returns>
        public virtual IRelationPredicateBucket GetRelationInfoMvuserEventTestLockCollectionViaMvpaymentInfo()
        {
            IRelationPredicateBucket bucket = new RelationPredicateBucket();

            bucket.Relations.AddRange(GetRelationsForFieldOfType("MvuserEventTestLockCollectionViaMvpaymentInfo"));
            bucket.PredicateExpression.Add(new FieldCompareValuePredicate(MedicalVendorPaymentAccruedFields.MedicalVendorPayAccrId, null, ComparisonOperator.Equal, this.MedicalVendorPayAccrId, "MedicalVendorPaymentAccruedEntity__"));
            return(bucket);
        }
Beispiel #35
0
        public static UserEntity FetchUser(DataAccessAdapterBase adapter, string userName, string passwordHash)
        {
            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.PredicateExpression.Add(UserFields.Username == userName);
            bucket.PredicateExpression.Add(UserFields.Password == passwordHash);

            return FetchUserCollection(adapter, bucket, null).SingleOrDefault();
        }
Beispiel #36
0
        public static bool Exists(int seriesId, int seasonNumber, int episodeNumber)
        {
            var bucket = new RelationPredicateBucket();
            bucket.Relations.Add(Relations.SeasonEntityUsingSeasonId);
            bucket.PredicateExpression.Add(SeasonFields.SeasonNumber == seasonNumber);
            bucket.PredicateExpression.Add(SeasonFields.SeriesId == seriesId);
            bucket.PredicateExpression.Add(EpisodeFields.EpisodeNumber == episodeNumber);

            return Database.GetEntityCollection<EpisodeEntity>(bucket).Any();
        }
        /// <summary>
        /// Retrieves a list of groups matching the criteria specified via method parameters.
        /// </summary>
        /// <param name="category">Category name.</param>
        /// <param name="categoryId">Category Id</param>
        /// <param name="pageNumber">Page number.</param>
        /// <param name="pageSize">Page size.</param>
        /// <param name="recordCount">Record count.</param>
        /// <returns>List of groups.</returns>
        public List<MonoSoftware.MonoX.Repositories.SnGroupDTO> GetPopularGroups(string category, Guid categoryId, int pageNumber, int pageSize, out int recordCount)
        {
            RelationPredicateBucket filter = new RelationPredicateBucket();

            //introduced to filter out groups by languages and applications
            filter.Relations.Add(SnGroupEntity.Relations.SnGroupCategoryEntityUsingGroupCategoryId, JoinHint.Left);
            //Note: MonoX supports the multi application environment so general filter for all DB access calls should contain the application id filter
            filter.PredicateExpression.Add(SnGroupCategoryFields.ApplicationId == MonoSoftware.MonoX.Repositories.MembershipRepository.GetInstance().GetApplicationId());
            //Note: MonoX in supports the multi language environment so general filter for all DB access calls should contain the language id filter
            filter.PredicateExpression.Add(SnGroupCategoryFields.LanguageId == LocalizationUtility.GetCurrentLanguageId());

            //Filter groups by category
            if (categoryId != Guid.Empty)
            {
                filter.PredicateExpression.Add(SnGroupFields.GroupCategoryId == categoryId);
            }
            if (!String.IsNullOrEmpty(category))
            {
                filter.PredicateExpression.Add(SnGroupCategoryFields.Slug == category);
            }

            IPrefetchPath2 prefetch = new PrefetchPath2((int)EntityType.SnGroupEntity);
            prefetch.Add(SnGroupEntity.PrefetchPathSnGroupCategory);
            //Fetch a record from the members table only for the current user so his status could be read
            Guid uid = SecurityUtility.GetUserId();
            if (!Guid.Empty.Equals(uid))
            {
                PredicateExpression memberFilter = new PredicateExpression(SnGroupMemberFields.UserId == uid);
                prefetch.Add(SnGroupEntity.PrefetchPathSnGroupMembers, 1, memberFilter);
            }

            #region Popular groups sorter
            const string memberCountField = "MemberCountField";
            const string memberCountTableName = "MemberCountTable";

            EntityFields2 memberFields = new EntityFields2(2);
            memberFields.DefineField(SnGroupMemberFields.GroupId, 0);
            memberFields.DefineField(SnGroupMemberFields.Id, 1, memberCountField, AggregateFunction.Count);
            DerivedTableDefinition memberCountTable = new DerivedTableDefinition(memberFields, memberCountTableName, null, new GroupByCollection(memberFields[0]));

            IDynamicRelation memberCountRelation = new DynamicRelation(memberCountTable, JoinHint.Right, MonoSoftware.MonoX.DAL.EntityType.SnGroupEntity, String.Empty, SnGroupMemberFields.GroupId.SetObjectAlias(memberCountTable.Alias) == SnGroupFields.Id);
            filter.Relations.Add(memberCountRelation);

            ISortExpression sorter = new SortExpression(new SortClause(new EntityField2(memberCountField, null).SetObjectAlias(memberCountTableName), null, SortOperator.Descending));
            #endregion

            EntityCollection<SnGroupEntity> groups = new EntityCollection<SnGroupEntity>();
            //Fetch the group collection
            FetchEntityCollection(groups, filter, 0, sorter, prefetch, pageNumber, pageSize);
            //Fetch the group total count used by paging
            recordCount = GetDbCount(groups, filter);
            //Transfer group entities to the DTO
            List<MonoSoftware.MonoX.Repositories.SnGroupDTO> toReturn = groups.Select(group => new MonoSoftware.MonoX.Repositories.SnGroupDTO(group)).ToList<MonoSoftware.MonoX.Repositories.SnGroupDTO>();
            return toReturn;
        }
Beispiel #38
0
        public static EntityCollection<TrgovanjeGlavaHnbEntity> FetchTrgovanjeGlavaHnbCollection(DataAccessAdapterBase adapter,
            DateTime startDate,
            DateTime endDate)
        {
            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.PredicateExpression.Add(PredicateHelper.FilterValidEntities(startDate, endDate, TrgovanjeGlavaHnbFields.Datum));

            PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.TrgovanjeGlavaHnbEntity);
            prefetchPath.Add(TrgovanjeGlavaHnbEntity.PrefetchPathTrgovanjeStavkaHnbCollection);

            return FetchTrgovanjeGlavaHnbCollection(adapter, bucket, prefetchPath);
        }
Beispiel #39
0
        public int DeleteByDescription(string Description)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(ProductSubFields.Description == Description);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("ProductSubEntity", filter);
            }
            return toReturn;
        }
Beispiel #40
0
        public int DeleteByFeature(string Feature)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetSchemaVersionsFields.Feature == Feature);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetSchemaVersionsEntity", filter);
            }
            return toReturn;
        }
Beispiel #41
0
        public int DeleteByPropertyNames(string PropertyNames)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetProfileFields.PropertyNames == PropertyNames);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetProfileEntity", filter);
            }
            return toReturn;
        }
Beispiel #42
0
        public int DeleteByAdvertPositionId(Guid AdvertPositionId)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AdvertsGroupFields.AdvertPositionId == AdvertPositionId);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AdvertsGroupEntity", filter);
            }
            return toReturn;
        }
Beispiel #43
0
        public int DeleteByAddress(string Address)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(SupplierRegisterFields.Address == Address);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("SupplierRegisterEntity", filter);
            }
            return toReturn;
        }
Beispiel #44
0
        public int DeleteByCreatedBy(string CreatedBy)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(OrdersFields.CreatedBy == CreatedBy);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("OrdersEntity", filter);
            }
            return toReturn;
        }
Beispiel #45
0
        public int DeleteByCommissionPercent(double CommissionPercent)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(ProductInfoFields.CommissionPercent == CommissionPercent);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("ProductInfoEntity", filter);
            }
            return toReturn;
        }
Beispiel #46
0
        public int DeleteByAmount(int Amount)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(ShippingDetailFields.Amount == Amount);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("ShippingDetailEntity", filter);
            }
            return toReturn;
        }
Beispiel #47
0
        public int DeleteByActionDate(DateTime ActionDate)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(HistoryOrdersFields.ActionDate == ActionDate);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("HistoryOrdersEntity", filter);
            }
            return toReturn;
        }
Beispiel #48
0
        public int DeleteByCatalogId(int CatalogId)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(VideosFields.CatalogId == CatalogId);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("VideosEntity", filter);
            }
            return toReturn;
        }
Beispiel #49
0
        public int DeleteByIsAnonymous(bool IsAnonymous)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetUsersFields.IsAnonymous == IsAnonymous);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetUsersEntity", filter);
            }
            return toReturn;
        }
Beispiel #50
0
        public int DeleteByIsActive(bool IsActive)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(PromotionsFields.IsActive == IsActive);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("PromotionsEntity", filter);
            }
            return toReturn;
        }
Beispiel #51
0
        public int DeleteByCost(decimal Cost)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(MarkTransferFields.Cost == Cost);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("MarkTransferEntity", filter);
            }
            return toReturn;
        }
Beispiel #52
0
        public int DeleteByCountDown(int CountDown)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(DocumentFields.CountDown == CountDown);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("DocumentEntity", filter);
            }
            return toReturn;
        }
Beispiel #53
0
        public int DeleteByDiscountName(string DiscountName)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(DiscountFields.DiscountName == DiscountName);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("DiscountEntity", filter);
            }
            return toReturn;
        }
Beispiel #54
0
        public int DeleteByOrderIndex(int OrderIndex)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(PositionFields.OrderIndex == OrderIndex);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("PositionEntity", filter);
            }
            return toReturn;
        }
Beispiel #55
0
        public int DeleteByApplicationVirtualPath(string ApplicationVirtualPath)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetWebEventEventsFields.ApplicationVirtualPath == ApplicationVirtualPath);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetWebEventEventsEntity", filter);
            }
            return toReturn;
        }
Beispiel #56
0
        public int DeleteByUserId(Guid UserId)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetUsersInRolesFields.UserId == UserId);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetUsersInRolesEntity", filter);
            }
            return toReturn;
        }
Beispiel #57
0
        public int DeleteByLastUpdatedDate(DateTime LastUpdatedDate)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(AspnetProfileFields.LastUpdatedDate == LastUpdatedDate);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("AspnetProfileEntity", filter);
            }
            return toReturn;
        }
Beispiel #58
0
        public int DeleteById(Guid Id)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(FeedBackFields.Id == Id);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("FeedBackEntity", filter);
            }
            return toReturn;
        }
Beispiel #59
0
        public int DeleteByNewsletterId(Guid NewsletterId)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(NewsletterInProductFields.NewsletterId == NewsletterId);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("NewsletterInProductEntity", filter);
            }
            return toReturn;
        }
Beispiel #60
0
        public int DeleteByApproved(bool Approved)
        {
            int toReturn = 0;
            RelationPredicateBucket filter = new RelationPredicateBucket();

            IPredicateExpression _PredicateExpression = new PredicateExpression();
            _PredicateExpression.Add(EventsFields.Approved == Approved);
            filter.PredicateExpression.Add(_PredicateExpression);

            using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                toReturn = adapter.DeleteEntitiesDirectly("EventsEntity", filter);
            }
            return toReturn;
        }