public SeatingPrioritySetupModel(IAreaRepository areaRepository,
     IEmployeeRepository employeeRepository, IEntityFactory entityFactory)
 {
     _areaRepository = areaRepository;
     _entityFactory = entityFactory;
     _employeeRepository = employeeRepository;
 }
        public static IEntityFactory GetFactory()
        {
            if (_FACTORY == null)
                _FACTORY = new EntityFactory();

            return _FACTORY;
        }
Example #3
0
        public Player(IMovement movement, IEntityFactory networkPlayer, ICurrentNode currentNode, string name)
        {
            currentNode.SetName(name);
            networkPlayer.CreateNetworkingPlayer();

            _name = name;
        }
Example #4
0
	/// <summary>
	/// Registers the entity factory.
	/// </summary>
	/// <returns><c>true</c>, if entity factory was registered, <c>false</c> otherwise.</returns>
	/// <param name="szTypeName">Size type name.</param>
	/// <param name="factory">Factory.</param>
	public virtual void		RegisterEntityFactory(string szFactoryName, IEntityFactory factory)
	{
		if (!m_dFactory.ContainsKey(szFactoryName))
		{
			m_dFactory.Add(szFactoryName, factory);
		}
	}
        public MyGameWorld(
            I2DRenderUtilities renderUtilities,
            IAssetManagerProvider assetManagerProvider,
            IEntityFactory entityFactory)
        {
            this.Entities = new List<IEntity>();

            _renderUtilities = renderUtilities;
            _assetManager = assetManagerProvider.GetAssetManager();
            _defaultFont = this._assetManager.Get<FontAsset>("font.Default");

            // You can also save the entity factory in a field and use it, e.g. in the Update
            // loop or anywhere else in your game.
            var entityA = entityFactory.CreateExampleEntity("EntityA");
            entityA.X = 100;
            entityA.Y = 50;
            var entityB = entityFactory.CreateExampleEntity("EntityB");
            entityB.X = 120;
            entityB.Y = 100;

            // Don't forget to add your entities to the world!
            this.Entities.Add(entityA);
            this.Entities.Add(entityB);

            // This pulls in the texture asset via the asset manager.  Note that
            // the folder seperator from "texture/Player" has been translated
            // into a single dot.
            _playerTexture = _assetManager.Get<TextureAsset>("texture.Player");
        }
Example #6
0
 public StaffingChartPresenter(IStaffingCalculatorModel staffingCalculatorModel,
     IEntityFactory entityFactory, Schedule schedule, IStaffingCalculatorService service)
 {
     _schedule = schedule;
     _staffingService = service;
     _staffingCalculatorModel = staffingCalculatorModel;
     _entityFactory = entityFactory;
 }
Example #7
0
 public AttendanceManagerModel(IEntityFactory entityFactory, IEmployeeRepository employeeRepository, IRepository<Schedule> scheduleRepository, 
     IAttendanceRepository attendanceRepository)
 {
     _entityFactory = entityFactory;
     _employeeRepository = employeeRepository;
     _scheduleRepository = scheduleRepository;
     _attendanceRepository = attendanceRepository;
 }
        public void Initialize(EntityWorld entityWorld, IEntityFactory entityFactory)
        {
            _entityWorld = entityWorld;
            EntityFactory = entityFactory;

            _entityWorld.EntityManager.AddedEntityEvent += OnEntityAdded;
            _entityWorld.EntityManager.RemovedEntityEvent += OnEntityRemoved;
        }
        internal EntityController(IEntityRepository repository, IEntityFactory factory)
        {
            _entityRepository = repository;
            _entityFactory = factory;

            // TODO: somehow make this automatic (base constructor of controllers didn't work out)
            Initialize();
        }
