/// <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(PurchaseHistoryFieldIndex 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;
			}
			return DAOFactory.CreatePurchaseHistoryDAO().GetScalar(fields, this.Transaction, filter, relations, groupByClause);
		}
        /// <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(SalesOrderDetailFieldIndex 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;
            }
            SalesOrderDetailDAO dao = DAOFactory.CreateSalesOrderDetailDAO();

            return(dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var authorid   = Convert.ToInt32(Request.QueryString["authorid"]);
            var fkAuthorId = (EntityField2)EntityFieldFactory.Create("PostEntity", "FkAuthorId");
            var parameter  = new EntityDataSourceParameterBase
            {
                PathsFunc   = path2 => path2.Add(PostEntity.PrefetchPathCategory1CollectionViaCategory1Post),
                FiltersFunc = filters => filters.Add(fkAuthorId == authorid)
            };

            using (var ds = new EntityDataSourceBase <PostEntity, EntityDataSourceParameterBase>())
            {
                var entities = ds.GetEntities(parameter);
                rpt.DataSource = entities;
            }
            rpt.DataBind();
        }
Beispiel #4
0
 /// <summary>Creates a new sort clause for the CustomerAddressEntity field specified.</summary>
 public static ISortClause Create(CustomerAddressFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse, objectAlias));
 }
Beispiel #5
0
 /// <summary>Creates a new sort clause for the CustomerEntity field specified.</summary>
 public static ISortClause Create(CustomerFieldIndex fieldToSort, SortOperator operatorToUse)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse));
 }
Beispiel #6
0
 /// <summary>Creates a new sort clause for the SpecialOfferProductEntity field specified.</summary>
 public static ISortClause Create(SpecialOfferProductFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse, objectAlias));
 }
Beispiel #7
0
 /// <summary>Creates a new sort clause for the SalesOrderHeaderEntity field specified.</summary>
 public static ISortClause Create(SalesOrderHeaderFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse, objectAlias));
 }
Beispiel #8
0
 /// <summary>Creates a new sort clause for the SalesOrderDetailEntity field specified.</summary>
 public static ISortClause Create(SalesOrderDetailFieldIndex fieldToSort, SortOperator operatorToUse)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse));
 }
Beispiel #9
0
 /// <summary>Creates a new sort clause for the EmployeeAddressEntity field specified.</summary>
 public static ISortClause Create(EmployeeAddressFieldIndex fieldToSort, SortOperator operatorToUse)
 {
     return(new SortClause(EntityFieldFactory.Create(fieldToSort), operatorToUse));
 }
Beispiel #10
0
 /// <summary>
 ///
 /// </summary>
 public UsernameLengthAttribute()
     : base(EntityFieldFactory.Create(UserFieldIndex.Username).MaxLength)
 {
     MinimumLength = EpicMembershipProvider.MinUsernameLength;
 }