Example #1
0
 internal static void SetValue(TypedValue tv, MFDataType dataType, object value)
 {
     if (value == null)
     {
         tv.SetValueToNULL(dataType);
     }
     else
     {
         Validate(dataType, value);
         tv.SetValue(dataType, value);
     }
 }
        public SearchParameters AddPDNullCheck(int property_def, MFDataType dataType, bool is_null = true)
        {
            TypedValue value = new TypedValue();

            value.SetValueToNULL(dataType);
            SearchCondition search = new SearchCondition();

            search.Expression.DataPropertyValuePropertyDef = property_def;
            Expression exp = new Expression();

            exp.SetPropertyValueExpression(property_def, MFParentChildBehavior.MFParentChildBehaviorNone);
            search.ConditionType = is_null ? MFConditionType.MFConditionTypeEqual : MFConditionType.MFConditionTypeNotEqual;
            search.Set(exp, search.ConditionType, value);
            this.Conditions.Add(1, search);
            return(this);
        }