Example #10
0
 /// <summary>Retrieves in the calling AuditActionCollection object all AuditActionEntity objects which are related via a relation of type 'm:n' with the passed in RoleEntity.</summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="roleInstance">RoleEntity object to be used as a filter in the m:n relation</param>
 /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingRolesWithAuditAction(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity roleInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
 {
     RelationCollection relations = new RelationCollection();
     relations.Add(AuditActionEntity.Relations.RoleAuditActionEntityUsingAuditActionID, "RoleAuditAction_");
     relations.Add(RoleAuditActionEntity.Relations.RoleEntityUsingRoleID, "RoleAuditAction_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(roleInstance.Fields[(int)RoleFieldIndex.RoleID], ComparisonOperator.Equal));
     return this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize);
 }
 /// <summary>Retrieves in the calling MembershipCollection object all MembershipEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
 /// <param name="roleInstance">RoleEntity instance to use as a filter for the MembershipEntity objects to return</param>
 /// <param name="storeInformationInstance">StoreInformationEntity instance to use as a filter for the MembershipEntity objects to return</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity roleInstance, IEntity storeInformationInstance, int pageNumber, int pageSize)
 {
     this.EntityFactoryToUse = entityFactoryToUse;
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(ProductSearchEngine.EntityType.MembershipEntity);
     IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(roleInstance, storeInformationInstance, fieldsToReturn);
     if(filter!=null)
     {
         selectFilter.AddWithAnd(filter);
     }
     return this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
 }
Example #12
0
        public DefaultWorld(
            IProfiler profiler,
            INetworkingSession networkSession,
            IEntityFactory playerFactory,
            ICurrentNode currentNode)
        {
            currentNode.SetName("AmazingWorld");

            playerFactory.CreatePlayer("Player1");
            playerFactory.CreatePlayer("Player2");
        }
Example #13
0
 /// <summary>Retrieves in the calling ForumCollection object all ForumEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
 /// <param name="sectionInstance">SectionEntity instance to use as a filter for the ForumEntity objects to return</param>
 /// <param name="defaultSupportQueueInstance">SupportQueueEntity instance to use as a filter for the ForumEntity objects to return</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity sectionInstance, IEntity defaultSupportQueueInstance, int pageNumber, int pageSize)
 {
     this.EntityFactoryToUse = entityFactoryToUse;
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SD.HnD.DAL.EntityType.ForumEntity);
     IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(sectionInstance, defaultSupportQueueInstance, fieldsToReturn);
     if(filter!=null)
     {
         selectFilter.AddWithAnd(filter);
     }
     return this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
 }
Example #14
0
        public Game1()
        {
            _graphics = new GraphicsDeviceManager(this);
            _collisionManager = new CollisionManager();
            _entityFactory = new EntityFactory(this);
            Content.RootDirectory = "Content";

            Services.AddService(typeof(IEntityFactory), _entityFactory);
            Services.AddService(typeof(CollisionManager), _collisionManager);
            Services.AddService(typeof(ContentManager), Content);

        }
Example #15
0
 public ScheduleManagerModel(ICampaignScheduleRepository repository, ICampaignRepository campaignRepository,
                             IServiceQueueRepository serviceQueueRepository, IAttendanceRepository attendanceRepository,
     IOrganizationRepository organizationRepository,
                             IEntityFactory entityFactory)
 {
     _repository = repository;
     _campaignRepository = campaignRepository;
     _serviceQueueRepository = serviceQueueRepository;
     _entityFactory = entityFactory;
     _attendanceRepository = attendanceRepository;
     _organizationRepository = organizationRepository;
 }
        public Spawn(
            IHierarchy hierarchy,
            IEntityFactory entityFactory,
            string name,
            int id,
            int x, 
            int y, 
            Dictionary<string, string> attributes)
        {
            _hierarchy = hierarchy;
            this.m_EntityFactory = entityFactory;

            this.Transform.LocalPosition = new Vector3(x, y, 0);
        }
        public PROJECT_SAFE_NAMEWorld(
            INode worldNode,
            IHierarchy hierarchy,
            I2DRenderUtilities twoDRenderUtilities,
            IAssetManagerProvider assetManagerProvider,
            IEntityFactory entityFactory)
        {
            this.Entities = new List<IEntity>();

            _renderUtilities = twoDRenderUtilities;
            _assetManager = assetManagerProvider.GetAssetManager();
            _defaultFont = this._assetManager.Get<FontAsset>("font.Default");

            // You can also save the entity factory in a field and use it, e.g. in the Update
            // loop or anywhere else in your game.
            var entityA = entityFactory.CreateExampleEntity("EntityA");
            entityA.Transform.LocalPosition = new Vector3(100, 50, 0);
            var entityB = entityFactory.CreateExampleEntity("EntityB");
            entityB.Transform.LocalPosition = new Vector3(120, 100, 0);

            // Don't forget to add your entities to the world!
            hierarchy.MoveNode(worldNode, hierarchy.Lookup(entityA));
            hierarchy.MoveNode(worldNode, hierarchy.Lookup(entityB));
        }
