コード例 #1
0
 /// <summary>Creates the specified field on the position indexInResultset in the resultset.</summary>
 /// <param name="fieldToDefine">The specification of the field to create.</param>
 /// <param name="indexInResultset">The position in the resultset where the field will be created on</param>
 /// <param name="alias">The alias to use for this field in the resultset</param>
 /// <param name="entityAlias">The alias to use for the entity this field belongs to. Required to specify multiple times the same entity in a typed list</param>
 /// <param name="aggregateFunctionToApply">the aggregate function to apply to this field.</param>
 public void DefineField(ProductVariationFieldIndex fieldToDefine, int indexInResultset, string alias, string entityAlias, AggregateFunction aggregateFunctionToApply)
 {
     IEntityField2 fieldToAdd = EntityFieldFactory.Create(fieldToDefine);
     fieldToAdd.Alias = alias;
     fieldToAdd.ObjectAlias = entityAlias;
     fieldToAdd.AggregateFunctionToApply = aggregateFunctionToApply;
     base[indexInResultset] = fieldToAdd;
 }
コード例 #2
0
 /// <summary>Creates the specified field on the position indexInResultset in the resultset.</summary>
 /// <param name="fieldToDefine">The specification of the field to create.</param>
 /// <param name="indexInResultset">The position in the resultset where the field will be created on</param>
 /// <param name="alias">The alias to use for this field in the resultset</param>
 /// <param name="entityAlias">The alias to use for the entity this field belongs to. Required to specify multiple times the same entity in a typed list</param>
 public void DefineField(ProductVariationFieldIndex fieldToDefine, int indexInResultset, string alias, string entityAlias)
 {
     DefineField(fieldToDefine, indexInResultset, alias, entityAlias, AggregateFunction.None);
 }
コード例 #3
0
 /// <summary>Creates a new sort clause for the ProductVariationEntity field specified.</summary>
 public static ISortClause Create(ProductVariationFieldIndex fieldToSort, SortOperator operatorToUse, string objectAlias)
 {
     return new SortClause(EntityFieldFactory.Create(fieldToSort), null, operatorToUse, objectAlias);
 }
コード例 #4
0
        /// <summary> Creates a new IEntityField2 instance for usage in the EntityFields object for the ProductVariationEntity. Which EntityField is created is specified by fieldIndex</summary>
        /// <param name="fieldIndex">The field which IEntityField2 instance should be created</param>
        /// <returns>The IEntityField2 instance for the field specified in fieldIndex</returns>
        public static IEntityField2 Create(ProductVariationFieldIndex fieldIndex)
        {
            IEntityField2 fieldToReturn = null;
            switch(fieldIndex)
            {
                case ProductVariationFieldIndex.Id:
                    fieldToReturn = new EntityField2("Id", "ProductVariationEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), true, (int)fieldIndex, 0, 0, 10, false, true, false);
                    break;
                case ProductVariationFieldIndex.ProductId:
                    fieldToReturn = new EntityField2("ProductId", "ProductVariationEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), false, (int)fieldIndex, 0, 0, 10, true, false, true);
                    break;
                case ProductVariationFieldIndex.Price:
                    fieldToReturn = new EntityField2("Price", "ProductVariationEntity", typeof(System.Decimal), TypeDefaultValue.GetDefaultValue(typeof(System.Decimal)), false, (int)fieldIndex, 0, 0, 19, false, false, true);
                    break;
                case ProductVariationFieldIndex.PriceIncludesVat:
                    fieldToReturn = new EntityField2("PriceIncludesVat", "ProductVariationEntity", typeof(System.Boolean), TypeDefaultValue.GetDefaultValue(typeof(System.Boolean)), false, (int)fieldIndex, 2, 0, 0, false, false, false);
                    break;
                case ProductVariationFieldIndex.PriceIsFrom:
                    fieldToReturn = new EntityField2("PriceIsFrom", "ProductVariationEntity", typeof(System.Boolean), TypeDefaultValue.GetDefaultValue(typeof(System.Boolean)), false, (int)fieldIndex, 2, 0, 0, false, false, false);
                    break;
                case ProductVariationFieldIndex.Text:
                    fieldToReturn = new EntityField2("Text", "ProductVariationEntity", typeof(System.String), TypeDefaultValue.GetDefaultValue(typeof(System.String)), false, (int)fieldIndex, 100, 0, 0, false, false, true);
                    break;

            }
            return fieldToReturn;
        }
コード例 #5
0
 /// <summary>Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise.
 /// Should not be used for testing if the current value is NULL, use <see cref="TestCurrentFieldValueForNull"/> for that.</summary>
 /// <param name="fieldIndex">Index of the field to test if that field was NULL in the persistent storage</param>
 /// <returns>true if the field with the passed in index was NULL in the persistent storage, false otherwise</returns>
 public bool TestOriginalFieldValueForNull(ProductVariationFieldIndex fieldIndex)
 {
     return base.Fields[(int)fieldIndex].IsNull;
 }
コード例 #6
0
 /// <summary>Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise.
 /// Should not be used for testing if the original value (read from the db) is NULL</summary>
 /// <param name="fieldIndex">Index of the field to test if its currentvalue is null/undefined</param>
 /// <returns>true if the field's value isn't defined yet, false otherwise</returns>
 public bool TestCurrentFieldValueForNull(ProductVariationFieldIndex fieldIndex)
 {
     return base.CheckIfCurrentFieldValueIsNull((int)fieldIndex);
 }