/// <summary> Retrieves in this WorkOrderCollection object all WorkOrderEntity objects which are related via a  relation of type 'm:n' with the passed in LocationEntity. 
		/// All current elements in the collection are removed from the collection.</summary>
		/// <param name="locationInstance">LocationEntity object to be used as a filter in the m:n relation</param>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
		/// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
		/// <returns>true if the retrieval succeeded, false otherwise</returns>
		public bool GetMultiManyToManyUsingLocationCollectionViaWorkOrderRouting(IEntity locationInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath prefetchPathToUse)
		{
			if(!base.SuppressClearInGetMulti)
			{
				this.Clear();
			}
			WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();
			return dao.GetMultiUsingLocationCollectionViaWorkOrderRouting(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, locationInstance, prefetchPathToUse);
		}
Пример #2
0
        /// <summary> Retrieves in this WorkOrderCollection object all WorkOrderEntity objects which are related via a  relation of type 'm:n' with the passed in ServiceLocationEntity.
        /// All current elements in the collection are removed from the collection.</summary>
        /// <param name="serviceLocationInstance">ServiceLocationEntity object to be used as a filter in the m:n relation</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</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 the retrieval succeeded, false otherwise</returns>
        public virtual bool GetMultiManyToManyUsingServiceLocationCollectionViaWorkOrderEmployee(IEntity serviceLocationInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, int pageNumber, int pageSize)
        {
            if (!base.SuppressClearInGetMulti)
            {
                this.Clear();
            }
            WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();

            return(dao.GetMultiUsingServiceLocationCollectionViaWorkOrderEmployee(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, serviceLocationInstance, pageNumber, pageSize));
        }
		/// <summary> Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on.</summary>
		/// <param name="fieldIndex">Field index of field to which to apply the aggregate function and expression</param>
		/// <param name="expressionToExecute">The expression to execute. Can be null</param>
		/// <param name="aggregateToApply">Aggregate function to apply. </param>
		/// <param name="filter">The filter to apply to retrieve the scalar</param>
		/// <param name="relations">The relations to walk</param>
		/// <param name="groupByClause">The groupby clause to apply to retrieve the scalar</param>
		/// <returns>the scalar value requested</returns>
		public virtual object GetScalar(WorkOrderFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause)
		{
			EntityFields fields = new EntityFields(1);
			fields[0] = EntityFieldFactory.Create(fieldIndex);
			if((fields[0].ExpressionToApply == null) || (expressionToExecute != null))
			{
				fields[0].ExpressionToApply = expressionToExecute;
			}
			if((fields[0].AggregateFunctionToApply == AggregateFunction.None) || (aggregateToApply != AggregateFunction.None))
			{
				fields[0].AggregateFunctionToApply = aggregateToApply;
			}
			WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();
			return dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause);
		}
		/// <summary> Retrieves in this WorkOrderCollection object all WorkOrderEntity objects which have data in common with the specified related Entities.
		/// If one is omitted, that entity is not used as a filter. All current elements in the collection are removed from the collection.</summary>
		/// <param name="productInstance">ProductEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <param name="scrapReasonInstance">ScrapReasonEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
		/// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</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="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 virtual bool GetMultiManyToOne(IEntity productInstance, IEntity scrapReasonInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicateExpression filter, int pageNumber, int pageSize)
		{
			bool validParameters = false;
			validParameters |= (productInstance!=null);
			validParameters |= (scrapReasonInstance!=null);
			if(!validParameters)
			{
				return GetMulti(filter, maxNumberOfItemsToReturn, sortClauses, null, pageNumber, pageSize);
			}
			if(!base.SuppressClearInGetMulti)
			{
				this.Clear();
			}
			WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();
			return dao.GetMulti(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, filter, productInstance, scrapReasonInstance, pageNumber, pageSize);
		}
Пример #5
0
        /// <summary> Retrieves Entity rows in a datatable which match the specified filter. It will always create a new connection to the database.</summary>
        /// <param name="selectFilter">A predicate or predicate expression which should be used as filter for the entities to retrieve.</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
        /// <param name="relations">The set of relations to walk to construct to total query.</param>
        /// <param name="pageNumber">The page number to retrieve.</param>
        /// <param name="pageSize">The page size of the page to retrieve.</param>
        /// <returns>DataTable with the rows requested.</returns>
        public static DataTable GetMultiAsDataTable(IPredicate selectFilter, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, int pageNumber, int pageSize)
        {
            WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();

            return(dao.GetMultiAsDataTable(maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, pageNumber, pageSize));
        }
Пример #6
0
        /// <summary> Updates in the persistent storage all WorkOrder entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter.
        /// Which fields are updated in those matching entities depends on which fields are <i>changed</i> in the passed in entity entityWithNewValues. The new values of these fields are read from entityWithNewValues. </summary>
        /// <param name="entityWithNewValues">WorkOrderEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account</param>
        /// <param name="accountInstance">AccountEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <param name="employeeInstance">EmployeeEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <param name="serviceTypeInstance">ServiceTypeEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
        public int UpdateMultiManyToOne(WorkOrderEntity entityWithNewValues, IEntity accountInstance, IEntity employeeInstance, IEntity serviceTypeInstance)
        {
            WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();

            return(dao.UpdateMulti(entityWithNewValues, base.Transaction, accountInstance, employeeInstance, serviceTypeInstance));
        }
Пример #7
0
        /// <summary> Deletes from the persistent storage all WorkOrder entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter.</summary>
        /// <remarks>Runs directly on the persistent storage. It will not delete entity objects from the current collection.</remarks>
        /// <param name="accountInstance">AccountEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <param name="employeeInstance">EmployeeEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <param name="serviceTypeInstance">ServiceTypeEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
        /// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
        public int DeleteMultiManyToOne(IEntity accountInstance, IEntity employeeInstance, IEntity serviceTypeInstance)
        {
            WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();

            return(dao.DeleteMulti(base.Transaction, accountInstance, employeeInstance, serviceTypeInstance));
        }
		/// <summary> Updates in the persistent storage all WorkOrder entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter.
		/// Which fields are updated in those matching entities depends on which fields are <i>changed</i> in the passed in entity entityWithNewValues. The new values of these fields are read from entityWithNewValues. </summary>
		/// <param name="entityWithNewValues">WorkOrderEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account</param>
		/// <param name="productInstance">ProductEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <param name="scrapReasonInstance">ScrapReasonEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
		public int UpdateMultiManyToOne(WorkOrderEntity entityWithNewValues, IEntity productInstance, IEntity scrapReasonInstance)
		{
			WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();
			return dao.UpdateMulti(entityWithNewValues, base.Transaction, productInstance, scrapReasonInstance);
		}
		/// <summary> Deletes from the persistent storage all WorkOrder entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter.</summary>
		/// <remarks>Runs directly on the persistent storage. It will not delete entity objects from the current collection.</remarks>
		/// <param name="productInstance">ProductEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <param name="scrapReasonInstance">ScrapReasonEntity instance to use as a filter for the WorkOrderEntity objects to return</param>
		/// <returns>Amount of entities affected, if the used persistent storage has rowcounting enabled.</returns>
		public int DeleteMultiManyToOne(IEntity productInstance, IEntity scrapReasonInstance)
		{
			WorkOrderDAO dao = DAOFactory.CreateWorkOrderDAO();
			return dao.DeleteMulti(base.Transaction, productInstance, scrapReasonInstance);
		}