Example #18
0
        /// <summary>
        /// Retrieves in the calling CombineModeCollection object all CombineModeEntity objects
        /// which are related via a relation of type 'm:n' with the passed in LibraryEntity.
        /// </summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.
        /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="libraryInstance">LibraryEntity object to be used as a filter in the m:n relation</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>true if succeeded, false otherwise</returns>
        public bool GetMultiUsingLibraryCollectionViaPolicy(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity libraryInstance, int pageNumber, int pageSize)
        {
            IEntityFields      fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.CombineModeEntity);
            RelationCollection relations      = new RelationCollection();

            relations.Add(CombineModeEntity.Relations.PolicyEntityUsingCombineModeId, "Policy_");
            relations.Add(PolicyEntity.Relations.LibraryEntityUsingLibraryId, "Policy_", string.Empty, JoinHint.None);
            IPredicateExpression selectFilter = new PredicateExpression();

            selectFilter.Add(new FieldCompareValuePredicate(libraryInstance.Fields[(int)LibraryFieldIndex.Id], ComparisonOperator.Equal));
            return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize));
        }
Example #19
0
 /// <summary> Retrieves all related entities of type 'AuditInfoEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public SD.LLBLGen.Pro.Examples.Auditing.CollectionClasses.AuditInfoCollection GetMultiAuditInfo(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     return(GetMultiAuditInfo(forceFetch, entityFactoryToUse, null));
 }
 public ControllerStateService(IRepositoryService repositoryService, IEntityFactory entityFactory, IModelFactory modelFactory)
 {
     _entityFactory     = entityFactory ?? throw new ArgumentNullException(nameof(entityFactory));
     _modelFactory      = modelFactory ?? throw new ArgumentNullException(nameof(modelFactory));
     _repositoryService = repositoryService ?? throw new ArgumentNullException(nameof(repositoryService));
 }
Example #21
0
 /// <summary>CTor</summary>
 /// <param name="inheritanceInfoProviderToUse">Inheritance info provider to use.</param>
 /// <param name="dqeToUse">Dqe to use.</param>
 /// <param name="typeOfInheritance">Type of inheritance.</param>
 /// <param name="entityName">Name of the entity.</param>
 /// <param name="entityFactory">Entity factory.</param>
 internal MUserDAO(IInheritanceInfoProvider inheritanceInfoProviderToUse, DynamicQueryEngineBase dqeToUse, InheritanceHierarchyType typeOfInheritance, string entityName, IEntityFactory entityFactory)
     : base(inheritanceInfoProviderToUse, dqeToUse, typeOfInheritance, entityName, entityFactory)
 {
 }
Example #22
0
 public CInfoProcessor(IEventPipeline eventPipeline, IEntityFactory entityFactory)
 {
     this.eventPipeline = eventPipeline;
     this.entityFactory = entityFactory;
 }
Example #23
0
 /// <summary> Retrieves all related entities of type 'AuditActionTypeEntity' using a relation of type 'm:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToMany() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public SD.LLBLGen.Pro.Examples.Auditing.CollectionClasses.AuditActionTypeCollection GetMultiAuditActionTypeCollectionViaAuditInfo(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     if ((!_alreadyFetchedAuditActionTypeCollectionViaAuditInfo || forceFetch || _alwaysFetchAuditActionTypeCollectionViaAuditInfo) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode)
     {
         AddToTransactionIfNecessary(_auditActionTypeCollectionViaAuditInfo);
         IPredicateExpression filter = new PredicateExpression();
         filter.Add(new FieldCompareValuePredicate(UserFields.UserId, ComparisonOperator.Equal, this.UserId, "UserEntity__"));
         _auditActionTypeCollectionViaAuditInfo.SuppressClearInGetMulti = !forceFetch;
         _auditActionTypeCollectionViaAuditInfo.EntityFactoryToUse      = entityFactoryToUse;
         _auditActionTypeCollectionViaAuditInfo.GetMulti(filter, GetRelationsForField("AuditActionTypeCollectionViaAuditInfo"));
         _auditActionTypeCollectionViaAuditInfo.SuppressClearInGetMulti = false;
         _alreadyFetchedAuditActionTypeCollectionViaAuditInfo           = true;
     }
     return(_auditActionTypeCollectionViaAuditInfo);
 }
Example #24
0
 /// <summary> CTor</summary>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 public AssetReclamationServiceCollection(IEntityFactory entityFactoryToUse) : base(entityFactoryToUse)
 {
 }
