/// <summary>
 /// Method Adds Sub conditions to <see cref="TreeItemConditionRelation"/> root object.
 /// </summary>
 /// <param name="multiFieldArray">
 /// Array of multi Field
 /// </param>
 /// <param name="rootCondition">
 /// <see cref="TreeItemConditionRelation"/> root object.
 /// </param>
 /// <param name="fieldValueArray">
 /// Array of field Values
 /// </param>
 /// <param name="emptyFieldValue">
 /// is FieldValue empty
 /// </param>
 /// <param name="compare">
 /// comparison string
 /// </param>
 private void AddTreeItemSubConditions(
     int[] multiFieldArray,
     TreeItemConditionRelation rootCondition,
     List <object> fieldValueArray,
     bool emptyFieldValue,
     string compare)
 {
     if (multiFieldArray != null)
     {
         foreach (var fieldIndex in multiFieldArray)
         {
             if (emptyFieldValue)
             {
                 rootCondition.AddSubCondition(new TreeItemConditionFieldValue((FieldIdType)fieldIndex, string.Empty, compare));
             }
             else
             {
                 foreach (string fieldValue in fieldValueArray)
                 {
                     rootCondition.AddSubCondition(new TreeItemConditionFieldValue((FieldIdType)fieldIndex, fieldValue, compare));
                 }
             }
         }
     }
     else
     {
         foreach (string fieldValue in fieldValueArray)
         {
             rootCondition.AddSubCondition(new TreeItemConditionFieldValue((FieldIdType)FieldIndex, fieldValue, compare));
         }
     }
 }
예제 #2
0
        /// <summary>
        /// Creates the query condition options.
        /// </summary>
        /// <param name="crmDatabase">
        /// The CRM database.
        /// </param>
        /// <param name="options">
        /// The options.
        /// </param>
        /// <returns>
        /// The <see cref="TreeItemConditionRelation"/>.
        /// </returns>
        public override TreeItemCondition CreateQueryConditionOptions(CRMDatabase crmDatabase, int options)
        {
            var condition = new TreeItemConditionRelation(this.relation);

            foreach (var subCondition in this.conditions)
            {
                condition.AddSubCondition(subCondition.CreateQueryConditionOptions(crmDatabase, options));
            }

            return(condition);
        }