/// <summary>Adds a new <c>&lt;SIF_Condition&gt;</c> child element.</summary>
	/// <param name="val">A SIF_Condition object</param>
	/// <remarks>
	/// <para>Version: 2.6</para>
	/// <para>Since: 1.1</para>
	/// </remarks>
	public void AddSIF_Condition( SIF_Condition val ) { 
		AddChild( InfraDTD.SIF_CONDITIONS_SIF_CONDITION, val );
	}
 /// <summary>
 /// Sets all SIF_Condition object instances. All existing 
 /// <c>SIF_Condition</c> instances 
 /// are removed and replaced with this list. Calling this method with the 
 /// parameter value set to null removes all <c>SIF_Conditions</c>.
 /// </summary>
 /// <remarks>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void SetSIF_Conditions( SIF_Condition[] items)
 {
     SetChildren( InfraDTD.SIF_CONDITIONS_SIF_CONDITION, items );
 }
Beispiel #3
0
        public void testCreateWithSIF_Query()
        {
            SIF_Query q = new SIF_Query( new SIF_QueryObject(
                                             ReportingDTD.STUDENTLOCATOR.Name ) );
            SIF_ConditionGroup scg = new SIF_ConditionGroup();
            scg.SetType( ConditionType.NONE );

            SIF_Condition sifCondition = new SIF_Condition(
                "RequestingAgencyId[@Type=\"School\"]", Operators.EQ, "2001" );
            SIF_Conditions conds = new SIF_Conditions( ConditionType.NONE );
            conds.AddChild( sifCondition );
            scg.AddSIF_Conditions( conds );
            q.SIF_ConditionGroup = scg;

            Query query = new Query( q );

            Assert.IsTrue( query.HasConditions );
            ConditionGroup[] conditions = query.Conditions;
            Assert.AreEqual( 1, conditions.Length, "One Condition Group" );
            Assert.AreEqual( GroupOperator.None, conditions[0].Operator, "None" );
            Condition condition = conditions[0].Conditions[0];
            Assert.AreEqual( "2001", condition.Value, "RequestingAgencyId" );
            Assert.AreEqual( ComparisonOperators.EQ, condition.Operators, "RequestingAgencyId" );
            Assert.AreEqual( ReportingDTD.STUDENTLOCATOR_REQUESTINGAGENCYID, condition.Field, "RequestingAgencyId" );
        }
 /// <summary>Adds a new <c>&lt;SIF_Condition&gt;</c> child element.</summary>
 /// <param name="val">A SIF_Condition object</param>
 /// <remarks>
 /// <para>Version: 2.6</para>
 /// <para>Since: 1.1</para>
 /// </remarks>
 public void AddSIF_Condition( SIF_Condition val )
 {
     AddChild( InfraDTD.SIF_CONDITIONS_SIF_CONDITION, val );
 }
Beispiel #5
0
 private void PopulateConditions(SIF_Query query,
                                  SIF_Condition[] clist,
                                  ConditionGroup target)
 {
     for (int i = 0; i < clist.Length; i++)
     {
         String o = clist[i].SIF_Operator;
         ComparisonOperators ops = Condition.ParseComparisionOperators(o);
         String val = clist[i].SIF_Value;
         String path = clist[i].SIF_Element;
         target.AddCondition(fObjType, path, ops, val);
     }
 }