Example #25
0
 public MockVehiclePool(IEntityFactory <IVehicle> vehicleFactory) : base(vehicleFactory)
 {
 }
        public static T CreateFromPrefab <T>(ref uint startIndex, Transform contextHolder, IEntityFactory factory,
                                             ExclusiveGroup group, string groupNamePostfix = null) where T : MonoBehaviour, IEntityDescriptorHolder
        {
            var holder = Create <T>(new EGID(startIndex++, group), contextHolder, factory);
            var childs = contextHolder.GetComponentsInChildren <IEntityDescriptorHolder>(true);

            foreach (var child in childs)
            {
                if (child.GetType() != typeof(T))
                {
                    var monoBehaviour     = child as MonoBehaviour;
                    var childImplementors = monoBehaviour.GetComponents <IImplementor>();
                    startIndex = InternalBuildAll(
                        startIndex,
                        child,
                        factory,
                        group,
                        childImplementors,
                        groupNamePostfix);
                }
            }

            return(holder);
        }
Example #27
0
 /// <summary> Retrieves all related entities of type 'MUserEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <param name="filter">Extra filter to limit the resultset.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public virtual Kalibrasi.Data.CollectionClasses.MUserCollection GetMultiMuser(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
 {
     if( ( !_alreadyFetchedMuser || forceFetch || _alwaysFetchMuser) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode)
     {
         if(base.ParticipatesInTransaction)
         {
             if(!_muser.ParticipatesInTransaction)
             {
                 base.Transaction.Add(_muser);
             }
         }
         _muser.SuppressClearInGetMulti=!forceFetch;
         if(entityFactoryToUse!=null)
         {
             _muser.EntityFactoryToUse = entityFactoryToUse;
         }
         _muser.GetMultiManyToOne(this, filter);
         _muser.SuppressClearInGetMulti=false;
         _alreadyFetchedMuser = true;
     }
     return _muser;
 }
 public EntityValueFactoryTests()
 {
     poco          = new DasPoco();
     entityFactory = A.Fake <IEntityFactory>(o => o.Strict());
 }
 public PieceCreateService(IEntityFactory entityFactory)
 {
     this.entityFactory = entityFactory;
     prefabsDictionary  = new PrefabsDictionary();
 }
Example #30
0
 /// <summary>CTor</summary>
 /// <param name="typeOfInheritance">Type of inheritance the entity which owns this Dao is in.</param>
 /// <param name="entityName">Name of the entity owning this Dao</param>
 /// <param name="entityFactory">Entity factory for the entity owning this Dao.</param>
 public CommonDaoBase(InheritanceHierarchyType typeOfInheritance, string entityName, IEntityFactory entityFactory)
     : base(InheritanceInfoProviderSingleton.GetInstance(), new DynamicQueryEngine(), typeOfInheritance, entityName, entityFactory)
 {
 }
Example #31
0
        /// <summary>Retrieves in the calling DeviceMessageCollection object all DeviceMessageEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
        /// <param name="deviceInstance">DeviceEntity instance to use as a filter for the DeviceMessageEntity objects to return</param>
        /// <param name="messageInstance">MessageEntity instance to use as a filter for the DeviceMessageEntity objects to return</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity deviceInstance, IEntity messageInstance, int pageNumber, int pageSize)
        {
            this.EntityFactoryToUse = entityFactoryToUse;
            IEntityFields        fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(EPICCentralDL.EntityType.DeviceMessageEntity);
            IPredicateExpression selectFilter   = CreateFilterUsingForeignKeys(deviceInstance, messageInstance, fieldsToReturn);

            if (filter != null)
            {
                selectFilter.AddWithAnd(filter);
            }
            return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize));
        }
Example #32
0
 protected MasterPresenter(IEntityFactory entityFactory, IModel <TEntity> model)
 {
     _entityFactory = entityFactory;
     _model         = model;
 }
Example #33
0
 /// <summary>Inheritance ctor</summary>
 /// <param name="typeOfInheritance">Type of inheritance the entity which owns this Dao is in.</param>
 /// <param name="entityName">Name of the entity owning this Dao</param>
 /// <param name="entityFactory">Entity factory for the entity owning this Dao.</param>
 protected AuditDataCoreDAO(InheritanceHierarchyType typeOfInheritance, string entityName, IEntityFactory entityFactory)
     : base(typeOfInheritance, entityName, entityFactory)
 {
 }
