Beispiel #1
0
        /// <summary>
        /// Adds filters for special fields: DataOne,DataTwo and DataThree
        /// </summary>
        /// <param name="specialField"></param>
        /// <param name="operatorName"></param>
        /// <param name="value"></param>
        public void AddDataFieldFilter(DataObjectSpecialField specialField, DataObjectOperator operatorName, long value)
        {
            string specialFieldName = specialField == DataObjectSpecialField.DataOne ? "data1" : (specialField == DataObjectSpecialField.DataTwo) ? "data2" : "data3";

            string operatorString = "";

            switch (operatorName)
            {
            case DataObjectOperator.Equals:
                operatorString = "eq";
                break;

            case DataObjectOperator.GreaterThan:
                operatorString = "gt";
                break;

            case DataObjectOperator.GreaterThanOrEquals:
                operatorString = "gte";
                break;

            case DataObjectOperator.LowerThan:
                operatorString = "lt";
                break;

            case DataObjectOperator.LowerThanOrEquals:
                operatorString = "lte";
                break;

            case DataObjectOperator.NotEquals:
                operatorString = "neq";
                break;
            }
            _dataFieldFilters.Add(string.Format("{0}__{1}", specialFieldName, operatorString), value.ToString());
        }
        /// <summary>
        /// Adds filters for special fields: DataOne,DataTwo and DataThree
        /// </summary>
        /// <param name="specialField"></param>
        /// <param name="operatorName"></param>
        /// <param name="value"></param>
        public void AddDataFieldFilter(DataObjectSpecialField specialField, DataObjectOperator operatorName, long value)
        {
            string specialFieldName = specialField == DataObjectSpecialField.DataOne ? "data1" : (specialField == DataObjectSpecialField.DataTwo) ? "data2" : "data3";

            string operatorString = "";
            switch (operatorName)
            {
                case DataObjectOperator.Equals:
                    operatorString = "eq";
                    break;
                case DataObjectOperator.GreaterThan:
                    operatorString = "gt";
                    break;
                case DataObjectOperator.GreaterThanOrEquals:
                    operatorString = "gte";
                    break;
                case DataObjectOperator.LowerThan:
                    operatorString = "lt";
                    break;
                case DataObjectOperator.LowerThanOrEquals:
                    operatorString = "lte";
                    break;
                case DataObjectOperator.NotEquals:
                    operatorString = "neq";
                    break;
            }
            _dataFieldFilters.Add(string.Format("{0}__{1}", specialFieldName, operatorString), value.ToString());
        }