Beispiel #1
0
        protected virtual SQLDataFilterParameter[] GetParameters(DataFilterCondition condition)
        {
            SQLDataFilterParameter[] parameters = null;
            if (condition.ConditionType == FilterConditionType.Range)
            {
                parameters = new SQLDataFilterParameter[2];
            }
            else
            {
                parameters = new SQLDataFilterParameter[1];
            }
            string singleParameterName = ((condition.ConditionType == FilterConditionType.Range) ? condition.Parameter.Name + "Before" : condition.Parameter.Name);

            parameters[0] = new SQLDataFilterParameter(
                singleParameterName,
                ConvertToDbType(condition.Parameter.Type),
                1000,
                ParameterDirection.Input,
                53,
                4,
                condition.LeftOperand,
                condition.Parameter.Type.FullName);
            if (condition.ConditionType == FilterConditionType.Range)
            {
                parameters[1] = new SQLDataFilterParameter(
                    condition.Parameter.Name + "After",
                    ConvertToDbType(condition.Parameter.Type),
                    1000,
                    ParameterDirection.Input,
                    53,
                    4,
                    condition.RightOperand,
                    condition.Parameter.Type.FullName);
            }
            return(parameters);
        }
Beispiel #2
0
 public void SetCondition(DataFilterCondition condition)
 {
     conditions.Add(condition);
 }