Example #34
0
        /// <summary>Retrieves in the calling CustomerCustomerDemoCollection object all CustomerCustomerDemoEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
        /// <param name="customerInstance">CustomerEntity instance to use as a filter for the CustomerCustomerDemoEntity objects to return</param>
        /// <param name="customerDemographicInstance">CustomerDemographicEntity instance to use as a filter for the CustomerCustomerDemoEntity objects to return</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity customerInstance, IEntity customerDemographicInstance, int pageNumber, int pageSize)
        {
            this.EntityFactoryToUse = entityFactoryToUse;
            IEntityFields        fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Northwind.SSDAL.EntityType.CustomerCustomerDemoEntity);
            IPredicateExpression selectFilter   = CreateFilterUsingForeignKeys(customerInstance, customerDemographicInstance, fieldsToReturn);

            if (filter != null)
            {
                selectFilter.AddWithAnd(filter);
            }
            return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize));
        }
        /// <summary>Retrieves in the calling OrderCollection object all OrderEntity objects which are related via a relation of type 'm:n' with the passed in ProductEntity.</summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="productInstance">ProductEntity object to be used as a filter in the m:n relation</param>
        /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>true if succeeded, false otherwise</returns>
        public bool GetMultiUsingProductCollectionViaOrderDetails(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity productInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
        {
            RelationCollection relations = new RelationCollection();

            relations.Add(OrderEntity.Relations.OrderDetailEntityUsingOrderId, "OrderDetail_");
            relations.Add(OrderDetailEntity.Relations.ProductEntityUsingProductId, "OrderDetail_", string.Empty, JoinHint.None);
            IPredicateExpression selectFilter = new PredicateExpression();

            selectFilter.Add(new FieldCompareValuePredicate(productInstance.Fields[(int)ProductFieldIndex.ProductId], ComparisonOperator.Equal));
            return(this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize));
        }
Example #36
0
 protected EntityPool(IEntityFactory <TEntity> entityFactory)
 {
     this.entityFactory = entityFactory;
 }
Example #37
0
        /// <summary>Retrieves in the calling CustomerCollection object all CustomerEntity objects which are related via a relation of type 'm:n' with the passed in CustomerDemographyEntity.</summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="customerDemographyInstance">CustomerDemographyEntity object to be used as a filter in the m:n relation</param>
        /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>true if succeeded, false otherwise</returns>
        public bool GetMultiUsingCustomerDemographicsCollectionViaCustomerCustomerDemo(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity customerDemographyInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
        {
            RelationCollection relations = new RelationCollection();

            relations.Add(CustomerEntity.Relations.CustomerCustomerDemoEntityUsingCustomerId, "CustomerCustomerDemo_");
            relations.Add(CustomerCustomerDemoEntity.Relations.CustomerDemographyEntityUsingCustomerTypeId, "CustomerCustomerDemo_", string.Empty, JoinHint.None);
            IPredicateExpression selectFilter = new PredicateExpression();

            selectFilter.Add(new FieldCompareValuePredicate(customerDemographyInstance.Fields[(int)CustomerDemographyFieldIndex.CustomerTypeId], ComparisonOperator.Equal));
            return(this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize));
        }
 public TranslateCartToWishListEntity(IEntityFactory entityFactory)
 //: base(entityFactory)
 {
 }
Example #39
0
 /// <summary> Retrieves all related entities of type 'RoleSystemActionRightEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public SD.HnD.DAL.CollectionClasses.RoleSystemActionRightCollection GetMultiRoleSystemActionRights(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     return GetMultiRoleSystemActionRights(forceFetch, entityFactoryToUse, null);
 }
Example #40
0
 /// <summary> Retrieves all related entities of type 'AuditInfoEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <param name="filter">Extra filter to limit the resultset.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public virtual SD.LLBLGen.Pro.Examples.Auditing.CollectionClasses.AuditInfoCollection GetMultiAuditInfo(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
 {
     if ((!_alreadyFetchedAuditInfo || forceFetch || _alwaysFetchAuditInfo) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode)
     {
         AddToTransactionIfNecessary(_auditInfo);
         _auditInfo.SuppressClearInGetMulti = !forceFetch;
         _auditInfo.EntityFactoryToUse      = entityFactoryToUse;
         _auditInfo.GetMultiManyToOne(null, this, filter);
         _auditInfo.SuppressClearInGetMulti = false;
         _alreadyFetchedAuditInfo           = true;
     }
     return(_auditInfo);
 }
 /// <summary> CTor</summary>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 public AuditInfoCollection(IEntityFactory entityFactoryToUse) : base(entityFactoryToUse)
 {
 }
Example #42
0
 /// <summary>
 /// Retrieves in the calling AccountCollection object all AccountEntity objects
 /// which are related via a relation of type 'm:n' with the passed in UserEntity. 
 /// </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="userInstance">UserEntity object to be used as a filter in the m:n relation</param>
 /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingUserCollectionViaDonor_(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity userInstance, IPrefetchPath prefetchPathToUse)
 {
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Auction.Entities.EntityType.AccountEntity);
     RelationCollection relations = new RelationCollection();
     relations.Add(AccountEntity.Relations.DonorEntityUsingAccountId, "Donor_");
     relations.Add(DonorEntity.Relations.UserEntityUsingUpdatedBy, "Donor_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(userInstance.Fields[(int)UserFieldIndex.Id], ComparisonOperator.Equal));
     return GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse);
 }
Example #43
0
 /// <summary> CTor</summary>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 public EmployeeTerritoryCollection(IEntityFactory entityFactoryToUse) : base(entityFactoryToUse)
 {
 }
Example #44
0
 /// <summary> Retrieves all related entities of type 'ForumEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public SD.HnD.DAL.CollectionClasses.ForumCollection GetMultiForums(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     return GetMultiForums(forceFetch, entityFactoryToUse, null);
 }
Example #45
0
 /// <summary> CTor</summary>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 public JobCandidateCollection(IEntityFactory entityFactoryToUse) : base(entityFactoryToUse)
 {
 }
        private static void CreateEntitiesFrom(List <string> entitiesToRemove, MapDrawableBatch layer, Dictionary <string, List <NamedValue> > propertiesDictionary,
                                               float tileSize,
                                               InstantiationRestrictions restrictions = null)
        {
            var flatRedBallLayer = SpriteManager.Layers.FirstOrDefault(item => item.Batches.Contains(layer));

            var dictionary = layer.NamedTileOrderedIndexes;

            // layer needs its position updated:
            layer.ForceUpdateDependencies();

            foreach (var propertyList in propertiesDictionary.Values)
            {
                var property =
                    propertyList.FirstOrDefault(item2 => item2.Name == "EntityToCreate" || item2.Name == "Type");

                if (!string.IsNullOrEmpty(property.Name))
                {
                    var tileName = propertyList.FirstOrDefault(item => item.Name.ToLowerInvariant() == "name").Value as string;

                    var entityType = property.Value as string;

                    var shouldCreateEntityType =
                        !string.IsNullOrEmpty(entityType) && dictionary.ContainsKey(tileName);

                    if (shouldCreateEntityType && restrictions?.InclusiveList != null)
                    {
                        shouldCreateEntityType = restrictions.InclusiveList.Contains(entityType);
                    }

                    if (shouldCreateEntityType)
                    {
                        IEntityFactory factory = GetFactory(entityType);

                        if (factory == null)
                        {
                            bool isEntity = typesInThisAssembly.Any(item => item.Name.Contains($".Entities.") && item.Name.EndsWith(entityType));

                            if (isEntity)
                            {
                                string message =
                                    $"The factory for entity {entityType} could not be found. To create instances of this entity, " +
                                    "set its 'CreatedByOtherEntities' property to true in Glue.";
                                throw new Exception(message);
                            }
                        }
                        else
                        {
                            entitiesToRemove.Add(entityType);
                            var indexList = dictionary[tileName];

                            foreach (var tileIndex in indexList)
                            {
                                var shouldCreate = true;
                                var bounds       = restrictions?.Bounds;
                                if (bounds != null)
                                {
                                    layer.GetBottomLeftWorldCoordinateForOrderedTile(tileIndex, out float x, out float y);
                                    x           += tileSize / 2.0f;
                                    y           += tileSize / 2.0f;
                                    shouldCreate = bounds.IsPointInside(x, y);
                                }

                                if (shouldCreate)
                                {
                                    var entity = factory.CreateNew(flatRedBallLayer) as PositionedObject;

                                    ApplyPropertiesTo(entity, layer, tileIndex, propertyList);
                                }
                            }
                        }
                    }
                }
            }
        }
Example #47
0
 /// <summary>
 /// Retrieves in the calling EffectCollection object all EffectEntity objects
 /// which are related via a relation of type 'm:n' with the passed in DecisionNodeEntity. 
 /// </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="decisionNodeInstance">DecisionNodeEntity object to be used as a filter in the m:n relation</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingDecisionNodeCollectionViaRule(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity decisionNodeInstance, int pageNumber, int pageSize)
 {
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.EffectEntity);
     RelationCollection relations = new RelationCollection();
     relations.Add(EffectEntity.Relations.RuleEntityUsingEffectId, "Rule_");
     relations.Add(RuleEntity.Relations.DecisionNodeEntityUsingConditionId, "Rule_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(decisionNodeInstance.Fields[(int)DecisionNodeFieldIndex.Id], ComparisonOperator.Equal));
     return GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize);
 }
Example #48
0
 public SetBookRateHandler(IUnitOfWorkFactory unitOfWorkFactory, IEntityFactory entityFactory)
 {
     _unitOfWorkFactory = unitOfWorkFactory;
     _entityFactory     = entityFactory;
 }
 /// <summary>CTor</summary>
 /// <param name="typeOfInheritance">Type of inheritance the entity which owns this Dao is in.</param>
 /// <param name="entityName">Name of the entity owning this Dao</param>
 /// <param name="entityFactory">Entity factory for the entity owning this Dao.</param>
 public CommonDaoBase(InheritanceHierarchyType typeOfInheritance, string entityName, IEntityFactory entityFactory)
     : base(InheritanceInfoProviderSingleton.GetInstance(), new DynamicQueryEngine(), typeOfInheritance, entityName, entityFactory)
 {
 }
 /// <summary> CTor</summary>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 public UserCollection(IEntityFactory entityFactoryToUse) : base(entityFactoryToUse)
 {
 }
Example #51
0
 /// <summary>Retrieves in the calling ForumCollection object all ForumEntity objects which are related via a relation of type 'm:n' with the passed in UserEntity.</summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="userInstance">UserEntity object to be used as a filter in the m:n relation</param>
 /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingUsersWhoStartedThreads(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity userInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
 {
     RelationCollection relations = new RelationCollection();
     relations.Add(ForumEntity.Relations.ThreadEntityUsingForumID, "Thread_");
     relations.Add(ThreadEntity.Relations.UserEntityUsingStartedByUserID, "Thread_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(userInstance.Fields[(int)UserFieldIndex.UserID], ComparisonOperator.Equal));
     return this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize);
 }
Example #52
0
 /// <summary> Retrieves all related entities of type 'OrderEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public Northwind.SSDAL.CollectionClasses.OrderCollection GetMultiOrders(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     return(GetMultiOrders(forceFetch, entityFactoryToUse, null));
 }
Example #53
0
 /// <summary> Retrieves all related entities of type 'RoleEntity' using a relation of type 'm:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToMany() routine.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public SD.HnD.DAL.CollectionClasses.RoleCollection GetMultiSystemRightAssignedToRoles(bool forceFetch, IEntityFactory entityFactoryToUse)
 {
     if( ( !_alreadyFetchedSystemRightAssignedToRoles || forceFetch || _alwaysFetchSystemRightAssignedToRoles) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode)
     {
         AddToTransactionIfNecessary(_systemRightAssignedToRoles);
         IPredicateExpression filter = new PredicateExpression();
         filter.Add(new FieldCompareValuePredicate(ActionRightFields.ActionRightID, ComparisonOperator.Equal, this.ActionRightID, "ActionRightEntity__"));
         _systemRightAssignedToRoles.SuppressClearInGetMulti=!forceFetch;
         _systemRightAssignedToRoles.EntityFactoryToUse = entityFactoryToUse;
         _systemRightAssignedToRoles.GetMulti(filter, GetRelationsForField("SystemRightAssignedToRoles"));
         _systemRightAssignedToRoles.SuppressClearInGetMulti=false;
         _alreadyFetchedSystemRightAssignedToRoles = true;
     }
     return _systemRightAssignedToRoles;
 }
Example #54
0
 /// <summary> Retrieves all related entities of type 'OrderEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <param name="filter">Extra filter to limit the resultset.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public virtual Northwind.SSDAL.CollectionClasses.OrderCollection GetMultiOrders(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
 {
     if ((!_alreadyFetchedOrders || forceFetch || _alwaysFetchOrders) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode)
     {
         AddToTransactionIfNecessary(_orders);
         _orders.SuppressClearInGetMulti = !forceFetch;
         _orders.EntityFactoryToUse      = entityFactoryToUse;
         _orders.GetMultiManyToOne(null, null, this, filter);
         _orders.SuppressClearInGetMulti = false;
         _alreadyFetchedOrders           = true;
     }
     return(_orders);
 }
Example #55
0
 /// <summary>
 /// Retrieves in the calling AccountCollection object all AccountEntity objects
 /// which are related via a relation of type 'm:n' with the passed in RoleEntity. 
 /// </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="roleInstance">RoleEntity object to be used as a filter in the m:n relation</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingRoleCollectionViaUser(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity roleInstance, int pageNumber, int pageSize)
 {
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Auction.Entities.EntityType.AccountEntity);
     RelationCollection relations = new RelationCollection();
     relations.Add(AccountEntity.Relations.UserEntityUsingAccountId, "User_");
     relations.Add(UserEntity.Relations.RoleEntityUsingRoleId, "User_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(roleInstance.Fields[(int)RoleFieldIndex.Id], ComparisonOperator.Equal));
     return GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize);
 }
Example #56
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UpdateCustomerPaymentInfo"/> class.
 /// </summary>
 /// <param name="entityFactory">The entity factory.</param>
 public UpdateCustomerPaymentInfo(IEntityFactory entityFactory)
 {
     this.EntityFactory = entityFactory;
 }
Example #57
0
 /// <summary> Retrieves all related entities of type 'ForumEntity' using a relation of type '1:n'.</summary>
 /// <param name="forceFetch">if true, it will discard any changes currently in the collection and will rerun the complete query instead</param>
 /// <param name="entityFactoryToUse">The entity factory to use for the GetMultiManyToOne() routine.</param>
 /// <param name="filter">Extra filter to limit the resultset.</param>
 /// <returns>Filled collection with all related entities of the type constructed by the passed in entity factory</returns>
 public virtual SD.HnD.DAL.CollectionClasses.ForumCollection GetMultiForums(bool forceFetch, IEntityFactory entityFactoryToUse, IPredicateExpression filter)
 {
     if( ( !_alreadyFetchedForums || forceFetch || _alwaysFetchForums) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode)
     {
         AddToTransactionIfNecessary(_forums);
         _forums.SuppressClearInGetMulti=!forceFetch;
         _forums.EntityFactoryToUse = entityFactoryToUse;
         _forums.GetMultiManyToOne(this, null, filter);
         _forums.SuppressClearInGetMulti=false;
         _alreadyFetchedForums = true;
     }
     return _forums;
 }
Example #58
0
        /// <summary>Retrieves in the calling EmployeeCollection object all EmployeeEntity objects which are related via a relation of type 'm:n' with the passed in TerritoryEntity.</summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="territoryInstance">TerritoryEntity object to be used as a filter in the m:n relation</param>
        /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>true if succeeded, false otherwise</returns>
        public bool GetMultiUsingTerritoryCollectionViaEmployeeTerritory(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity territoryInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
        {
            RelationCollection relations = new RelationCollection();

            relations.Add(EmployeeEntity.Relations.EmployeeTerritoryEntityUsingEmployeeId, "EmployeeTerritory_");
            relations.Add(EmployeeTerritoryEntity.Relations.TerritoryEntityUsingTerritoryId, "EmployeeTerritory_", string.Empty, JoinHint.None);
            IPredicateExpression selectFilter = new PredicateExpression();

            selectFilter.Add(new FieldCompareValuePredicate(territoryInstance.Fields[(int)TerritoryFieldIndex.TerritoryId], ComparisonOperator.Equal));
            return(this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize));
        }
Example #59
0
 /// <summary>
 /// Retrieves in the calling MUserCollection object all MUserEntity objects which have data in common
 /// with the specified related Entities. If one is omitted, that entity is not used as a filter. 
 /// </summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. 
 /// When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
 /// <param name="mhakAksesInstance">MHakAksesEntity instance to use as a filter for the MUserEntity objects to return</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity mhakAksesInstance, int pageNumber, int pageSize)
 {
     base.EntityFactoryToUse = entityFactoryToUse;
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Kalibrasi.Data.EntityType.MUserEntity);
     IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(mhakAksesInstance, fieldsToReturn);
     if(filter!=null)
     {
         selectFilter.AddWithAnd(filter);
     }
     return base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize);
 }
Example #60
0
        /// <summary>Retrieves in the calling EmployeeCollection object all EmployeeEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary>
        /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
        /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
        /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param>
        /// <param name="employeeSuperiorInstance">EmployeeEntity instance to use as a filter for the EmployeeEntity objects to return</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity employeeSuperiorInstance, int pageNumber, int pageSize)
        {
            this.EntityFactoryToUse = entityFactoryToUse;
            IEntityFields        fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SD.LLBLGen.Pro.Examples.EntityType.EmployeeEntity);
            IPredicateExpression selectFilter   = CreateFilterUsingForeignKeys(employeeSuperiorInstance, fieldsToReturn);

            if (filter != null)
            {
                selectFilter.AddWithAnd(filter);
            }
            return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize));
        }